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

Unable to link after update to 2.24 #4351

Closed
kevindehecker opened this issue Jul 2, 2019 · 10 comments
Closed

Unable to link after update to 2.24 #4351

kevindehecker opened this issue Jul 2, 2019 · 10 comments
Assignees

Comments

@kevindehecker
Copy link
Contributor


Required Info
Camera Model D400
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version Ubuntu 18.04
Kernel Version (Linux Only) (e.g. 4.15.0.54)
Platform PC
SDK Version 2.24
Language C }

Issue Description

After Ubuntu automatically updated librealsense to 2.24, (and rebooting!), I'm unable to link with librealsense.

/usr/bin/ld: cannot find -lrealsense2
collect2: error: ld returned 1 exit status
CMakeFiles/lalala.dir/build.make:503: recipe for target 'lalala' failed
make[2]: *** [lalala] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/lalala.dir/all' failed
make[1]: *** [CMakeFiles/lalala.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Before the update to 2.24 all was fine. Even after updating I could compile, but I tried to reboot because of #4350, after which the problem appeared. Have reproduced this problem on two computers.

@kevindehecker
Copy link
Contributor Author

I've reverted the packages back to v2.23, this solves the problem for now:

#sudo apt-cache policy  librealsense2 #pick v2.23
sudo apt remove librealsense2*
sudo apt-get install librealsense2=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dev=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dbg=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-gl*=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-udev*=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-utils=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dkms

yechun1 added a commit to yechun1/robot_devkit that referenced this issue Jul 3, 2019
Install 2.23.0 version, the latest 2.24.0 version by apt-get has issue (IntelRealSense/librealsense#4351)
@ev-mp
Copy link
Collaborator

ev-mp commented Jul 4, 2019

@kevindehecker hello,
There were a missing dependency in the Debian build that has been resolved. Please try the latest and update

@ev-mp ev-mp self-assigned this Jul 4, 2019
yechun1 added a commit to intel/robot_devkit that referenced this issue Jul 4, 2019
* update gitignore

* optimize opencv dependence setup

- pre-download ippicv and model to fix "Download failed: 28; Timeout was reached"
- add DCMAKE_BUILD_TYPE=Release for release build
- set clone depth as 1 to avoid cloning uncessary branch

* fix deps install disorder issue

find command will not sort the result, added sort for deps setup in-order.
don't now why "while IFS= read -r -d" will miss input line, replace the function and use dep_list for implementation

* create common package for ros2 deps

create common foder in package for ros2 deps, because ros2 are dependent by all other packages, this is common part that should be installed.
moved 10-ros2.deps from perception and turtlebot3 to common

* remove turtlebot lidar package to follow upstream changes

upstream package had removed lidar package from the turtlebot package, this make our build error, so we also removed it.
we have not yet verified lidar function after tb3 package removed lidar, will update the script once we get the solution.

* add libssl1.1 install to avoid upgrade configure

while install pyqt5-dev, it dependence libssl1.1 and will upgrade libssl1.1 if previous not upgraded.
this upgrade will popup configure window to manually confim YES|NO, to avoid this confirmation, install libssl at the begining.

* lower-case Turtlebot3 to keep same style

* install librealsense 2.23.0 version

Install 2.23.0 version, the latest 2.24.0 version by apt-get has issue (IntelRealSense/librealsense#4351)

* Revert "install librealsense 2.23.0 version"

This reverts commit 8de0a61.

* skip common when get package

common is always required and needn't configure, skip here

* workaround for libssl unattached installation

unattached install libssl to avoid manual configuration windows pop-up
@kevindehecker
Copy link
Contributor Author

Yes seems to work again, thanks!

@kevindehecker
Copy link
Contributor Author

Crap, it is not working!

I tumbled into the reboot trap... After a reboot (needed for something else) I could not link once more.
BTW, the reported version after updating is still 2.24.

@kevindehecker kevindehecker reopened this Jul 4, 2019
@ev-mp
Copy link
Collaborator

ev-mp commented Jul 4, 2019

That's correct - the change is in the Debian build (number) - there is no change in Librealsense.
The only thing that changes after reboot is the the source ... and the linker list are being updated.
Is it possible that you have several versions installed in separate locations ?
Can you share the error log ?

@kevindehecker
Copy link
Contributor Author

Error log? You mean the linker error?

/usr/bin/ld: cannot find -lrealsense2
collect2: error: ld returned 1 exit status
CMakeFiles/lalala.dir/build.make:503: recipe for target 'lalala' failed
make[2]: *** [lalala] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/lalala.dir/all' failed
make[1]: *** [CMakeFiles/lalala.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Really not that helpfull, but I don't have other errors... Please specify.

@kevindehecker
Copy link
Contributor Author

Aha, found the problem. In my CMakeList.txt I set the realsense library as follows:

set(REALSENSE realsense2) 
target_link_libraries(${PROJECT_NAME} ${REALSENSE})

Probably got that from some example in the early days. However, if I properly find the realsense package, the linker problem is solved!

find_package(realsense2 REQUIRED)
target_link_libraries(${PROJECT_NAME} ${realsense2_LIBRARY})

yechun1 added a commit to yechun1/robot_devkit that referenced this issue Jul 9, 2019
Install 2.23.0 version, the latest 2.24.0 version by apt-get has issue (IntelRealSense/librealsense#4351)
@danneboom
Copy link

Same problem here after 2.24 (2.24.0-0~realsense0.1243) update. Before, in QT I could link with

 LIBS += -lrealsense2

Now, it says

/usr/bin/ld: cannot find -lrealsense2

and also LIBS += -L/usr/lib/x86_64-linux-gnu -lrealsense2 or LIBS+=/usr/lib/x86_64-linux-gnu/librealsense2.so does NOT work. Using pkg-config like

CONFIG+=link_pkgconfig
PKGCONFIG+=realsense2

does not change anything. In CMake though, before 2.24 I was doing

    find_library( REALSENSE_LIBRARY NAMES realsense2 PATHS /usr/local/lib)
    target_link_libraries(myLib ${REALSENSE_LIBRARY} )

That does not work anymore, even with new path /usr/lib//usr/lib/x86_64-linux-gnu! I have to use find_package now.

    find_package( realsense2 REQUIRED)
    include_directories(  ${realsense2_INCLUDE_DIR} )
    target_link_libraries(myLib ${realsense2_LIBRARY} )

But in QT it still fails.

yechun1 added a commit to intel/robot_devkit that referenced this issue Jul 19, 2019
* version:20190627 (#13)

- update ros2_realsense
 - update ros2_openvino_toolkit
 - update ros2_navigation2
 - update turtlebot3
 - update get_commit_id scripts

* update ros2_openvino_toolkit (#14)

* Optimize deps and bug fixing (#16)

* update gitignore

* optimize opencv dependence setup

- pre-download ippicv and model to fix "Download failed: 28; Timeout was reached"
- add DCMAKE_BUILD_TYPE=Release for release build
- set clone depth as 1 to avoid cloning uncessary branch

* fix deps install disorder issue

find command will not sort the result, added sort for deps setup in-order.
don't now why "while IFS= read -r -d" will miss input line, replace the function and use dep_list for implementation

* create common package for ros2 deps

create common foder in package for ros2 deps, because ros2 are dependent by all other packages, this is common part that should be installed.
moved 10-ros2.deps from perception and turtlebot3 to common

* remove turtlebot lidar package to follow upstream changes

upstream package had removed lidar package from the turtlebot package, this make our build error, so we also removed it.
we have not yet verified lidar function after tb3 package removed lidar, will update the script once we get the solution.

* add libssl1.1 install to avoid upgrade configure

while install pyqt5-dev, it dependence libssl1.1 and will upgrade libssl1.1 if previous not upgraded.
this upgrade will popup configure window to manually confim YES|NO, to avoid this confirmation, install libssl at the begining.

* lower-case Turtlebot3 to keep same style

* install librealsense 2.23.0 version

Install 2.23.0 version, the latest 2.24.0 version by apt-get has issue (IntelRealSense/librealsense#4351)

* Revert "install librealsense 2.23.0 version"

This reverts commit 8de0a61.

* skip common when get package

common is always required and needn't configure, skip here

* workaround for libssl unattached installation

unattached install libssl to avoid manual configuration windows pop-up

* version:20190704 (#17)

- update turtlebot3
- update navigation2
- update cartographer_ros

* optimize deps installation (#21)

- optimize script and clean redundant code
- add reference url

* update readme.md to rename sdk to rdk

* version:20190711 (#22)

* version:20190711

    - update ros2 to release-dashing-20190614
    - update ros2_intel_realsense to 2c28f9e3801161a853672d33981e857da9985306
    - update ros2_openvino_toolkit to 3704c9341b0ce6d3da83557732bbb21b58498d86
    - update gazebo9 to gazebo*
    - gazebo_ros_pkgs to 120097242c8da6ef4eddbb1932eacfdbd10b7b03

* fix openvino labels copy path error

* new tutorial (#23)

* improve logger for rdk scripts (#24)

- add timestamp and filename and codeline in logger
- make function logger more readability

* update docs (#26)

* version:20190718 (#27)

* Add the tun demo script for ros2_object_analytics

* version:20190718

* update docs (#28)

* Update object_analytics to devel-e13d828a8ce3b615e0f7e8c9eee6b3526c205a65 (#29)

* update docs (#30)
@qihao-huang
Copy link

qihao-huang commented Jul 22, 2019

I've reverted the packages back to v2.23, this solves the problem for now:

#sudo apt-cache policy  librealsense2 #pick v2.23
sudo apt remove librealsense2*
sudo apt-get install librealsense2=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dev=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dbg=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-gl*=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-udev*=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-utils=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dkms

When I try to apt-cache show <package-name>, realsense viersion I find is 2.23.0-0~realsense0.1166=5

Can you test it ?
Thanks.

@qihao-huang
Copy link

I've reverted the packages back to v2.23, this solves the problem for now:

#sudo apt-cache policy  librealsense2 #pick v2.23
sudo apt remove librealsense2*
sudo apt-get install librealsense2=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dev=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dbg=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-gl*=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-udev*=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-utils=2.23.0-0~realsense0.1166
sudo apt-get install librealsense2-dkms

When I try to apt-cache show <package-name>, realsense viersion I find is 2.23.0-0~realsense0.1166=5

Can you test it ?
Thanks.

add ${realsense2_LIBRARY} to target_link_libraries() solve this bug.

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

No branches or pull requests

4 participants