-
Notifications
You must be signed in to change notification settings - Fork 368
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
ld: symbol(s) not found for architecture x86_64 #45
Comments
It looks like you have object files or binaries from a previous build lying around. My suggestions is:
|
Did the above suggestion work? If I don't get a response, I'll close this in a week. |
It doesn't work . I don't have any idea about it. I have given up three days ago. Thanks for your reply. |
Closing this as there is insufficient information to do anything. Feel free to re-open if you can make more information available to me. |
Hi, I created a test app the just tries to open a soundfile with sf_open. Compilation seems to go fine, the problem arises when linking. Building target: testlib I installed libsndfile with homebrew - headers&libraries seem to be found OK in /usr/local/include and /usr/local/lib respectively. libsndfile.dylib: Mach-O 64-bit dynamically linked shared library x86_64 (Not sure what that means for libsndfile.a) |
The line:
needs to be told to link the libsndfile library ie:
|
Thanks for the help out, I suspected it would be something basic like that :) Just in case someone ends up here with the same development environment, Project->Properties->C/C++ Build->Settings->Mac OS C++ Linker->Libraries->"Libraries -l" Entering "/usr/local/lib" into "Library Search Path (-L)" was not necessary - evidently the linker looks there already by default. It is also important however to point the Compiler to the correct include directory (containing "sndfile.h"). I guess most installations would install this into "/usr/local/include". Project->Properties->C/C++ Build->Settings->GCC C++ Compiler->Includes->"Include paths (-l)" Cheers, |
Hi! I have the same issue. It cropped up all of a sudden. The same program I am trying to build now has been compiled/run before. My OS has been updated to Yosemite 10.10. I tried fixing the issue both ways. I have linked the library in Xcode using the correct header search path. I made a fresh installation of libsndfile. It still doesn't fix the issue. I can provide any additional details necessary. Context: I am trying to compile a program, that reads a wave file and prints info. Undefined symbols for architecture i386: The id was ld: symbol(s) not found for architecture x86_64 initially. I changed the architecture it was building against in Xcode and hence the new error id shows i386. Could you help me fix this issue? Been struggling with it for a long time. |
@amruthanad You have given me error message but not the compile comand that produced this error. On your machine: a) What command are you using to compile? |
a) I tried building it in Xcode as a part of a project. I could compile it from the command line using g++. What worked was: g++ -I/usr/local/include -lsndfile -o testwav testwav.c b) Libsndfile is installed in /usr/local/include directory. c) I installed it exactly as described in README.md. I am new to using macOSX and also new to command line. I am not sure if its installed in the same architecture. Is there different install instructions for different architectures? (I have a macbook pro if that helps) |
If you are building it with Xcode I can't help you. I do all my development on Linux and do not have any access to Mac OS. However, your problem has nothing specifically to do with libsndfile and everything to do with Xcode. I suggest you seek Xcode help elesewhere. |
Thank you for your response. I figured that must be the case as it compiles just fine with g++. Maybe I will just stick to command line compilation. |
Hi I do have the same problem and I am using the Eclipse to compile the project, $ gcc -lssl -lcrypto -o /Users/KHF/Documents/Eclipse/workspace/Test\ EC/EC.c I had tried the above solution by pointing the location of sndfile.h and also added the same to the libraries. Yet the problems don't seems to be solved. |
Hey! Make sure you compile it as a library and link the library when you
|
@hasanfaizal From what I can see, it seems your problem has nothing to do with libsndfile and everything to do with Eclipse. Since I have never used Eclipse, you are much better off asking for help elsewhere. Sorry I can't be of more help. |
When I try to build on MacOS 10.8.4,it turns out this error message.
cc1plus: warning: command line option "-Wmissing-declarations" is valid for C/ObjC but not for C++
CXXLD sndfilehandle
ld: warning: ignoring file ../src/.libs/libsndfile.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x c 0x 0 0x 0 0x 0 0x 9 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): ../src/.libs/libsndfile.dylib
Undefined symbols for architecture x86_64:
"_sf_close", referenced from:
_main in sndfilehandle.o
"_sf_open", referenced from:
_main in sndfilehandle.o
"_sf_read_short", referenced from:
_main in sndfilehandle.o
"_sf_write_short", referenced from:
_main in sndfilehandle.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [sndfilehandle] Error 1
make: *** [all-recursive] Error 1
The text was updated successfully, but these errors were encountered: