Following this question, I'm trying to compile this code, where I get this error message:
Undefined symbols for architecture x86_64: "_<someFunction>", referenced from: _<someOtherFunction> in <someFile>.o _<yetAnotherFunction> <someOtherFile>.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: *** [<someApp>.app/Contents/MacOS/<someApp>] Error 1
which you may see the complete version here.
I installed libelf
via HomeBrew. and modified the .pro
file to:
macx {
DEFINES += __LIBELF_INTERNAL__
INCLUDEPATH += /usr/local/Cellar/libelf/0.8.13_1/include/libelf/
QMAKE_LIBS += -L/usr/local/Cellar/libelf/0.8.13_1/lib/
} else {
QMAKE_LIBS += -lelf
}
But didn't help. I have also tried downloading and compiling different versions of the libelf
library with no avail.
I would appreciate it if you could help me know:
- what does this error message mean? Is there a problem in the
qmake
.pro
file here? Or the installed/compiled library is not X64 compatible? - How can I solve this specific problem?
P.S.1. I deliberately exclude the complete error message because I primarily want to understand the meaning of this error message rather than solving the specific problem. I tried to avoid cluttering my question in favor of conciseness and readability.
P.S.2. running the lipo -info /path/to/libelf.a
returns
Non-fat file: /path/to/libelf.a is architecture: x86_64