如果你想写一个源代码,可能直接跨过windows与linux with ACE.那可能要留意以下几点了.
一个对于#include里,不要像在VC里使用时,文件的大小写没有区别.在linux里是不行的.
还有目录的表示如:#include "ace/ACE.h"与#include "ace/ACE.h"
都是一样的.但是在linux里只会认识#include "ace/ACE.h"
还需要重新提一下以前写过了makefile文件的问题.
ace框架为了方便我们做一个make文件,它们做了一些GNU.
如果你的工程有多个文件的时候要如何做呢.
看一下这个makefile文件吧:
BIN = main
FILES= ProactorTask Send connecte
SRC = $(addsuffix .cpp,$(FILES))
OBJ=$(addsuffix .o,$(FILES))
BUILD = $(VBIN)
#LIBS = -lMyOtherLib
LDFLAGS = -L$(ACE_ROOT)/lib
include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
FILES= ProactorTask Send connecte
SRC = $(addsuffix .cpp,$(FILES))
OBJ=$(addsuffix .o,$(FILES))
BUILD = $(VBIN)
#LIBS = -lMyOtherLib
LDFLAGS = -L$(ACE_ROOT)/lib
include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
其中有几句
FILES= ProactorTask Send connecte
这个就是将你写的ProactorTask.cpp,Send.cpp,connecte.cpp
这一句将会把你目录下的除main.cpp文件之外的,加入的cpp文件.
留意:
对于本目录的#include "./connecte.h"
这个也需要注意./这样就会在本目录里搜索.