Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----main.cpp
- #include <iostream>
- void doit();
- int main()
- {
- std::cout << "main\n";
- doit();
- return 0;
- };
- -------------------------
- ---example.cpp
- #include <boost/thread.hpp>
- void doit()
- {
- boost::thread t1;
- }
- ------------------------
- ---build script
- g++ -Wall -fPIC -I/usr/include -c example.cpp -o example.o
- g++ -shared /usr/lib/libboost_thread.a /usr/lib/libboost_system.a -Wl,-rpath,/usr/lib example.o -o libexample.so
- g++ -Wall -c main.cpp -o main.o
- g++ libexample.so main.o -o main
- ---------------------------
- error message:
- libexample.so: undefined reference to `boost::thread::thread()'
- libexample.so: undefined reference to `boost::thread::~thread()'
- collect2: ld returned 1 exit status
Advertisement
Add Comment
Please, Sign In to add comment