ACE的安装是按照ACE的网站的介绍make,make install,没有错误,很兴奋,马上弄了一个小例子,如下
// testace.cpp : Defines the entry point for the console application.
//
#include <stdlib.h>
#include <ace/OS.h>
#include <ace/Log_Msg.h>
int main(int argc, const char* argv[])
{
ACE_DEBUG((LM_DEBUG,"Hello, ACE! "));
ACE_OS::exit(1);
return 0;
}
#include <ace/OS.h>
#include <ace/Log_Msg.h>
为
#include <ace/OS.h>
#include <ace/Log_Msg.h>
重新编译,这次没问题了
顺利通过,哈哈哈
刚要高兴一下,运行时又出问题了,说是找不到libACE-5.7.5.so,怎么办
ls /usr/locale/lib
看到了这个文件,为什么没有呢?
重新找问题吧,看了一下 /etc/ld.so.conf,也包含了/usr/local/lib这个目录,为了保险,还是/sbin/ldconfig –v.再次运行
“Hello, ACE!”终于出来了。
到此总结一下:抄代码时,一定要注意一下环境。刚才的代码就是一个windows下的测试程序。因为一个分隔符的问题,浪费了两个小时的时间。