VRPN serveur compilation with Visual Studio 2010

Working with OpenViBE signal processing scenarios and doing scenario/BCI design
Post Reply
OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

Hi,

I'm going to use the Emotiv EPOC with OpenViBE so I have to make it on Windows.
I couldn't compile the sample project with Visual Studio.
The GenericVRPNServer.cpp file makes several includes for unknown files :

Code: Select all

#include <vrpn_Connection.h>
#include <vrpn_Button.h>
#include <vrpn_Analog.h>
I looked for these files in the source tarball and the openvibe directory, but couldn't find anything like this.

Could you tell me what I need to do ?

Thank you very much for your time :-)

PS : Sorry if the question has already been asked, but the research function doesnt work on this forum. Every word is considered "too common" to make a real query.

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

Answering to my own question:

VRPN is an external library that can be found here : http://www.cs.unc.edu/Research/vrpn/

Hope it helps anyone

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by lbonnet »

Hi OoDeLally,

VRPN should be installed by the dependency installer before the compilation (win32-install_dependencies.exe on windows, linux-install_dependencies on Linux).
It's strange... On which OS platform are you working on ?
PS : Sorry if the question has already been asked, but the research function doesnt work on this forum. Every word is considered "too common" to make a real query.
Indeed... I cleaned and rebuilt the search index, now it should work with any research term :)

Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

I am running on Windows 7 pro 64bits.

I installed OpenViBE via the windows installer executable. It seems that it doesnt install that kind of dependencies.
I'm running the win32-install_dependencies.exe right now, I tell you if any problem occurs.

Thank you for your quick answer :)

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

Hi again,

It seems that all dependencies have been installed, but I couldnt find where the vrpn files are located on my computer.

I tried to use the libraries that are in openvibe-0.14.2-svn3326-src/dependencies/vrpn/(lib|include) but the compilation on Visual Studio 2010 ultimate fails with the following errors :

(it is a French edition, but I assume you are French, so that shouldnt bother you :wink: )

Code: Select all

Erreur	1	error LNK2019: symbole externe non résolu "class vrpn_Connection * __cdecl vrpn_create_server_connection(char const *,char const *,char const *)" (?vrpn_create_server_connection@@YAPAVvrpn_Connection@@PBD00@Z) référencé dans la fonction "class vrpn_Connection * __cdecl vrpn_create_server_connection(int,char const *,char const *,char const *)" (?vrpn_create_server_connection@@YAPAVvrpn_Connection@@HPBD00@Z)	c:\Users\oodelally\documents\visual studio 2010\Projects\openvibe_test\openvibe_test\GenericVRPNServer.obj

Erreur	2	error LNK2019: symbole externe non résolu "public: __thiscall vrpn_Button_Server::vrpn_Button_Server(char const *,class vrpn_Connection *,int)" (??0vrpn_Button_Server@@QAE@PBDPAVvrpn_Connection@@H@Z) référencé dans la fonction "public: void __thiscall GenericVRPNServer::addButton(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int)" (?addButton@GenericVRPNServer@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)	c:\Users\oodelally\documents\visual studio 2010\Projects\openvibe_test\openvibe_test\GenericVRPNServer.obj

Erreur	3	error LNK2019: symbole externe non résolu "public: int __thiscall vrpn_Button_Server::set_button(int,int)" (?set_button@vrpn_Button_Server@@QAEHHH@Z) référencé dans la fonction "public: void __thiscall GenericVRPNServer::changeButtonState(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,int)" (?changeButtonState@GenericVRPNServer@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HH@Z)	c:\Users\oodelally\documents\visual studio 2010\Projects\openvibe_test\openvibe_test\GenericVRPNServer.obj

