Compiling issue under Ubuntu 12.10 64bit + eclipse ide

17 views
Skip to first unread message

Gal Anonim

unread,
Jan 6, 2014, 11:34:32 AM1/6/14
to lib...@googlegroups.com
Hi,
I was trying to compile test application but it fails.
I'm using Eclipse IDE for writing and compiling. I did add ting sources.
First there was an issue with close and usleep, but adding # include "unistd.h" solves this.

Now I get:

**** Build of configuration Debug for project cpp_project_1 ****

make all
Building file: ../src/cpp_project_1.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/cpp_project_1.d" -MT"src/cpp_project_1.d" -o "src/cpp_project_1.o" "../src/cpp_project_1.cpp"
../src/cpp_project_1.cpp:9:28: fatal error: ting/net/Lib.hpp: No such file or directory
compilation terminated.
make: *** [src/cpp_project_1.o] Error 1

**** Build Finished ****

sorry I'm green in Cpp.
Thank you,
Rafal

Gal Anonim

unread,
Jan 6, 2014, 11:41:39 AM1/6/14
to lib...@googlegroups.com
That part was fixed, wrong tig localisation.
Now I Get:

**** Build of configuration Debug for project cpp_project_1 ****

make all
Building file: ../src/cpp_project_1.cpp
Invoking: GCC C++ Compiler
g++ -I/home/rafles01/workspace -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/cpp_project_1.d" -MT"src/cpp_project_1.d" -o "src/cpp_project_1.o" "../src/cpp_project_1.cpp"
Finished building: ../src/cpp_project_1.cpp
 
Building target: cpp_project_1
Invoking: GCC C++ Linker
g++  -o "cpp_project_1"  ./src/cpp_project_1.o  
./src/cpp_project_1.o: In function `main':
/home/rafles01/workspace/cpp_project_1/Debug/../src/cpp_project_1.cpp:18: undefined reference to `ting::net::Lib::Lib()'
/home/rafles01/workspace/cpp_project_1/Debug/../src/cpp_project_1.cpp:24: undefined reference to `ting::net::TCPServerSocket::Open(unsigned short, bool, unsigned short)'
/home/rafles01/workspace/cpp_project_1/Debug/../src/cpp_project_1.cpp:29: undefined reference to `ting::net::TCPServerSocket::Accept()'
/home/rafles01/workspace/cpp_project_1/Debug/../src/cpp_project_1.cpp:42: undefined reference to `ting::net::TCPSocket::Send(ting::Buffer<unsigned char const> const&, unsigned long)'
/home/rafles01/workspace/cpp_project_1/Debug/../src/cpp_project_1.cpp:42: undefined reference to `ting::net::Lib::~Lib()'
/home/rafles01/workspace/cpp_project_1/Debug/../src/cpp_project_1.cpp:42: undefined reference to `ting::net::Lib::~Lib()'
./src/cpp_project_1.o: In function `ting::net::Socket::Socket()':
/home/rafles01/workspace/ting/net/Socket.hpp:139: undefined reference to `vtable for ting::net::Socket'
./src/cpp_project_1.o: In function `ting::net::TCPSocket::operator=(ting::net::TCPSocket const&)':
/home/rafles01/workspace/ting/net/TCPSocket.hpp:89: undefined reference to `ting::net::Socket::operator=(ting::net::Socket const&)'
./src/cpp_project_1.o:(.rodata._ZTVN4ting3net15TCPServerSocketE[_ZTVN4ting3net15TCPServerSocketE]+0x20): undefined reference to `ting::net::Socket::GetHandle()'
./src/cpp_project_1.o: In function `ting::net::TCPServerSocket::~TCPServerSocket()':
/home/rafles01/workspace/ting/net/TCPServerSocket.hpp:53: undefined reference to `ting::net::Socket::~Socket()'
./src/cpp_project_1.o:(.rodata._ZTVN4ting3net9TCPSocketE[_ZTVN4ting3net9TCPSocketE]+0x20): undefined reference to `ting::net::Socket::GetHandle()'
./src/cpp_project_1.o: In function `ting::net::TCPSocket::~TCPSocket()':
/home/rafles01/workspace/ting/net/TCPSocket.hpp:53: undefined reference to `ting::net::Socket::~Socket()'
./src/cpp_project_1.o:(.rodata._ZTIN4ting3net15TCPServerSocketE[_ZTIN4ting3net15TCPServerSocketE]+0x10): undefined reference to `typeinfo for ting::net::Socket'
./src/cpp_project_1.o:(.rodata._ZTIN4ting3net9TCPSocketE[_ZTIN4ting3net9TCPSocketE]+0x10): undefined reference to `typeinfo for ting::net::Socket'
collect2: error: ld returned 1 exit status
make: *** [cpp_project_1] Error 1

**** Build Finished ****

Gal Anonim

unread,
Jan 6, 2014, 12:15:51 PM1/6/14
to lib...@googlegroups.com
I got it!
Linker with  -lpthread needs to be configured.
For Ubuntu 12 + eclipse: /usr/lib/x86_64-linux-gnu
Library: pthread
dpkg : libc6-dev:amd64: /usr/lib/x86_64-linux-gnu/libpthread.a

Sorry,
Thank you

Ivan Gagis

unread,
Jan 6, 2014, 4:07:40 PM1/6/14
to lib...@googlegroups.com
Hi!

Good that you figured out how to configure linker.
But the thing with "unistd.h" seems strange, it should have worked out of the box. Though, I'm using latest ubuntu and did not try on older one... maybe something is different in 12.10. If you have more problems with TING, feel free to post your questions here.

Best regards,
Ivan

понедельник, 6 января 2014 г., 19:15:51 UTC+2 пользователь Gal Anonim написал:
Reply all
Reply to author
Forward
0 new messages