Building BCI2000 3.0 in MSVC 2005
Posted: 19 Feb 2010, 12:32
After some difficulties Joerg Fisher and me managed to build BCI2000 v3.0 release version in Visual Studio 2005. Since there were several persons looking for advices how to do this, we wanted to share our experiences.
To build you have to:
1. Download the source code and create a visual studio 2005 solution using cmake. To do this run
in the ..\build directory using the command prompt or make a .bat script similar to ones provided with the source files in the build directory. This step is well described in http://www.bci2000.org/wiki/index.php/P ... ild_System and http://www.bci2000.org/wiki/index.php/T ... ild_System. Be aware that you don't need to build the Qt any more to build the BCI2000 since Qt libraries are provided with the source code.
2. Open the solution in Visual Studio 2005
3. There is a compiler error that is present if you try to compile for the older versions of windows errors in the file KeyLogger.cpp regarding macros MSLLHOOKSTRUCT, KBDLLHOOKSTRUCT, WH_KEYBOARD_LL, WH_MOUSE_LL, etc. Add _WIN32_WINNT=0x0500 to the preprocessor deffinitions as described here:
http://www.yelsew.com/c2065_wh_keyboard_ll.html
You have to add this deffinition for every project in the solution (or at least the ones that produce errors).
4. There is also a compiler error complaining about the CompareByZOrder operator deffinition in GraphObject.h. On http://www.microsoft.com/communities/ne ... &sloc=&p=1 we read that this error is not present in the debug version. We used the advice from http://www.eggheadcafe.com/aspnet_answe ... 299561.asp to make the operator constant changing the CompareByZOrder definition from:
to:
4. Build the solution.
Hopefully this will work for you as well as it worked for us.
We weren't able to build the debug version sine there were some problems with the Qt debug libraries. I will let you know as soon as this problem is solved.
To build you have to:
1. Download the source code and create a visual studio 2005 solution using cmake. To do this run
Code: Select all
cmake -G"Visual Studio 8 2005"2. Open the solution in Visual Studio 2005
3. There is a compiler error that is present if you try to compile for the older versions of windows errors in the file KeyLogger.cpp regarding macros MSLLHOOKSTRUCT, KBDLLHOOKSTRUCT, WH_KEYBOARD_LL, WH_MOUSE_LL, etc. Add _WIN32_WINNT=0x0500 to the preprocessor deffinitions as described here:
http://www.yelsew.com/c2065_wh_keyboard_ll.html
You have to add this deffinition for every project in the solution (or at least the ones that produce errors).
4. There is also a compiler error complaining about the CompareByZOrder operator deffinition in GraphObject.h. On http://www.microsoft.com/communities/ne ... &sloc=&p=1 we read that this error is not present in the debug version. We used the advice from http://www.eggheadcafe.com/aspnet_answe ... 299561.asp to make the operator constant changing the CompareByZOrder definition from:
Code: Select all
struct CompareByZOrder
{ bool operator()( const GraphObject* s1, const GraphObject* s2 )
{ return ( s1->mZOrder == s2->mZOrder ) ? s1 > s2 : s1->mZOrder > s2->mZOrder; }
};Code: Select all
struct CompareByZOrder
{ bool operator()( const GraphObject* s1, const GraphObject* s2 ) const
{ return ( s1->mZOrder == s2->mZOrder ) ? s1 > s2 : s1->mZOrder > s2->mZOrder; }
};Hopefully this will work for you as well as it worked for us.
We weren't able to build the debug version sine there were some problems with the Qt debug libraries. I will let you know as soon as this problem is solved.