Cannot build on 10.13.4 - Undefined symbol - AttachToProcessWithID
Closed this issue · 6 comments
arifogel commented
Note:
I have brew installed in my home folder. I changed build.sh
to use cmake
instead of /usr/local/bin/cmake
. I have Xcode and its command-line tools installed.
ari@pibble:~/git/lldbmi2$./build.sh
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ari/git/lldbmi2/build
Scanning dependencies of target lldbmi2
[ 10%] Building CXX object CMakeFiles/lldbmi2.dir/src/engine.cpp.o
[ 20%] Building CXX object CMakeFiles/lldbmi2.dir/src/events.cpp.o
[ 30%] Building CXX object CMakeFiles/lldbmi2.dir/src/frames.cpp.o
[ 40%] Building CXX object CMakeFiles/lldbmi2.dir/src/lldbmi2.cpp.o
[ 50%] Building CXX object CMakeFiles/lldbmi2.dir/src/log.cpp.o
[ 60%] Building CXX object CMakeFiles/lldbmi2.dir/src/names.cpp.o
[ 70%] Building CXX object CMakeFiles/lldbmi2.dir/src/stringb.cpp.o
[ 80%] Building CXX object CMakeFiles/lldbmi2.dir/src/test.cpp.o
[ 90%] Building CXX object CMakeFiles/lldbmi2.dir/src/variables.cpp.o
[100%] Linking CXX executable lldbmi2
Undefined symbols for architecture x86_64:
"lldb::SBTarget::AttachToProcessWithID(lldb::SBListener&, int, lldb::SBError&)", referenced from:
fromCDT(STATE*, char const*, int) in engine.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]: *** [lldbmi2] Error 1
make[1]: *** [CMakeFiles/lldbmi2.dir/all] Error 2
make: *** [all] Error 2
scootdj commented
I believe that the problem is that in your compile the 'pid_t' param to
AttachToProcessWithID() is being passed as an 'int'.
10.13 OSX will only accept a uint64 version of pid. So the variable
being passed to AttachToProcessWithID() needs to be declared as
lldb::pid_t instead of just plain 'pid_t'. lldb::pid_t is the desired
64 bit version of the PID.
…On 5/20/18 3:08 AM, Ari Fogel wrote:
Note:
I have brew installed in my home folder. I changed |build.sh| to use
|cmake| instead of |/usr/local/bin/cmake|. I have Xcode and its
command-line tools installed.
***@***.***:~/git/lldbmi2$./build.sh -- The C compiler identification
is AppleClang 9.1.0.9020039 -- The CXX compiler identification is
AppleClang 9.1.0.9020039 -- Check for working C compiler:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- works -- Detecting C compiler ABI info -- Detecting C compiler ABI
info - done -- Detecting C compile features -- Detecting C compile
features - done -- Check for working CXX compiler:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler
ABI info - done -- Detecting CXX compile features -- Detecting CXX
compile features - done -- Configuring done -- Generating done --
Build files have been written to: /Users/ari/git/lldbmi2/build
Scanning dependencies of target lldbmi2 [ 10%] Building CXX object
CMakeFiles/lldbmi2.dir/src/engine.cpp.o [ 20%] Building CXX object
CMakeFiles/lldbmi2.dir/src/events.cpp.o [ 30%] Building CXX object
CMakeFiles/lldbmi2.dir/src/frames.cpp.o [ 40%] Building CXX object
CMakeFiles/lldbmi2.dir/src/lldbmi2.cpp.o [ 50%] Building CXX object
CMakeFiles/lldbmi2.dir/src/log.cpp.o [ 60%] Building CXX object
CMakeFiles/lldbmi2.dir/src/names.cpp.o [ 70%] Building CXX object
CMakeFiles/lldbmi2.dir/src/stringb.cpp.o [ 80%] Building CXX object
CMakeFiles/lldbmi2.dir/src/test.cpp.o [ 90%] Building CXX object
CMakeFiles/lldbmi2.dir/src/variables.cpp.o [100%] Linking CXX
executable lldbmi2 Undefined symbols for architecture x86_64:
"lldb::SBTarget::AttachToProcessWithID(lldb::SBListener&, int,
lldb::SBError&)", referenced from: fromCDT(STATE*, char const*, int)
in engine.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]: *** [lldbmi2] Error 1 make[1]: ***
[CMakeFiles/lldbmi2.dir/all] Error 2 make: *** [all] Error 2 |
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AM6j1EyaYf4cOJYAPdcOcnZ0JtYyjMdiks5t0SRsgaJpZM4UF_nb>.
samdup123 commented
is there anything I can do to correct this error right now? I have the same problem
samdup123 commented
I actually just fixed it, ill make a PR
arifogel commented
Thanks @samdup123!
So how did the break happen? Did LLVM change their API, or does it have something to do with OSX APIs (independent of LLVM)?
freedib commented
Corrected by scootdj