Linker Error

12 views
Skip to first unread message

Blake Hament

unread,
May 26, 2019, 4:43:26 AM5/26/19
to WoodenHaptics users and developers
Hello Dr. Forsslund,

I am trying the MBED connection with a laptop, Ubuntu 18.04 LTS. I can build haptikfabrikenapi with just a warning about variable "thetas" unused. 

After doing so, I have haptikfabrikenapi.h in /usr/local/include/, but in /usr/local/lib, I have an executable instead of a .so library. I think maybe this is causing the chai3d build to fail.

Next I cloned chai3d from your GitHub repo:

cd chai3d-master

mkdir build

cd build

cmake -DCMAKE_BUILD_TYPE=DEBUG ..

make -- build .


The build errors out with "/usr/bin/ld: cannot find -lhaptikfabrikenapi". I have tried to point the linker to the correct path with "export LDFLAGS=-L/usr/local/lib/haptikfabrikenapi", but no luck. I have been trying other edits to cmakelists.txt and the makefiles, but maybe the issue is that I have haptikfabrikenapi executable file instead of haptikfabrikenapi.so in /usr/local/lib?

Any suggestions?

Thank you,
Blake

Jonas Forsslund

unread,
May 26, 2019, 5:01:49 AM5/26/19
to WoodenHaptics users and developers
Hi,

Please look in the .pro file, if you have uncomment the first two you will get the app. Like the following you will get the lib:
#TEMPLATE = app # For debug (uncomment src/main.cpp as well)
#SOURCES += src/main.cpp
TEMPLATE = lib
CONFIG += dynamiclib

to make and install do:
qmake
make -j5                     (j5 just speeds up compilation)
sudo make install 
sudo ldconfig             (sometimes needed to update list of installed libs)

Another note:
Most often it only works to combine debug libs and release libs, so try making both haptikfabrikenapi and chai in release mode (which is the default).

For chai (our version)
cd chai3d
cmake .
make -j5
cd bin/.... for executables

By the way: for other mailinglist memebers: the haptikfabrikenapi is in private beta right now, soon to be released, e-mail me if you want to try it.

Jonas

--
You received this message because you are subscribed to the Google Groups "WoodenHaptics users and developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to woodenhaptic...@googlegroups.com.
To post to this group, send email to wooden...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/woodenhaptics/a4e10201-93c6-4f0c-80b7-d1a0b1c80006%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Blake Hament

unread,
Jun 5, 2019, 7:17:40 AM6/5/19
to WoodenHaptics users and developers
Of course! Thank you, that was exactly my problem. After changing the .pro file back to the original, the libraries were created as expected.

I am now reading encoder values through the DAQ. I still have some issue with the MBED, but will revisit once I complete calibration and become more familiar with the software with DAQ.

For others working on this project:

I needed a few dependencies not mentioned in documentation to get the software working on a fresh install of Ubuntu 18.04 LTS

To execute all of dependencies.sh script in haptikfabrikenapi I needed: sudo apt-get install libelf-dev

To compile all of chai3d I needed a few: sudo apt-get install xorg-dev freeglut3-dev libusb-1.0-0-dev libasound2-dev
To unsubscribe from this group and stop receiving emails from it, send an email to wooden...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages