Page 1 of 1
MS VC++ Build
Posted: 13 May 2010, 16:35
Hi all - I recently did the folowing:
- Downloaded the BCI2000 Ver 3.0 sources
- Installed cmake
- Installed Visual Studio 9 (2008)
I subsequently invoked "Make VS2008 Project Files.bat" to generate the VC projects. Thereafter, I loaded ZERO_CHECK.vcproj and attempted to build. However, I am getting an enormous amount of link errors - unresolved external symbol. Following is an example:
>SockStream.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function "protected: __thiscall streamsock::streamsock(void)" (??0streamsock@@IAE@XZ)
>SockStream.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function "public: virtual __thiscall streamsock::~streamsock(void)" (??1streamsock@@UAE@XZ)
Any ideas as to what I may not have done/done wrong?
Posted: 13 May 2010, 16:50
I'm not at my computer right now, but you might want to try loading the bci2000.sln rather than the zero__check.vcproj.
Ill be back later if that doesn't help.
Posted: 13 May 2010, 17:11
Thanks Griff - I tried what you said to do - same problems. First 2 unresolved symbols follows:
3>SockStream.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function "protected: __thiscall streamsock::streamsock(void)" (??0streamsock@@IAE@XZ)
3>SockStream.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function "public: virtual __thiscall streamsock::~streamsock(void)" (??1streamsock@@UAE@XZ)
Posted: 14 May 2010, 11:06
The errors you present have to do with Winsock, a low-level socket implementation presented by Microsoft (WSA gives that away).
Normally Visual Studio should be able to locate these files automatically and add them to the path. Search your computer for a file called ws2_32.lib and see whether or not it's path is included in the standard VS settings (In the main screen of VS: Tools -> Options -> Projects and Solutions -> VC++ directories).
It basically looks like the standard paths are either incorrect (installed in the wrong place) or the standard windows includes are not present at all.
If the files for WinSock are present and you can fix the errors with WSA, other paths might also need fixing, so find out which libs your missing and make sure VS can find them.
In case you don't want all kinds of libraries and directories to be searched for all your projects, you could also try to modify the paths in the Project Properties (right click project -> properties -> Configuration Properties -> Linker -> (Additional Library Directories) and (... -> Linker -> Input -> Additional Dependencies)).
If you can't find the files for WinSock on your computer you probably need to install some extra packages for VS (reinstall VS or download new packages/frameworks). If you installed the express edition of VS2008, it could be that you're missing the platform SDK (platform as in Windows). That should be available for free from Microsoft.
Hope this gets you going!
Posted: 14 May 2010, 13:21
I can reproduce the linker errors on a clean Windows installation but not on the one I'm normally using. It appears that the MSVC projects correctly list the Winsock and other dependencies on one system but not on the other. Unfortunately, I could not find the cause of this behavior but will go on researching and keep you updated.
Thanks for reporting the problem,
Posted: 17 May 2010, 08:41
There was a change between CMake 2.8.0 and 2.8.1 that broke the way how BCI2000 used the Qt distribution inside its source tree.
I committed a fix in r2812
--updating to the latest BCI2000 version, and re-running the "Make VS2008 Project Files" batch files from the build directory should now result in working MSVC project files.
Posted: 29 Jul 2010, 04:40
i got the same problem, i'm using BCI2000 v2.0 and Microsoft Visual Studio C++ express.
i fixed the problem just by adding the ws2_32.lib to my input in
project-> properties -> linker -> input -> additional dependencies
everythink works fine.,