VRPN: Undefined references and linking issue
Posted: Wed Oct 16, 2019 2:26 am
Following the tutorial at http://openvibe.inria.fr/vrpn-tutorial- ... plication/
It says to place the C++ file in "dependencies/vrpn/include", however inside my /dependencies folder I only have the following folders:
- arch
- gtest-build
- include
- lib
- libgtest
- test-input
I decided to put the file in /dependencies/arch/vrpn/ because there are other vrpn .c and .h files in there.
I compile file with the following command:
$ g++ -L/usr/local/openvibe-2.2.0-src/dependencies/lib -lvrpn -lvrpnserver VRPNtest.cpp -o vrpntest
This returns the following errors:
/tmp/cccYOzJT.o: In function `main':
VRPNtest.cpp:(.text+0x12f): undefined reference to `vrpn_Button_Remote::vrpn_Button_Remote(char const*, vrpn_Connection*)'
VRPNtest.cpp:(.text+0x172): undefined reference to `vrpn_Analog_Remote::vrpn_Analog_Remote(char const*, vrpn_Connection*)'
collect2: error: ld returned 1 exit status
I see other that have had this issue before and it is always a linking issue, however I feel like I am linking the libvrpn.a and libvrpnserver.a correctly.
I think my problem resides in the fact that I never had a dependencies/vrpn/ directory to begin with.
Has anyone else experienced this issue?
It says to place the C++ file in "dependencies/vrpn/include", however inside my /dependencies folder I only have the following folders:
- arch
- gtest-build
- include
- lib
- libgtest
- test-input
I decided to put the file in /dependencies/arch/vrpn/ because there are other vrpn .c and .h files in there.
I compile file with the following command:
$ g++ -L/usr/local/openvibe-2.2.0-src/dependencies/lib -lvrpn -lvrpnserver VRPNtest.cpp -o vrpntest
This returns the following errors:
/tmp/cccYOzJT.o: In function `main':
VRPNtest.cpp:(.text+0x12f): undefined reference to `vrpn_Button_Remote::vrpn_Button_Remote(char const*, vrpn_Connection*)'
VRPNtest.cpp:(.text+0x172): undefined reference to `vrpn_Analog_Remote::vrpn_Analog_Remote(char const*, vrpn_Connection*)'
collect2: error: ld returned 1 exit status
I see other that have had this issue before and it is always a linking issue, however I feel like I am linking the libvrpn.a and libvrpnserver.a correctly.
I think my problem resides in the fact that I never had a dependencies/vrpn/ directory to begin with.
Has anyone else experienced this issue?