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

collect2: error: ld returned 1 exit status visualization/tools/CMakeFiles/pcl_viewer.dir/build.make:297: recipe for target 'bin/pcl_viewer' failed make[2]: *** [bin/pcl_viewer] Error 1 CMakeFiles/Makefile2:1367: recipe for target 'visualization/tools/CMakeFiles/pcl_viewer.dir/all' failed make[1]: *** [visualization/tools/CMakeFiles/pcl_viewer.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2 #6171

Open
kingyongyongzz opened this issue Nov 17, 2024 · 6 comments
Labels
kind: compile error Type of issue status: triage Labels incomplete

Comments

@kingyongyongzz
Copy link

Scanning dependencies of target pcl_viewer
[ 36%] Building CXX object visualization/tools/CMakeFiles/pcl_viewer.dir/pcd_viewer.cpp.o
[ 37%] Linking CXX executable ../../bin/pcl_viewer
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libSM.so:对‘uuid_generate@UUID_1.0’未定义的引用
/home/wzy/anaconda3/lib/libfontconfig.so.1:对‘FT_Done_MM_Var’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libSM.so:对‘uuid_unparse_lower@UUID_1.0’未定义的引用
collect2: error: ld returned 1 exit status
visualization/tools/CMakeFiles/pcl_viewer.dir/build.make:297: recipe for target 'bin/pcl_viewer' failed
make[2]: *** [bin/pcl_viewer] Error 1
CMakeFiles/Makefile2:1367: recipe for target 'visualization/tools/CMakeFiles/pcl_viewer.dir/all' failed
make[1]: *** [visualization/tools/CMakeFiles/pcl_viewer.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

Please help!

@kingyongyongzz kingyongyongzz added kind: compile error Type of issue status: triage Labels incomplete labels Nov 17, 2024
@kingyongyongzz kingyongyongzz changed the title [compile error] "Please add a short description here" collect2: error: ld returned 1 exit status visualization/tools/CMakeFiles/pcl_viewer.dir/build.make:297: recipe for target 'bin/pcl_viewer' failed make[2]: *** [bin/pcl_viewer] Error 1 CMakeFiles/Makefile2:1367: recipe for target 'visualization/tools/CMakeFiles/pcl_viewer.dir/all' failed make[1]: *** [visualization/tools/CMakeFiles/pcl_viewer.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2 Nov 17, 2024
@kingyongyongzz
Copy link
Author

Ubuntu18.04+vtk8.2.0+pcl1.9.1

@mvieth
Copy link
Member

mvieth commented Nov 17, 2024

@kingyongyongzz Seems to be a similar problem as in #5888 and #3548 Please see there for further information and possible solutions

@kingyongyongzz
Copy link
Author

kingyongyongzz commented Nov 18, 2024

I tried the solution you mentioned as in #5888 and #3548 but it don't work.
I followed steps:
cd pcl-pcl-1.9.1
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_GPU=ON-DBUILD_apps=ON -DBUILD_examples=ON \ -DCMAKE_INSTALL_PREFIX=/usr ..(I also tried :cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_GPU=ON-DBUILD_apps=ON -DBUILD_examples=ON \ -DCMAKE_INSTALL_PREFIX=/usr ..)
sudo make -j4

/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libSM.so:对‘uuid_generate@UUID_1.0’未定义的引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libSM.so:对‘uuid_unparse_lower@UUID_1.0’未定义的引用
collect2: error: ld returned 1 exit status
tools/CMakeFiles/pcl_tiff2pcd.dir/build.make:295: recipe for target 'bin/pcl_tiff2pcd' failed
make[2]: *** [bin/pcl_tiff2pcd] Error 1
CMakeFiles/Makefile2:7448: recipe for target 'tools/CMakeFiles/pcl_tiff2pcd.dir/all' failed
make[1]: *** [tools/CMakeFiles/pcl_tiff2pcd.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 46%] Linking CXX executable ../bin/pcl_generate
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
[ 46%] Built target pcl_generate
[ 46%] Linking CXX executable ../bin/pcl_obj2vtk
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
[ 46%] Built target pcl_obj2vtk
[ 46%] Linking CXX executable ../bin/pcl_vtk2ply
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010001
/usr/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0010002
[ 46%] Built target pcl_vtk2ply
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

@kingyongyongzz
Copy link
Author

kingyongyongzz commented Nov 18, 2024

I already solved this problem( this issue show up because the conflict between anaconda and pcl ),thanks for helping!@mvieth

@mvieth
Copy link
Member

mvieth commented Nov 19, 2024

@kingyongyongzz Glad to hear that it is solved. Could you share how you fixed the conflict between anaconda and pcl? (In case anyone else has the same problem in the future)

@kingyongyongzz
Copy link
Author

Sure! A conflict with the dynamic library in the environment due to anaconda3 being installed in the environment.

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSM.so: undefined reference to uuid_generate@UUID_1.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSM.so: undefined reference to uuid_unparse_lower@UUID_1.0'

Terminal input :
ldd /usr/lib/x86_64-linux-gnu/libSM.so | grep uuid
output:
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f050c4d9000)

then input:
locate libuuid.so.1

output:
/home/l/anaconda3/lib/libuuid.so.1
/home/l/anaconda3/lib/libuuid.so.1.0.0
/home/l/anaconda3/pkgs/libuuid-1.0.3-h7f8727e_2/lib/libuuid.so.1
/home/l/anaconda3/pkgs/libuuid-1.0.3-h7f8727e_2/lib/libuuid.so.1.0.0
/snap/core20/1611/usr/lib/x86_64-linux-gnu/libuuid.so.1
/snap/core20/1611/usr/lib/x86_64-linux-gnu/libuuid.so.1.3.0
/snap/core20/2015/usr/lib/x86_64-linux-gnu/libuuid.so.1
/snap/gnome-42-2204/141/usr/lib/x86_64-linux-gnu/libuuid.so.1
/snap/gnome-42-2204/141/usr/lib/x86_64-linux-gnu/libuuid.so.1.3.0
/usr/lib/x86_64-linux-gnu/libuuid.so.1
/usr/lib/x86_64-linux-gnu/libuuid.so.1.3.0
The key point is that Anaconda is installed on the system, so when the system calls the library file, it actually calls the library in the /home/l/anaconda3/lib/libuuid.so.1 directory

Look at the versions used by each library separately
input:
ll /lib/x86_64-linux-gnu/ | grep uuid

output:-rw-rw-r-- 2 ls ls 29830 10月 6 2021 libuuid.a
lrwxrwxrwx 1 ls ls 16 9月 6 11:04 libuuid.so -> libuuid.so.1.0.0*
lrwxrwxrwx 1 ls ls 16 9月 6 11:04 libuuid.so.1 -> libuuid.so.1.0.0*
-rwxrwxr-x 2 ls ls 22480 10月 6 2021 libuuid.so.1.0.0*

You can see that libuuid.so.1 in the system version actually points to version 1.3.0, while libuuid.so.1 in the Anaconda version actually points to version 1.0.0, and the difference in version results in an undefined reference.
Lets fix it,
then input:
rm /home/l/anaconda3/lib/libuuid.so.1
sudo ln -s /lib/x86_64-linux-gnu/libuuid.so.1 /home/l/anaconda3/lib/libuuid.so.1
ll /home/ls/anaconda3/lib | grep uuid
Output:
-rw-rw-r-- 2 ls ls 29830 10月 6 2021 libuuid.a
lrwxrwxrwx 1 ls ls 16 9月 6 11:04 libuuid.so -> libuuid.so.1.0.0*
lrwxrwxrwx 1 root root 34 11月 6 16:41 libuuid.so.1 -> /lib/x86_64-linux-gnu/libuuid.so.1
-rwxrwxr-x 2 ls ls 22480 10月 6 2021 libuuid.so.1.0.0*

Then CMake . Done!!!!
I learn this from another blogger ,I'm sorry I can't go into that much detail, I'm a newbie.
Thank you for your answer again!@mvieth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: compile error Type of issue status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

2 participants