1
General / Visual Studio 12 (2013 preview) static linking
« on: August 28, 2013, 12:46:34 am »
Heya,
I did create the visual studio 12-solutions using CMake (had to use solutions, because my antivir would give me 2 alerts about a trojan when building an nmake-thing)...
When using the shared-libs option in CMake everything works fine (tested with the tutorial code)...
But when i try to use the static libs (sfml-xxx-s-d.lib e.g.) visual studio could not load the following projects, because the the vcxproj-files had invalid entries:
sfml-audio
sfml-graphics
sfml-window
sfml-network
the invalid entries were the "<Lib> <AdditionalOptions>..." -entries...
So i did delete those and added an cpp file to every project which includes the additional dependencies mentioned in the <Lib>-section.
But when i tried building a test-project with static linkage, visual studio reported linking errors to missing external symbols...
After trying some things i got it to work:
I had to add the library files mentioned in the lib-sections manually as additional dependencies.
E.g.:
When using sfml-window-s.lib & sfml-graphics-s.lib i had to do the following:
Anyone knows why i have to do add those libs manually and why they are not included in the sfml-lib-files, and how to fix this?...
I did create the visual studio 12-solutions using CMake (had to use solutions, because my antivir would give me 2 alerts about a trojan when building an nmake-thing)...
When using the shared-libs option in CMake everything works fine (tested with the tutorial code)...
But when i try to use the static libs (sfml-xxx-s-d.lib e.g.) visual studio could not load the following projects, because the the vcxproj-files had invalid entries:
sfml-audio
sfml-graphics
sfml-window
sfml-network
the invalid entries were the "<Lib> <AdditionalOptions>..." -entries...
So i did delete those and added an cpp file to every project which includes the additional dependencies mentioned in the <Lib>-section.
But when i tried building a test-project with static linkage, visual studio reported linking errors to missing external symbols...
After trying some things i got it to work:
I had to add the library files mentioned in the lib-sections manually as additional dependencies.
E.g.:
When using sfml-window-s.lib & sfml-graphics-s.lib i had to do the following:
#pragma comment(lib, "glew.lib")
#pragma comment(lib, "freetype.lib")
#pragma comment(lib, "jpeg.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "gdi32.lib")
(Of course, this would also work then adding them manually in the project properties)...#pragma comment(lib, "freetype.lib")
#pragma comment(lib, "jpeg.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "gdi32.lib")
Anyone knows why i have to do add those libs manually and why they are not included in the sfml-lib-files, and how to fix this?...