Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors linking executable vs libtrajopt_sco.so when building with Gurobi in Qt Creator #175

Open
schornakj opened this issue Mar 12, 2020 · 1 comment

Comments

@schornakj
Copy link
Contributor

My project builds and runs successfully when I call colcon build from the command line. However, when I build using the Qt Creator ROS plugin I run into issues linking my node against the Gurobi shared libraries:

Starting >>> my_package
--- stderr: my_package
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
/usr/bin/ld: warning: libgurobi90.so, needed by /home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so, not found (try using -rpath or -rpath-link)
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBsetdblattr'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBsetdblattrlist'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBsetdblattrarray'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBnewmodel'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBgetdblattrlist'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBwrite'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBgetintattr'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBsetintparam'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBdelq'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBfreemodel'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBdelconstrs'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBoptimize'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBaddqconstr'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBgetdblattr'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBaddconstr'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBaddvar'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBcomputeIIS'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBfeasrelax'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBgeterrormsg'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBaddqpterms'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBdelvars'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBloadenv'
/home/joe/workspaces/eloquent_ws/install/trajopt_sco/lib/libtrajopt_sco.so: undefined reference to `GRBupdatemodel'
collect2: error: ld returned 1 exit status
make[2]: *** [my_package_node] Error 1
make[1]: *** [CMakeFiles/my_package_node.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< my_package	[ Exited with code 2 ]

Other environment info:

  • Ubuntu 18.04.4
  • ROS Eloquent
  • Gurobi 9.0.1
  • Qt Creator 4.9.2

This might be a problem with how I'm using the trajopt_sco libraries in my_package, but the fact that it only appears in Qt Creator seems suspicious.

Does anyone have any insights?

@mpowelson
Copy link
Contributor

Do you need to add Gurobi to your LD path in QT Creator? If you added it to your bashrc file it would work on the command line, but you'd need to add it to your project build environment in QT Creator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants