|
我在MINGW+MSYS已经编译好了ACE,在系统环境也配置好变量,在Eclipse也配置好lib的路径.
就这一段代码:
#include <stdio.h>
#include <ace/OS.h>
int main (int argc , char* argv[]) {
printf ("Hello,World.");
return 0;
}
编译的时候总出现以下错误:
C:/ACE_wrappers/ace/Time_Value.h undefined reference to`_imp__ZN14ACE_Time_Value4zeroE`
C:/ACE_wrappers/ace/Time_Value.h undefined reference to `_Imp__ZN14ACE_Time_Value8max_timeE`
undefined reference to `_imp__ZN13ACE_Main_Base3runEIPPC`
undefined reference to `_imp__ZN13ACE_Main_BaseC2Ev`
undefined reference to `_imp__ZN13ACE_Main_BaseD2Ev`
只要插入ACE的头文件就是undefined reference
下面是编译详细信息:
**** Build of configuration Debug for project ace_test ****
**** Internal Builder is used for build ****
g++ -IC:\ACE_wrappers -O0 -g3 -Wall -c -fmessage-length=0 -osrc\test.o ..\src\test.cpp
g++ -LC:\ACE_wrappers -LC:\ACE_wrappers\ace -LC:\ACE_wrappers\bin -LC:\ACE_wrappers\lib -oace_test.exe src\test.o
src\test.o: In function `main':
D:/C_WorkSapce/ace_test/Debug/../src/test.cpp:4: undefined reference to `_imp___ZN13ACE_Main_Base3runEiPPc'
src\test.o: In function `Z41__static_initialization_and_destruction_0ii':
C:/ACE_wrappers/ace/Time_Value.h:353: undefined reference to `_imp___ZN14ACE_Time_Value4zeroE'
C:/ACE_wrappers/ace/Time_Value.h:354: undefined reference to `_imp___ZN14ACE_Time_Value8max_timeE'
src\test.o: In function `main':
D:/C_WorkSapce/ace_test/Debug/../src/test.cpp:4: undefined reference to `_imp___ZN13ACE_Main_BaseD2Ev'
D:/C_WorkSapce/ace_test/Debug/../src/test.cpp:4: undefined reference to `_imp___ZN13ACE_Main_BaseC2Ev'
D:/C_WorkSapce/ace_test/Debug/../src/test.cpp:4: undefined reference to `_imp___ZN13ACE_Main_BaseD2Ev'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1203 ms.
请问是什么原因呢? 已经郁闷了一晚.............
对了,ACE_ROOT = C:/ACE_wrappers
acelib.dll 在 C:/ACE_wrappers/lib,已经分别在系统PATH变量中加入此路径,也在Eclipse连接选项的library中加入此路径
thanks |
|