Errors for a vrpn client

About the GUI application to design signal processing pipelines
Post Reply
Sarah
Posts: 1
Joined: Tue Feb 07, 2012 3:28 pm

Errors for a vrpn client

Post by Sarah »

Hello everyone
I try to code a client vrpn for personal use and for that I am using this tutorial:

http://openvibe.inria.fr/vrpn-tutorial- ... nt+program

The fact is that I end up with errors like these:
[Linker error] undefined reference to `vrpn_Button_Remote :: vrpn_Button_Remote (char const *, vrpn_Connection *) '
[Linker error] undefined reference to `vrpn_Analog_Remote :: vrpn_Analog_Remote (char const *, vrpn_Connection *) '

I don't think it's a mistake due to library but rather a problem in the address attribute.
I use openvibe_vrpn_button@localhost and openvibe_vrpn_analog@localhost as I run for the moment OpenViBE on the same machine.

Does anyone have any advice for me?
Thank you.

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

Re: Errors for a vrpn client

Post by jlegeny »

Hello Sarah,

welcome to the forums!

the errors looks like it happens during the linking process (judging from the [Linker error] label. Did you properly link the vrpn libraries to your project? (i.e.: by adding the -lvrpn attribute to g++ linker or selecting the libvrpn.lib file in the Visual Studio project).

If the problem is not in the linkage, then could you please give more precisions about your code? (best would be a snippet which shows how exactly you have implemented vrpn bindings in your code)

Cheers
Jozef

karthiks
Posts: 78
Joined: Thu Sep 02, 2010 2:43 pm
Location: Université Libre de Bruxelles

Re: Errors for a vrpn client

Post by karthiks »

Hey Jozef,

I had the same problem. The thing is it works fine in VC++2010 but I have not been able to get it working with Eclipse.

My error output was:

g++ -LE:\Openvibe\dependencies\vrpn\lib -o VRPN _test.exe test.o -lE:\Openvibe\dependencies\vrpn\lib\vrpn.lib
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lE:\Openvibe\dependencies\vrpn\lib\vrpn.lib

Any ideas for that?

Sorry Sarah for hijacking your thread a bit. :oops:
Regards,

Karthik

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

Re: Errors for a vrpn client

Post by jlegeny »

Hello karthiks,

with gcc the -l parameter only takes the library name (unless it is different on windows). You have already specified the library folder with -L, therefore the -l parameter should look like -lvrpn istead of "-lE:\Openvibe\dependencies\vrpn\lib\vrpn.lib"

-J

karthiks
Posts: 78
Joined: Thu Sep 02, 2010 2:43 pm
Location: Université Libre de Bruxelles

Re: Errors for a vrpn client

Post by karthiks »

jlegeny wrote:Hello karthiks,

with gcc the -l parameter only takes the library name (unless it is different on windows). You have already specified the library folder with -L, therefore the -l parameter should look like -lvrpn istead of "-lE:\Openvibe\dependencies\vrpn\lib\vrpn.lib"

-J
Hey Jozef,

I understand. I usually get this -

Code: Select all

**** Build of configuration Debug for project VRPN _test ****

**** Internal Builder is used for build               ****
g++ -LE:\Openvibe\dependencies\vrpn\lib -o VRPN _test.exe test.o
test.o: In function `main':
E:\Projects\VRPN _test\Debug/../test.cpp:40: undefined reference to `vrpn_Button_Remote::vrpn_Button_Remote(char const*, vrpn_Connection*)'
E:\Projects\VRPN _test\Debug/../test.cpp:47: undefined reference to `vrpn_Analog_Remote::vrpn_Analog_Remote(char const*, vrpn_Connection*)'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 141  ms.  
I am using Eclipse on Windows 7 32 bit.
Regards,

Karthik

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

Re: Errors for a vrpn client

Post by jlegeny »

Hello
karthiks wrote:

Code: Select all

g++ -LE:\Openvibe\dependencies\vrpn\lib -o VRPN _test.exe test.o
test.o: In function `main':
In this line only the -L parameter is specified (which describes only where to find the libraries), you need to add the -l command as well (-lvrpn) which tells the linker to which libraries actually link.

-J

Post Reply