[MERFISH Error] Error2 ld/ symbol(s) not found for architecture x86_64

Use the command GCC IA_utilities.o-dynamiclib -o libia_Utilities.dylib error generating dynamic library.

The error prompt statement is as follows, showing that undefined symbols have been used.

Undefined symbols for architecture x86_64:
...
...
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I forgot to keep the specific error reporting process in the middle... part is some error tips, which indicate that some variables and functions set in kdtree cannot be found.

Theoretically, both kdtree.C and kdtree.H files exist under my project directory. Compile IA_Utilities.C everything is normal when this file is. I struggled for a day and couldn’t find a way for GCC to find these two files.

So in a rage, I directly added the contents of kdtree.C and kdtree.H to IA_Utilities.C file, and the reference to kdtree in this file is cancelled.

Therefore, the dynamic library is successfully generated again.

Obviously, the error occurs because the linker of GCC cannot find the function in kdtree.

 

Similar Posts: