MS VC++ Build

Forum for software developers to discuss BCI2000 software development
Locked
dseebran
Posts: 2
Joined: 12 May 2010, 10:02

MS VC++ Build

Post by dseebran » 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?

griffin.milsap
Posts: 58
Joined: 08 Jun 2009, 12:42

Post by griffin.milsap » 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.

-Griff

dseebran
Posts: 2
Joined: 12 May 2010, 10:02

Post by dseebran » 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)
3>

timo.veldt
Posts: 23
Joined: 12 Feb 2010, 04:08

Post by timo.veldt » 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!

mellinger
Posts: 1208
Joined: 12 Feb 2003, 11:06

Post by mellinger » 14 May 2010, 13:21

@dseebran:
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,
Juergen

mellinger
Posts: 1208
Joined: 12 Feb 2003, 11:06

Post by mellinger » 17 May 2010, 08:41

@dseebran:
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.

Thanks again,
Juergen

OKI
Posts: 18
Joined: 23 Jul 2010, 05:53

Post by OKI » 29 Jul 2010, 04:40

Hello,

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.,
thanks

Greets

Locked

Who is online

Users browsing this forum: No registered users and 3 guests