[Ace-users] [ace-users] Undefined reference error

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Sun Jan 20 12:33:31 CST 2008


Hi,

>I recently built the ACE framework on my windowsXP service pack 2
>machine.

To ensure that we have proper version/platform/compiler information,
please make sure you fill out the appropriate problem report form
(PRF), which is in

$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM

or in

$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM

in older versions of ACE+TAO.  Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness.  If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.

>I am using Codeblocks with MinGW. In the compiler I #defined WIN32 and
>tried to compile the following code:

There's a MinGW build reported on our auto-build scoreboard at

http://www.dre.vanderbilt.edu/scoreboard/integrated.html

I recommend you take a look at it see what configuration is used and
apply this to your environment.

Thanks,

        Doug

>#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??


-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list