Erreur	4	error LNK2019: symbole externe non résolu "public: __thiscall vrpn_Analog_Server::vrpn_Analog_Server(char const *,class vrpn_Connection *,int)" (??0vrpn_Analog_Server@@QAE@PBDPAVvrpn_Connection@@H@Z) référencé dans la fonction "public: void __thiscall GenericVRPNServer::addAnalog(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int)" (?addAnalog@GenericVRPNServer@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)	c:\Users\oodelally\documents\visual studio 2010\Projects\openvibe_test\openvibe_test\GenericVRPNServer.obj
So I think the header file are fine, but the linker couldnt find the right implementation of the functions.

I added openvibe-0.14.2-svn3326-src\dependencies\vrpn\lib in the libpath directories, and openvibe-0.14.2-svn3326-src\dependencies\vrpn\include in the additionnal include directories


Have I made any mistake somewhere ?

Thank you :)

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: VRPN serveur compilation with Visual Studio 2010

Post by jlegeny »

Hello,

if you are using the GenericVRPNServer you will have to link your application with the vrpn library as well. In Visual Studio, you right click on your project then go to Properties, there you will have to set the appropriate library and include paths as well as the libraries to link with (vrpn.a in this case).

I have updated the tutorial with linux and windows specific examples.

Cheers
Jozef

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

I thought .a libraries were for Unix and .lib were for Windows :roll:

I wasn't able to locate the vrpn.a you are speaking about, where can I find it ?

Also, there is no directory in "OPENVIBE/scripts/software/include". Does it appear if I compile with the linux script ?

Thank you

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: VRPN serveur compilation with Visual Studio 2010

Post by jlegeny »

Oh! Of course I mean the .lib library, that was a mistake on my part, sorry.

Like described in the tutorial the scripts/software directory is only created on Linux, for windows dependencies are in the dependencies directory.

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

Hi,

I linked openvibe-0.14.2-svn3326-src/dependencies/vrpn/(lib|include) on my VS project, and I still get the compilation errors (see 4 posts above).

Do these errors ring a bell ?

Thank you :)

jlegeny
Posts: 239
Joined: Tue Nov 02, 2010 8:51 am
Location: Mensia Technologies Paris FR
Contact:

Re: VRPN serveur compilation with Visual Studio 2010

Post by jlegeny »

Hello,

The vrpn.lib library is compiled for 32bit architectures (OpenViBE is set to compile in 32bit mode). It might be that VS2010 sets projects to compile in 64bit mode by default since you are on a 64bit windows.

Cheers
Jozef

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

Hi,

The VS project is set on Win32 project. I can switch on x64 but the default is x32.

Any other idea ?

Thank you

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by lbonnet »

Hi,
If we want to solve this problem, we will need more (and precise) information...
I just downloaded the VRPN server sample program given in the tutorial.

First step : do you have a complete openvibe up and running, built from the sources you downloaded ?

Secondly,
I created a new VS 2010 empty project.
Added the 3 files in the project (win32-vrpn_main.cpp; GenericVRPNServer.h; GenericVRPNServer.cpp).

Then setup the vrpn dependency:
> Right-click on the project
> VC++ directories > library directories > added [openvibe-src]\dependencies\vrpn\lib
> C/C++ > other include directories > added [openvibe-src]\dependencies\vrpn\include
> Linker > Input > Additional dependencies > added vrpn.lib

Compile and run : everything is ok.
I can get the result with a simple scenario in the Designer : one VRPN Analog client (adress : analog_test@localhost:5055, as specified in the code) connected to a signal display.
The sin and cos signal are displayed if the server is running in background.

Hope this helps.
Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

OoDeLally
Posts: 9
Joined: Tue Jun 26, 2012 2:26 pm

Re: VRPN serveur compilation with Visual Studio 2010

Post by OoDeLally »

My mistakes were :

Had not set: VC++ directories > library directories > added [openvibe-src]\dependencies\vrpn\lib
Had not set: Linker > Input > Additional dependencies > added vrpn.lib

Had set: Linker > Additional Library Directories > added [openvibe-src]\dependencies\vrpn\lib (btw, what it this option for ?)

It works great now ! :D

Thank you for your efforts :)

Cheers !

Post Reply