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.
Errors for a vrpn client
Re: Errors for a vrpn client
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
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
Re: Errors for a vrpn client
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.
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.
Regards,
Karthik
Karthik
Re: Errors for a vrpn client
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
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
Re: Errors for a vrpn client
Hey Jozef,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
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.
Regards,
Karthik
Karthik
Re: Errors for a vrpn client
Hello
-J
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.karthiks wrote:Code: Select all
g++ -LE:\Openvibe\dependencies\vrpn\lib -o VRPN _test.exe test.o test.o: In function `main':
-J