std::runtime_error

bridged with qdn.public.qnxrtp.x86
Post Reply
Oleksandr Brovko

std::runtime_error

Post by Oleksandr Brovko » Tue Dec 03, 2002 12:28 pm

Hi,
Which library should I link with to be able to use std::runtime_error
class?
I am unable to build following file (my command line is: qcc
runtime_error.cpp):
//----------runtime_error.cpp-----------------//
#include <stdexcept>
class MyException : public std::runtime_error
{
public:
MyException() : std::runtime_error("TEST\n"){};
};
int main()
{
MyException e;
return 0;
};
//----------End of runtime_error.cpp---------//

Reported error:
/tmp/AAA247578_cc.o: In function `MyException::MyException(void)':
/tmp/AAA247578_cc.o(.gnu.linkonce.t.__11MyException+0x29): undefined
reference
to `runtime_error::runtime_error(basic_string<char,
string_char_traits<char>, __efault_alloc_template<false, 0> > const &)'
cc: /usr/bin/ntox86-ld error 1


Thanks,
Oleksandr Brovko.

Oleksandr Brovko

Re: std::runtime_error

Post by Oleksandr Brovko » Wed Dec 11, 2002 12:43 pm

Hi,
If some is interested in this question...
the answer is:
#pragma implementation "stdexcept"
//----------runtime_error.cpp-----------------//
#pragma implementation "stdexcept"
#include <stdexcept
class MyException : public std::runtime_error
{
public:
MyException() : std::runtime_error("TEST\n"){};
};
int main()
{
MyException e;
return 0;
};
//----------End of runtime_error.cpp---------//

Post Reply

Return to “qdn.public.qnxrtp.x86”