[Ace-users] Undefined reference error

S sunnypalsingh at gmail.com
Mon Jan 21 04:20:26 CST 2008


On Jan 21, 1:45 pm, Amal Pillai <amal.pil... at gmail.com> wrote:
> Maybe you did not link against the ace library (libACE.dll) ? I don't
> use codeblocks, but a quick run of your code without linking with the
> ACE library made the linker throw up the same set of errors ... I
> don't think you need to use WinMain.
>
> BTW, I use ACE 5.5.1 with gcc 3.4.5 (mingw) on a XP SP2.
>
> -Amal
>
> > >  SYNOPSIS:
> > > There are around 16 errors
> > > 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
>
> > > When I change int main(int argc, char* argv) to int WINAPI
> > > WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
> > > Errors get reduced to 4. Code fails at ACE_DEBUG line.
> > > 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
>
> > ...
>
> > read more »

Yes I missed the dll. It's compiling and executing now. But still I
don't get output of ACE_TRACE
Do I need to do anything extra to get output of ACE_TRACE?
---------------------
Current output
---------------------
Hi Mom
Howdy Pardner
Goodnight





More information about the Ace-users mailing list