c++ - set_unexpected() is undefined in C++ RTL
- Scott Michel (10/10) Jan 22 2004 Walter:
- Dimitri Kaparis (21/37) Jan 23 2004 set_unexpected is defined in namespace std.
Walter: Compiling the following snippet with and without STLport fails with set_unexpected undefined at link time: #include <exception> int main(void) { set_unexpected(NULL); return 0; } -scooter
Jan 22 2004
Scott Michel wrote:Walter: Compiling the following snippet with and without STLport fails with set_unexpected undefined at link time: #include <exception> int main(void) { set_unexpected(NULL); return 0; } -scooterset_unexpected is defined in namespace std. Once that is fixed, the above code builds successfully using the static RTL (assuming default configuration, with STLPort installed). With the DLL runtime library, linking fails with undefined symbol error: sc test.cpp -Ae -mn -o+time -WA -ND -3 -a8 -c -D_CONSOLE=1 -otest.obj link /NOI /DE /E /PACKF /XN /NT /ENTRY:mainCRTStartup /BAS:4194304 /A:512 Test.LNK Error: C:\documents and settings\dimitri\my documents\my projects\Test\test.OBJ(test) : Symbol Undefined ?set_unexpected std YAP6AXXZP6AXXZ Z (void cdecl (*)(void )cdecl std::set_unexpected(void cdecl (*)(void ))) Lines Processed: 828 Errors: 1 Warnings: 0 Build failed sc test.cpp -Ae -mn -o+time -WA -3 -a8 -c -D_CONSOLE=1 -otest.obj link /NOI /DE /E /PACKF /XN /NT /ENTRY:mainCRTStartup /BAS:4194304 /A:512 Test.LNK ren .\$SCW$.EXE Test.EXE .\Test.EXE built Lines Processed: 828 Errors: 0 Warnings: 0 Successful build
Jan 23 2004