Problem with using C++

Hi all, I use QNX RTP 6.1 and when I try to link object file, I get that
error

undefined reference to `std::terminate(void)

if I don’t use and intermidiate object file I didn’t get that message

for exemple
qcc -o main main.cpp work but

qcc -c -o main.o main.cpp
qcc -o main main.o

gave me that error message

what’s wrong?

J-F

“Jean-Francois Belisle” <cyberlogik@hotmail.com> wrote:

Hi all, I use QNX RTP 6.1 and when I try to link object file, I get that
error

undefined reference to `std::terminate(void)

if I don’t use and intermidiate object file I didn’t get that message

for exemple
qcc -o main main.cpp work but

qcc -c -o main.o main.cpp
qcc -o main main.o

gave me that error message

what’s wrong?

J-F

Hi. qcc has no way of knowing which language (C, C++) generated
your main.o, where it knows which language main.cpp is.

Try adding “-lang-c++” to your command line:

qcc -c -o main.o main.cpp
qcc -o main main.o -lang-c++

Let me know.
Regards,
GP

Yeah that’s working now with -lang-c++

Thank’s a lot

J-F

Hi. qcc has no way of knowing which language (C, C++) generated
your main.o, where it knows which language main.cpp is.

Try adding “-lang-c++” to your command line:

qcc -c -o main.o main.cpp
qcc -o main main.o -lang-c++

Let me know.
Regards,
GP