[Ace-users] Undefined reference error

S sunnypalsingh at gmail.com
Sun Jan 20 10:28:49 CST 2008


I recently built the ACE framework on my windowsXP service pack 2
machine.
I am using Codeblocks with MinGW. In the compiler I #defined WIN32 and
tried to compile the following code:

#include "ace/Log_Msg.h"
void foo (void);
int main(int, char *[])
{
    ACE_TRACE("main");
    ACE_DEBUG ((LM_INFO, "%IHi Mom\n"));
    foo();
    ACE_DEBUG ((LM_INFO, "%IGoodnight\n"));
    return 0;
}
void foo (void)
{
    ACE_TRACE ("foo");
    ACE_DEBUG ((LM_INFO, "%IHowdy Pardner\n"));
}

I got undefined reference error

C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:3: undefined reference to
`_imp___ZN13ACE_Main_Base3runEiPPc'
obj\Debug\main.o: In function `Z10ace_main_iiPPc':
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:6: undefined reference to
`_imp___ZN11ACE_Log_Msg18last_error_adapterEv'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:6: undefined reference to
`_imp___ZN11ACE_Log_Msg8instanceEv'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:6: undefined reference to
`_imp___ZN11ACE_Log_Msg15conditional_setEPKciii'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:6: undefined reference to
`_imp___ZN11ACE_Log_Msg3logE16ACE_Log_PriorityPKcz'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:8: undefined reference to
`_imp___ZN11ACE_Log_Msg18last_error_adapterEv'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:8: undefined reference to
`_imp___ZN11ACE_Log_Msg8instanceEv'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:8: undefined reference to
`_imp___ZN11ACE_Log_Msg15conditional_setEPKciii'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:8: undefined reference to
`_imp___ZN11ACE_Log_Msg3logE16ACE_Log_PriorityPKcz'
obj\Debug\main.o: In function `Z3foov':
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:14: undefined reference to
`_imp___ZN11ACE_Log_Msg18last_error_adapterEv'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:14: undefined reference to
`_imp___ZN11ACE_Log_Msg8instanceEv'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:14: undefined reference to
`_imp___ZN11ACE_Log_Msg15conditional_setEPKciii'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:14: undefined reference to
`_imp___ZN11ACE_Log_Msg3logE16ACE_Log_PriorityPKcz'
obj\Debug\main.o: In function `main':
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:3: undefined reference to
`_imp___ZN13ACE_Main_BaseD2Ev'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:3: undefined reference to
`_imp___ZN13ACE_Main_BaseC2Ev'
C:/Documents and Settings/Sunny/My Documents/CodeBlockProjects/
ACEProject/main.cpp:3: undefined reference to
`_imp___ZN13ACE_Main_BaseD2Ev'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
16 errors, 0 warnings

Any help on this??


More information about the Ace-users mailing list