1
D / Trouble Linking DSFML...
« on: February 04, 2015, 10:25:28 am »
I'm having trouble getting DSFML to link up correctly in Code::Blocks on my Linux Mint 17 x64 machine. I've tried building everything from source as per the tutorial(s) because I couldn't get the Nightlies to work, but to be honest I'm not really sure what I'm doing so I could be screwing up there without knowing it. Mainly I think I'm confused about what is referencing what in the tutorials and how I'd translate that to build options in my IDE of choice.
So, just to clarify or correct me:
I'm probably just missing something really simple and I've just misunderstood a part of something somewhere... If someone could show me where I'm going wrong that'd be a big help!
So, just to clarify or correct me:
- Download or otherwise have on system:
- SFML 2.0 Source http://www.sfml-dev.org/download/sfml/2.0/
- DSFML-C Source https://github.com/Jebbs/DSFML-C
- DSFML Source https://github.com/Jebbs/DSFML
- CMake
- DMD Compiler
- GCC Compiler
- Build using guide: https://github.com/Jebbs/DSFML/wiki/Building-DSFML-Libraries-From-Source%28Linux%29
- Build SFML 2.0 static library as per these instructions http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php
Generator: Unix Makefiles
Compiler: Default Native
Uncheck BUILD_SHARED_LIBS for static libs
(I have no idea where to put -fPIC, make won't accept it, not sure where to put it in the cmake-gui?)
Run make in the terminal at build location - Take file "<SFML static build directory>/cmake/Modules/FindSFML.cmake" and put it in "/usr/share/cmake-2.8/Modules"
- Build DSFML-C shared library using same technique as for SFML 2.0
Generator: Unix Makefiles
Compiler: Default NativeQuoteDon'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...QuoteCMake 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...
Check BUILD_SHARED_LIBS for shared libs (we want these ones to be shared, right??)
Run make in the terminal at build location - Build DFSML using Step 1 of https://github.com/Jebbs/DSFML/wiki/Building-Your-First-DSFML-Program%28Windows%29
In terminal at <DFSML source directory> run rdmd build.d
- Build SFML 2.0 static library as per these instructions http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php
- Setup IDE (Code::Blocks) borrowing info from: https://github.com/Jebbs/DSFML/wiki/Building-Your-First-DSFML-Program%28Windows%29
- File>>New>>Project>>D application
- Project>>Build Options
- Compiler: DMD
- >>Linker Settings>>Link Libraries
- dsfml-graphics
- dsfml-system
- dsfml-window
- dsfml-audio
- dsfml-network
- dsfml-graphics-2
- dsfml-system-2
- dsfml-window-2
- dsfml-audio-2
- dsfml-network-2
- >>Search Directories
- >>Compiler
- <DSFML source directory>/src
- >>Linker
- <DSFML source directory>/lib
- <DSFML-C shared lib directory>/lib
- >>Compiler
- Add main.d to project
Add some code to file. - Build + Run Project
All should work? Yes? - After weeks of trying and fiddling around with what links where and rebuilding everything ask internet for help...
- File>>New>>Project>>D application
I'm probably just missing something really simple and I've just misunderstood a part of something somewhere... If someone could show me where I'm going wrong that'd be a big help!