tao idl的编译。
命令行的tao编译idl有问题,出现下面的错误,不知为啥。
e:\idl>f:\ace-5.3+tao-1.3\ace_wrappers\bin\tao_idl.exe -gi sample.idl
f:\ace-5.3+tao-1.3\ace_wrappers\bin\tao_idl.exe: spawn of cl.exe failed
用vc工程里的自定义的编译idl就没有问题
invoking tao idl compiler on $(inputpath)
生成实现文件,但是生成的stub和skel文件的包含文件有时好像有问题
$(ace_root)\bin\tao_idl -i..\idl\ -ge -sc -gi -wb,export_macro=dll_export -wb,export_include="dll_export.h" -wb,pch_include=stdafx.h $(inputpath)
不生成实现文件,生成的stub和skel文件的包含文件有时候没有问题
$(ace_root)\bin\tao_idl -i..\idl\ -ge -sc -wb,export_macro=dll_export -wb,export_include="dll_export.h" -wb,pch_include=stdafx.h $(inputpath)
单独生成实现文件
$(ace_root)\bin\tao_idl -i..\idl\ -ge -sc -gi -wb,export_macro=dll_export -wb,export_include="dll_export.h" -wb,pch_include=stdafx.h $(inputpath)
del *c.h *c.cpp *s.h *s.cpp *t.h *t.cpp *.i
或者生成实现文件将其他stub和skeleton的删除
$(ace_root)\bin\tao_idl -i..\idl\ -ge -sc -gi -wb,export_macro=dll_export -wb,export_include="dll_export.h" -wb,pch_include=stdafx.h $(inputpath)
del *c.h *c.cpp *s.h *s.cpp *t.h *t.cpp *.i
$(inputname)c.cpp
$(inputname)c.h
$(inputname)c.i
$(inputname)s.cpp
$(inputname)s.h
$(inputname)s.i
注意问题:
1 编译生成的问题如果 tao的idl编译器不能生成idl头文件的include其他idl文件语句的c++代码
必须手工添加的包含的idl文件在头文件中。
client的映射代码加上包含的idl接口
2 实现文件cpp不能生成vc的#include "stdafx.h",这个其实不是问题,是vc预
编译的问题。可以将vc设置为automatic use of precompiled headers,就不要
加这个头文件
3 工程文件最后使用自动预编译
4 export_macro=dll_export是生成动态库的导出宏。export_include="dll_export.h"
是在每个生成头文件添#include"dll_export.h"者一句,这句很有用,你可以在里面
包含,定义的自己的东西。
tao通知服务的idl的编译选项
cosnotification.idl
其实不需要编译该idl文件,它在f:\ace-5.3+tao-1.3\ace_wrappers\tao\orbsvcs\orbsvcs
的工程里已经编译好,只要连接过来。
下面是tao编译cosnotification.idl的命令行
invoking tao_idl compiler on $(inputpath)
tao_idl -ge 1 -wb,pre_include=ace/pre.h -wb,post_include=ace/post.h -wb,export_macro=tao_notify_export -wb,export_include=notify/notify_export.h $(inputname).idl
..\..\..\bin\release\tao_idl -ge 1 -i../../ -i../../tao -wb,pre_include=ace/pre.h -wb,post_include=ace/post.h -wb,export_macro=tao_notify_export -wb,export_include=notify/notify_export.h $(inputname).idl
$(inputname)c.h
$(inputname)c.i
$(inputname)c.cpp
$(inputname)s.h
$(inputname)s.i
$(inputname)s.cpp
$(inputname)s_t.h
$(inputname)s_t.i
$(inputname)s_t.cpp
vc中使用工程相关的路径设置
vc工程文件的头文件路径
/i "..\skelstub"
/i "..\skelimpl"
vc工程文件的库文件路径
/libpath:"..\lib"