Don't forget to select a static link to the Standard Libraries again!I'm not on Windows so SFML_USE_STATIC_STD_LIBS isn't an option so I can't turn it on... oh well...
CMake will say that it needs to know where the SFML include directory is, as well as the SFML static libraries. Let the system know the locations of these and you should be all set.cmake says none of that .___.; no errors so let's push on...
-------------- Build: Debug in d_test_004 (compiler: Digital Mars D Compiler)---------------
dmd -ofbin/Debug/d_test_004 obj/Debug/main.o -L-ldsfml-graphics -L-ldsfml-window -L-ldsfml-system -L-ldsfml-audio -L-ldsfml-network -L-ldsfml-graphics-2 -L-ldsfml-window-2 -L-ldsfml-system-2 -L-ldsfml-audio-2 -L-ldsfml-network-2 -L-lpthread -L-lm -L-lphobos2
/usr/bin/ld: cannot find -ldsfml-graphics
/usr/bin/ld: cannot find -ldsfml-window
/usr/bin/ld: cannot find -ldsfml-system
/usr/bin/ld: cannot find -ldsfml-audio
/usr/bin/ld: cannot find -ldsfml-network
/usr/bin/ld: cannot find -ldsfml-graphics-2
/usr/bin/ld: cannot find -ldsfml-window-2
/usr/bin/ld: cannot find -ldsfml-system-2
/usr/bin/ld: cannot find -ldsfml-audio-2
/usr/bin/ld: cannot find -ldsfml-network-2
collect2: error: ld returned 1 exit status
--- errorlevel 1
GDC can't find the -2 libs.-------------- Build: Debug in d_test_004 (compiler: GDC D Compiler)---------------
gdc -L/SFML/DSFML-nightly -L/usr/lib -o bin/Debug/d_test_004 obj/Debug/main.o -ldsfml-graphics -ldsfml-window -ldsfml-system -ldsfml-audio -ldsfml-network -ldsfml-graphics-2 -ldsfml-window-2 -ldsfml-system-2 -ldsfml-audio-2 -ldsfml-network-2
/usr/bin/ld: cannot find -ldsfml-graphics-2
/usr/bin/ld: cannot find -ldsfml-window-2
/usr/bin/ld: cannot find -ldsfml-system-2
/usr/bin/ld: cannot find -ldsfml-audio-2
/usr/bin/ld: cannot find -ldsfml-network-2
collect2: error: ld returned 1 exit status
Even manually adding in -L-LDSFML/DIRECTORY etc to the additional options doesn't change the error:gdc -L/SFML/DSFML-nightly -L/usr/lib -o bin/Debug/d_test_004 obj/Debug/main.o -L-LSFML/DSFML-nightly -ISFML/DSFML-source/src -L-LSFML/DSFML-source/lib -ldsfml-graphics -ldsfml-window -ldsfml-system -ldsfml-audio -ldsfml-network -ldsfml-graphics-2 -ldsfml-window-2 -ldsfml-system-2 -ldsfml-audio-2 -ldsfml-network-2
._____.; Any clue on why it can't find the things? Am I meant to be linking to something else/somewhere else? Am I spelling the names wrong someplace? Am I missing a flag or... I don't even know...dmd main.d -I/SFML/DSFML-source/src -L-L/SFML/DSFML-source/lib -L-L/SFML/DSFML-nightly -L-ldsfml-graphics-2 -L-ldsfml-window-2 -L-ldsfml-system-2 -L-ldsfml-graphics -L-ldsfml-window -L-ldsfml-system -L-ljpeg -L-lGL -L-lGLU -L-lfreetype -L-lGLEW -L-lX11 -L-lXrandr
But trying to run the resulting file gives me "./main: error while loading shared libraries: libdsfml-graphics.so.2: cannot open shared object file: No such file or directory." Even copying and pasting the file into the directory where main.d resides gives the same message. Trying to run the same code but with GDC instead of DMD gives me a bunch of weird errors of this form:/tmp/ccyf1hbg.o: In function `_Dmain':
main.d:(.text+0x9f): undefined reference to `_D5dsfml6window9videomode9VideoMode6__ctorMFNckkkZS5dsfml6window9videomode9VideoMode'
"./main: error while loading shared libraries: libdsfml-graphics.so.2: cannot open shared object file: No such file or directory."
gdc main.d -I/SFML/DSFML-source/src -L-L/SFML/DSFML-source/lib -L-L/SFML/DSFML-nightly -L-ldsfml-graphics-2 -L-ldsfml-window-2 -L-ldsfml-system-2 -L-ldsfml-graphics -L-ldsfml-window -L-ldsfml-system -L-ljpeg -L-lGL -L-lGLU -L-lfreetype -L-lGLEW -L-lX11 -L-lXrandr
/tmp/ccLzt87z.o: In function `_Dmain':
main.d:(.text+0x9f): undefined reference to `_D5dsfml6window9videomode9VideoMode6__ctorMFNckkkZS5dsfml6window9videomode9VideoMode'
main.d:(.text+0xca): undefined reference to `_D5dsfml8graphics12renderwindow12RenderWindow7__ClassZ'
main.d:(.text+0xf6): undefined reference to `_D5dsfml6window15contextsettings15ContextSettings7DefaultxS5dsfml6window15contextsettings15ContextSettings'
main.d:(.text+0x109): undefined reference to `_D5dsfml8graphics12renderwindow12RenderWindow6__ctorMFS5dsfml6window9videomode9VideoModeAyaE5dsfml6window6window6Window5StyleKxS5dsfml6window15contextsettings15ContextSettingsZC5dsfml8graphics12renderwindow12RenderWindow'
main.d:(.text+0x112): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape7__ClassZ'
main.d:(.text+0x12c): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape6__ctorMFfkZC5dsfml8graphics11circleshape11CircleShape'
main.d:(.text+0x14a): undefined reference to `_D5dsfml8graphics5color5Color5GreenyS5dsfml8graphics5color5Color'
main.d:(.text+0x156): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__initZ'
main.d:(.text+0x186): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__ctorMFNaNbNcNfffZS5dsfml6system7vector214__T7Vector2TfZ7Vector2'
main.d:(.text+0x1c5): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape7__ClassZ'
main.d:(.text+0x1df): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape6__ctorMFfkZC5dsfml8graphics11circleshape11CircleShape'
main.d:(.text+0x1fd): undefined reference to `_D5dsfml8graphics5color5Color4BlueyS5dsfml8graphics5color5Color'
main.d:(.text+0x209): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__initZ'
main.d:(.text+0x239): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__ctorMFNaNbNcNfffZS5dsfml6system7vector214__T7Vector2TfZ7Vector2'
main.d:(.text+0x278): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape7__ClassZ'
main.d:(.text+0x292): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape6__ctorMFfkZC5dsfml8graphics11circleshape11CircleShape'
main.d:(.text+0x2b0): undefined reference to `_D5dsfml8graphics5color5Color4BlueyS5dsfml8graphics5color5Color'
main.d:(.text+0x2bc): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__initZ'
main.d:(.text+0x2ec): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__ctorMFNaNbNcNfffZS5dsfml6system7vector214__T7Vector2TfZ7Vector2'
main.d:(.text+0x32b): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape7__ClassZ'
main.d:(.text+0x345): undefined reference to `_D5dsfml8graphics11circleshape11CircleShape6__ctorMFfkZC5dsfml8graphics11circleshape11CircleShape'
main.d:(.text+0x363): undefined reference to `_D5dsfml8graphics5color5Color3RedyS5dsfml8graphics5color5Color'
main.d:(.text+0x36f): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__initZ'
main.d:(.text+0x39f): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__ctorMFNaNbNcNfffZS5dsfml6system7vector214__T7Vector2TfZ7Vector2'
main.d:(.text+0x3e0): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__initZ'
main.d:(.text+0x410): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__ctorMFNaNbNcNfffZS5dsfml6system7vector214__T7Vector2TfZ7Vector2'
main.d:(.text+0x41f): undefined reference to `_D5dsfml8graphics14rectangleshape14RectangleShape7__ClassZ'
main.d:(.text+0x43b): undefined reference to `_D5dsfml8graphics14rectangleshape14RectangleShape6__ctorMFS5dsfml6system7vector214__T7Vector2TfZ7Vector2ZC5dsfml8graphics14rectangleshape14RectangleShape'
main.d:(.text+0x459): undefined reference to `_D5dsfml8graphics5color5Color5GreenyS5dsfml8graphics5color5Color'
main.d:(.text+0x465): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__initZ'
main.d:(.text+0x495): undefined reference to `_D5dsfml6system7vector214__T7Vector2TfZ7Vector26__ctorMFNaNbNcNfffZS5dsfml6system7vector214__T7Vector2TfZ7Vector2'
main.d:(.text+0x502): undefined reference to `_D5dsfml6window5event5Event6__initZ'
main.d:(.text+0x510): undefined reference to `_D5dsfml6window5event5Event6__initZ'
main.d:(.text+0x58a): undefined reference to `_D5dsfml8graphics5color5Color5BlackyS5dsfml8graphics5color5Color'
main.d:(.text+0x59e): undefined reference to `_D5dsfml8graphics12renderstates12RenderStates7DefaultFNdZS5dsfml8graphics12renderstates12RenderStates'
main.d:(.text+0x634): undefined reference to `_D5dsfml8graphics12renderstates12RenderStates7DefaultFNdZS5dsfml8graphics12renderstates12RenderStates'
main.d:(.text+0x6ca): undefined reference to `_D5dsfml8graphics12renderstates12RenderStates7DefaultFNdZS5dsfml8graphics12renderstates12RenderStates'
main.d:(.text+0x760): undefined reference to `_D5dsfml8graphics12renderstates12RenderStates7DefaultFNdZS5dsfml8graphics12renderstates12RenderStates'
main.d:(.text+0x7f6): undefined reference to `_D5dsfml8graphics12renderstates12RenderStates7DefaultFNdZS5dsfml8graphics12renderstates12RenderStates'
/tmp/ccLzt87z.o:(.data+0x10): undefined reference to `_D5dsfml8graphics12__ModuleInfoZ'
/tmp/ccLzt87z.o:(.data._D87TypeInfo_S3std8typecons50__T10RebindableTyC5dsfml8graphics7texture7TextureZ10Rebindable6__initZ[_D87TypeInfo_S3std8typecons50__T10RebindableTyC5dsfml8graphics7texture7TextureZ10Rebindable6__initZ]+0x38): undefined reference to `_D3std8typecons50__T10RebindableTyC5dsfml8graphics7texture7TextureZ10Rebindable11__xopEqualsFKxS3std8typecons50__T10RebindableTyC5dsfml8graphics7texture7TextureZ10RebindableKxS3std8typecons50__T10RebindableTyC5dsfml8graphics7texture7TextureZ10RebindableZb'
/tmp/ccLzt87z.o:(.data._D85TypeInfo_S3std8typecons48__T10RebindableTyC5dsfml8graphics6shader6ShaderZ10Rebindable6__initZ[_D85TypeInfo_S3std8typecons48__T10RebindableTyC5dsfml8graphics6shader6ShaderZ10Rebindable6__initZ]+0x38): undefined reference to `_D3std8typecons48__T10RebindableTyC5dsfml8graphics6shader6ShaderZ10Rebindable11__xopEqualsFKxS3std8typecons48__T10RebindableTyC5dsfml8graphics6shader6ShaderZ10RebindableKxS3std8typecons48__T10RebindableTyC5dsfml8graphics6shader6ShaderZ10RebindableZb'
/tmp/ccLzt87z.o:(.data._D81TypeInfo_S3std8typecons44__T10RebindableTyC5dsfml8graphics4font4FontZ10Rebindable6__initZ[_D81TypeInfo_S3std8typecons44__T10RebindableTyC5dsfml8graphics4font4FontZ10Rebindable6__initZ]+0x38): undefined reference to `_D3std8typecons44__T10RebindableTyC5dsfml8graphics4font4FontZ10Rebindable11__xopEqualsFKxS3std8typecons44__T10RebindableTyC5dsfml8graphics4font4FontZ10RebindableKxS3std8typecons44__T10RebindableTyC5dsfml8graphics4font4FontZ10RebindableZb'
collect2: error: ld returned 1 exit status