-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
clang: error: linker command failed with exit code 1 (use -v to see invocation) #2997
Comments
I don't think we will be able to help you with just this information. The error log just tells us you have a linking error. I'm still on High Sierra but we had Mojave users reporting successful compilation before. Is it just version 1.9.1 that you're not able to compile or also the current master branch? |
I installed CMake and PCL through homebrew, I think that everything is up to date. I tried from December of last year and started from the newest PCL version, but there were always kinds of errors, including the cmake error about not finding glew. |
So it means that you're not trying to compile PCL, but your own project which uses PCL. That wasn't clear. If that's the case and you're having linking problems can you post the CMakeLists.txt file for your project?
I can't help you with this. I've seen reports about that glew problem, but at this point migrating to Mojave is not an option for me and our CI infrastructure is still on High Sierra. However, it seems Mojave was deployed just last month to Azure Pipelines so we can upgrade it, see what happens and hopefully bump into whatever problem there might exist. |
Your soonest response will be highly appreciated. Yes, I have not tried to compile PCL, just my own project uses PCL. I also think that you can have a try and to see what will happen after upgrade. This is the CMakeLists.txt of my project: cmake_minimum_required(VERSION 3.13) find_package(PCL 1.9.1 REQUIRED) set(CMAKE_CXX_STANDARD 14) add_executable(T191_2 main.cpp) |
Try removing the following lines include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_DEFINITIONS})
add_definitions(${PCL_DEFINITIONS}) |
I tried, but still the error. |
And I compiled PCL1.9.1 with CMake just, there`s no problems. |
Are you by chance getting the error |
That particular bug should be fixed already, although it wan't released yet. Try to compile the current master and give it a try. |
Yes, sometimes. I have solved now, though it is not perfect. I install PCL1.8.1 first through homebrew, then new a project through CLion with C++ Standard 11. Then upgrade the PCL, succeed. But this way can not new a project again, because it will have the glew error in new projects. |
If you are trying to avoid compiling from master, I was able to get around that linking error using the homebrew install of PCL 1.9.1_3 by copying the current FindFLANN.cmake to |
I installed Glew using Brew and had to add the default linked path for Brew to the FindGlew.cmake script. Line 61 in the FindGLEW.cmake file add Hopefully the code on the master-branch solves this since PCL is going to use the Cmake builtin FindGLEW.cmake script. |
Could you try master branch? Is there any specific reason why you prefer an old version? |
I installed it via Brew and I'm using it as a dependency in a ROS2 module, so that was the reason for not building it myself etc. Pure lazyness, but I'll try it out and report back :) |
i didnt understand this part |
Run and then for your version/install dir open the
then line 61 in that file:
inside the parentheses here add However this should probably not be necessary in the latest version, not even sure why I had to do it. |
Closing due to inactivity (And since MacOS has deprecated OpenGL, and thus glew by extension) |
When I want to complier the PCL project, there are kinds of errors, for example:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [untitled] Error 1
make[2]: *** [CMakeFiles/untitled.dir/all] Error 2
make[1]: *** [CMakeFiles/untitled.dir/rule] Error 2
make: *** [untitled] Error 2
I have tried many ways except for reinstalling my system, but I failed, and there are no much similar situation. macOS 10.13 has not such problems.
I want to know if these problems are leaded by macOS10.14? Have any way to solve them? Thank you so much!
The text was updated successfully, but these errors were encountered: