yeqing

C++博客 首页 新随笔 联系 聚合 管理
  1 Posts :: 14 Stories :: 10 Comments :: 0 Trackbacks

#include "ace/OS.h"
#include "ace/Log_Msg.h"
 
int main (int argc, char *argv[])
{
  ACE_DEBUG((LM_DEBUG,"Hello, ACE!\n"));
  ACE_OS::exit(1);
  return 0;
}

使用VS6编译:

1、提示有“Cannot open include file: 'ace/SOCK_Acceptor.h':No such file or directory”
工程-设置-C/C++: Preprocessor,附加包含路径:H:\ACE\ACE-5.5\ACE_wrappers

2、提示有“ You must link against multi-threaded libraries when using ACE (check your project settings)”
工程-设置-C/C++: Code Generation - Use run-time library : Debug Multithreaded Dll

3、提示有“error C2065: 'ACE_ERROR' : undeclared identifier”
        error C2065: 'ACE_DEBUG' : undeclared identifier
#include "ace/Log_Msg.h"

4、提示error C4716: 'ace_main_i' : must return a value
在main中加入 return 0;

5、提示“error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl”
工程-设置-Link-Input: 对象/库模块:添加ACEd.lib                        
附加库路径:H:\ACE\ACE-5.5\ACE_wrappers\lib 

使用linux编译:
makefile 文件如下:
ACE_LIB = $(ACE_ROOT)/ace

LFLAGS = -L$(ACE_LIB) -lACE
CFLAGS = -Wall -O2 -D NDEBUG
IFLAGS = -I $(ACE_ROOT)

OBJS = test_ace.o
      
all: test_ace.exe
         
test_ace.exe: $(OBJS)
 g++ -o $@ $(OBJS) $(LFLAGS)
 @echo done!
            
test_ace.o: test_ace.cpp
 g++ -c $(CFLAGS) $(IFLAGS) $<
   
clean:
 @rm *.o *.exe
 @echo done!

posted on 2006-08-07 10:04 夜沁 阅读(1901) 评论(0)  编辑 收藏 引用 所属分类: ace

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理