spring & visual studio
Moderator: Moderators
spring & visual studio
Has anyone been able to get a .sln file for Visual Studio following relevant section of https://springrts.com/wiki/Building_Spring_on_Windows?
For me it fails hard right from the start. It reports a number of libs, which could not be found, even though they are present in .\vclibs dir. After specifying paths and filepaths here and there I still stumble upon missing dlls/libs and libraries (like fontconfig). Seems like cmake's CMakeLists.txt as well as vclibs need some love. Can someone help with that?
I understand VS is not officially supported, won't sync, etc
For me it fails hard right from the start. It reports a number of libs, which could not be found, even though they are present in .\vclibs dir. After specifying paths and filepaths here and there I still stumble upon missing dlls/libs and libraries (like fontconfig). Seems like cmake's CMakeLists.txt as well as vclibs need some love. Can someone help with that?
I understand VS is not officially supported, won't sync, etc
Re: spring & visual studio
first of all, from this page:
what errors do you get, did you follow the instructions from https://springrts.com/wiki/Building_Spr ... _.28v11.29 ?
so be warned: maybe its not possible to fix it in a way the changes can be merged back to "official spring".Currently Visual Studio lacks some c++ features it doesn't compile spring!
what errors do you get, did you follow the instructions from https://springrts.com/wiki/Building_Spr ... _.28v11.29 ?
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: spring & visual studio
If you're not completely set on VS, codeblocks will work easily with Spring and is a good IDE. You can just tell cmake that you want it to produce codeblocks project files.
Re: spring & visual studio
I must have expressed myself vaguely in the first post. The current issue is NOT the C++11 standard support or Visual Studio itself, but inability to put together Visual Studio solution file with cmake/cmake-gui. Firstly libs/includes are not getting auto-discovered automatically, even after manual intervention it's clear that vclibs is outdated: few .lib and .dll are missing, one library (fontconfig) is missing completely (as reported by cmake). My point was if someone more qualified could take a look into those issues and update relevant parts of cmake CMakeLists.txt (if I get it right, it should discover libs/includes/dlls automatically, but it doesn't) and renovate vclibs distribution.
Yes codeblocks itself is fine (except it 'makes' singlethreaded by default). The thing I'm dissatisfied with is debugger. I know it's probably very powerful, but I couldn't get even basic information from it when I was investigating https://springrts.com/mantis/view.php?id=4694Silentwings wrote:If you're not completely set on VS, codeblocks will work easily with Spring and is a good IDE. You can just tell cmake that you want it to produce codeblocks project files.
Re: spring & visual studio
if you provide the output of cmake, i/we maybe can help.ivand wrote:I must have expressed myself vaguely in the first post. The current issue is NOT the C++11 standard support or Visual Studio itself, but inability to put together Visual Studio solution file with cmake/cmake-gui. Firstly libs/includes are not getting auto-discovered automatically, even after manual intervention it's clear that vclibs is outdated: few .lib and .dll are missing, one library (fontconfig) is missing completely (as reported by cmake). My point was if someone more qualified could take a look into those issues and update relevant parts of cmake CMakeLists.txt (if I get it right, it should discover libs/includes/dlls automatically, but it doesn't) and renovate vclibs distribution.
its using gdb in the backend which is very powerful.ivand wrote:Yes codeblocks itself is fine (except it 'makes' singlethreaded by default). The thing I'm dissatisfied with is debugger. I know it's probably very powerful, but I couldn't get even basic information from it when I was investigating https://springrts.com/mantis/view.php?id=4694
Re: spring & visual studio
Here it's:if you provide the output of cmake, i/we maybe can help.
Code: Select all
g:\_programming\zero-k\spring_git>cmake -G "Visual Studio 11" .
-- The C compiler identification is MSVC 17.0.61030.0
-- The CXX compiler identification is MSVC 17.0.61030.0
-- Check for working C compiler using: Visual Studio 11 2012
-- Check for working C compiler using: Visual Studio 11 2012 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 11 2012
-- Check for working CXX compiler using: Visual Studio 11 2012 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:31 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning at CMakeLists.txt:52 (Message):
Using custom C_FLAGS: /DWINDOWS /D_CRT_SECURE_NO_WARNINGS /wd4244 /wd4018
/wd4800 /wd4305 /DWIN32 /D_WINDOWS /W3 this build will very likely not sync
in online mode!
CMake Warning at CMakeLists.txt:56 (Message):
Using custom CXX_FLAGS: /DWINDOWS /D_CRT_SECURE_NO_WARNINGS /wd4244 /wd4018
/wd4800 /wd4305 /DWIN32 /D_WINDOWS /W3 /EHa /GR this build will very likely
not sync in online mode!
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- thread
-- regex
-- program_options
-- system
-- chrono
-- signals
-- filesystem
-- Could NOT find Boost
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
-- Could NOT find DevIL (missing: IL_IL_HEADER IL_INCLUDE_DIR IL_IL_LIBRARY IL_
LIBRARIES)
-- Found win32 libraries: dbghelp;imagehlp;ws2_32;winmm;imm32;version
-- Building Spring for 32bit environment
CMake Warning at CMakeLists.txt:333 (Message):
You are using ld.bfd, it's much slower than ld.gold.
-- Compiling with C++11
CMake Warning at CMakeLists.txt:350 (message):
MSVC doesn't support THREADPOOL, disabled!
-- Found GIT: C:/Program Files (x86)/Git/cmd/git.exe
-- Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARIES) (Required is
at least version "1.5.1")
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindPackageH
andleStandardArgs.cmake:138 (message):
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindPackageHandleStandard
Args.cmake:374 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindZLIB.cmake:110 (FIND_
PACKAGE_HANDLE_STANDARD_ARGS)
rts/lib/minizip/CMakeLists.txt:20 (FIND_PACKAGE)
CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
GLEW_INCLUDE_DIR (ADVANCED)
used as include directory in directory G:/_programming/zero-k/spring_git/rts/
lib/lua
-- Configuring incomplete, errors occurred!
See also "G:/_programming/zero-k/spring_git/CMakeFiles/CMakeOutput.log".
See also "G:/_programming/zero-k/spring_git/CMakeFiles/CMakeError.log".
Re: spring & visual studio
To be honest, i think it would help people unfamiliar to linux a great lot more if there was a vm-image with ubunuts and a compiling spring source repo and a (script that does autoregistration and fork on github), packed with a windows compatible vm-ware player.
You could also compile it using eclipse cdt(which uses msys and mingw in the background)
The VM thingy definatly was my approach.
Also beherith went and did it, he managed to get visual studio up and running with this. Any questions fathered by this, drop at his doorstep... :)
You could also compile it using eclipse cdt(which uses msys and mingw in the background)
The VM thingy definatly was my approach.
Also beherith went and did it, he managed to get visual studio up and running with this. Any questions fathered by this, drop at his doorstep... :)
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: spring & visual studio
Behe didn't compile with VS, he used VS to search/edit code (and compile it by hand), but only before we both got CodeBlocks working. I guess the last time MSVC was used by anyone to compile Spring was a long time ago.
Re: spring & visual studio
So, you have a working codeblocks project for windows?
Interesting.. Link plz
Interesting.. Link plz
Re: spring & visual studio
Use cmake to generate a Code:blocks project file using mingw. For me it compiled last week without any hiccups.
Re: spring & visual studio
Same here. The only "issue" I encountered was inability to specify number of threads to be used during compilation. It's configured for 1 thread sequential build by default and it's painfully slow.Beherith wrote:Use cmake to generate a Code:blocks project file using mingw. For me it compiled last week without any hiccups.
I'm pretty sure VS should be able to chew up most if not all of the code, but I don't posses enough knowledge to fix Cmake's recipe file and update ./vclibs.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: spring & visual studio
In C:B you can just go to
and pass it -j8, for e.g. 8 thread compile with mingw.
Code: Select all
project -> build options -> compiler settings -> other options
-
- Posts: 823
- Joined: 21 Oct 2008, 02:54
Re: spring & visual studio
BTW use ninja if you can. It requires no modification at all to the cmake text file.
-
- Posts: 823
- Joined: 21 Oct 2008, 02:54
Re: spring & visual studio
The main issue (from judging the error output file) is the vclib need to be update. It used to be maintain by zerver, until he was kick off the spring dev team for violating the gpl license. If no ones going to maintain it currently, my advise would just remove it from cmake and focus on maintaining and improving mingw support.ivand wrote:Same here. The only "issue" I encountered was inability to specify number of threads to be used during compilation. It's configured for 1 thread sequential build by default and it's painfully slow.Beherith wrote:Use cmake to generate a Code:blocks project file using mingw. For me it compiled last week without any hiccups.
I'm pretty sure VS should be able to chew up most if not all of the code, but I don't posses enough knowledge to fix Cmake's recipe file and update ./vclibs.
Re: spring & visual studio
There are two big issues as it looks to me:Super Mario wrote: The main issue (from judging the error output file) is the vclib need to be update. It used to be maintain by zerver, until he was kick off the spring dev team for violating the gpl license. If no ones going to maintain it currently, my advise would just remove it from cmake and focus on maintaining and improving mingw support.
#1. Wrong recipe in CMakeLists.txt as it doesn't autodiscover there headers/libs/dlls are. Like I did myself, one can manually point each and every unresolved point and get to #2
#2. Missing or outdated libs/headers/dlls in the ./vclibs folder. Some of those, like boost, ogg/vorbis or SDL2 could be fixed relatively easy. The point I stopped trying was when I got to fontconfig lib and couldn't find MSVC build in the first page of google.
Re: spring & visual studio
Zerver was not kicked from the team for violating gpl
He was actually not kicked at all
It was just that his fork of spring MT-Sim was taken out of the main releases offered,
as it was unmaintainable for the other devs and the resulting politics and drama lead to the break-up.
You can be a great coder, but if your stuff is unreadable for others - you are going to play alone, and playing alone, makes you slower then the team, which will eat mamoth, while the lonely guy eats berries.
He was actually not kicked at all
It was just that his fork of spring MT-Sim was taken out of the main releases offered,
as it was unmaintainable for the other devs and the resulting politics and drama lead to the break-up.
You can be a great coder, but if your stuff is unreadable for others - you are going to play alone, and playing alone, makes you slower then the team, which will eat mamoth, while the lonely guy eats berries.
Re: spring & visual studio
Picasso did you manage to compile successfully?
-
- Posts: 823
- Joined: 21 Oct 2008, 02:54
Re: spring & visual studio
Oh yes, definitely on number two. Some of the libraries used don't have compiled lib in a convenient fashion for mingw64 either. One the webpages states that the solution file for the lib might be out of date, so I not to confident that they will compile with ease either.ivand wrote:There are two big issues as it looks to me:Super Mario wrote: The main issue (from judging the error output file) is the vclib need to be update. It used to be maintain by zerver, until he was kick off the spring dev team for violating the gpl license. If no ones going to maintain it currently, my advise would just remove it from cmake and focus on maintaining and improving mingw support.
#1. Wrong recipe in CMakeLists.txt as it doesn't autodiscover there headers/libs/dlls are. Like I did myself, one can manually point each and every unresolved point and get to #2
#2. Missing or outdated libs/headers/dlls in the ./vclibs folder. Some of those, like boost, ogg/vorbis or SDL2 could be fixed relatively easy. The point I stopped trying was when I got to fontconfig lib and couldn't find MSVC build in the first page of google.
Re: spring & visual studio
@ivand:
this question is unanswered:
to fix cmake imo vclibs must be updated. first of the folder structure has to be changed: all libs/includes has to be in a single directory like in mingwlibs and then the cmake code can be heavily cleaned up: a lot of code can be reused as detecting libs/headers is then the same as for mingwlibs.
this question is unanswered:
its pretty unclear what toolchain you are using to (try) to compile spring.did you follow the instructions from https://springrts.com/wiki/Building_Spr ... _.28v11.29 ?
to fix cmake imo vclibs must be updated. first of the folder structure has to be changed: all libs/includes has to be in a single directory like in mingwlibs and then the cmake code can be heavily cleaned up: a lot of code can be reused as detecting libs/headers is then the same as for mingwlibs.
Re: spring & visual studio
No, but thats on a vm- in linux.Beherith wrote:Picasso did you manage to compile successfully?
Havent really tried it under windows. Figured when you allready run in trouble abroad, you will be even more with boozeWind..
mmh.. oh wait, just realised that in source-tree i still have a repo..
Started cmake- errored out with
Code: Select all
CMake Error at CMakeLists.txt:118 (MESSAGE):
MINGWLIBS 'D:/SpringDev/Spring/mingwlibs' is not a valid directory