ld: symbol(s) not found for architecture x86_64 MacOS Catalina - macos

I'm getting this error when I try to build this software available in GitHub (https://github.com/fabienbaron/bsmem). I'm using cmake to build it.
2 warnings generated.
[ 33%] Building Fortran object src/CMakeFiles/bsmem.dir/bsmemf.f.o
[ 50%] Building C object src/CMakeFiles/bsmem.dir/free_fits.c.o
[ 66%] Building C object src/CMakeFiles/bsmem.dir/read_fits.c.o
[ 83%] Building Fortran object src/CMakeFiles/bsmem.dir/vector.f.o
[100%] Linking C executable ../../bin/bsmem Undefined symbols for architecture x86_64:
"_mecopy_", referenced from:
_icf_ in bsmemf.f.o
_tricf_ in bsmemf.f.o "_meinit_", referenced from:
_bsmem in bsmem.c.o "_mem4_", referenced from:
_bsmem in bsmem.c.o "_memset_", referenced from:
_bsmem in bsmem.c.o "_meswap_", referenced from:
_udiag_ in bsmemf.f.o "_movie4_", referenced from:
_bsmem in bsmem.c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../bin/bsmem] Error 1 make[1]: *** [src/CMakeFiles/bsmem.dir/all]
Error 2 make: *** [all] Error 2
Any idea on how to fix this problem?
Thanks.

Related

Unable to compile library, symbol not found when running make

I am trying to compile a library, MultiNest. I am on Mac OS Catalina, 10.15.6. The instructions to do so are
git clone https://github.com/JohannesBuchner/MultiNest
cd MultiNest/build
cmake ..
make
I get this error when running make:
Undefined symbols for architecture x86_64:
"___nested_MOD_nestrun", referenced from:
_run in eggbox.c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/eggboxC] Error 1
make[1]: *** [src/example_eggbox_C/CMakeFiles/eggboxC.dir/all] Error 2
make: *** [all] Error 2

How to connect OpenCV to Xcode?

The path:
/usr/local/include
/usr/local/lib
Outputs such an error:
Undefined symbols for architecture x86_64:
"cv::String::deallocate()", referenced from:
cv::String::~String() in main.o
cv::String::operator=(cv::String const&) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to fix this error?

Build PCL on macOS Sierra - Linking CXX shared library error: Undefined symbols for architecture x86_64

I'm trying to install PCL (Point Cloud Library) on my system with macOS Sierra following the instructions here: http://ns50.pointclouds.org/documentation/tutorials/compiling_pcl_macosx.php
I made it to the step "Building PCL" but receive the following error when running the "cmake .." command:
[ 10%] Linking CXX shared library ../lib/libpcl_io.dylib
Undefined symbols for architecture x86_64:
"boost::this_thread::hiden::sleep_until(timespec const&)", referenced from:
pcl::HDLGrabber::readPacketsFromPcap() in hdl_grabber.cpp.o
pcl::OpenNIGrabber::start() in openni_grabber.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [lib/libpcl_io.1.8.0.99.dylib] Error 1
make[1]: *** [io/CMakeFiles/pcl_io.dir/all] Error 2
make: *** [all] Error 2
Thanks for your help!

Undefined symbols for x86_64 architecture on mac

I am trying to compile a code that uses the FFTW libraries. I have installed these and have checked using lipo that they are installed for x86_64 architecture. However when I try to compile I get the following error
mpif90 -r8 -O3 -assume byterecl -u -I/usr/local/mpich2/include -I/usr/local/fftw_215_mpich2/include -L/usr/local/fftw_215_mpich2/lib -I./OBJ/ ./SRC/tt_main.f90 ./OBJ/xx_exter.o ./OBJ/tt_fft.o ./OBJ/tt_force.o ./OBJ/tt_init.o ./OBJ/tt_io.o ./OBJ/tt_les.o ./OBJ/tt_update.o ./OBJ/tt_stat.o ./OBJ/tt_mod.o ./OBJ/xx_mod.o -o turbo -ldfftw -ldrfftw -ldfftw_mpi -ldrfftw_mpi -lm
Undefined symbols for architecture x86_64:
"_rfftwnd_f77_mpi_", referenced from:
_fft3ds_ in tt_fft.o
_ifft3ds_ in tt_fft.o
"_rfftwnd_f77_mpi_create_plan_", referenced from:
_init_fft3d_ in tt_fft.o
"_rfftwnd_f77_mpi_local_sizes_", referenced from:
_init_fft3d_ in tt_fft.o
ld: symbol(s) not found for architecture x86_64
make[1]: *** [turb] Error 1
make: *** [turbo] Error 2
Can anyone help?

Trying build OpenNI samples with CMakeLists.txt but getting error

I have mad my own CMakeLists.txt file to build OpenNI samples. I successfully build NiSimpleViewer. But when try with NiUserTracker I get this error:
35 warnings generated.
Linking CXX executable main
ld: warning: path '/usr/lib/libOpenNI.dylib' following -L not a directory
Undefined symbols for architecture x86_64:
"DrawDepthMap(xn::DepthMetaData const&, xn::SceneMetaData const&)", referenced from:
glutDisplay() in main.cpp.o
"MyPoseInProgress(xn::PoseDetectionCapability&, char const*, unsigned int, XnPoseDetectionStatus, void*)", referenced from:
_main in main.cpp.o
"MyCalibrationInProgress(xn::SkeletonCapability&, unsigned int, XnCalibrationStatus, void*)", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
This is the CMakeLists I use. Plese tell me what's wrong with it?
http://pastebin.com/SMYjjU35
The contents of folder outside build/ are
CMakeLists.txt Libs build opengles.cpp
GL SceneDrawer.cpp glh opengles.h
GLES SceneDrawer.h main.cpp
I guess, it's because of this line:
link_directories(${OPENNI_LIBRARY})
The link_directories() command sets path where libraries should be searched for, so you need something like ${OPENNI_LIBRARY_DIRS} there.

Resources