2014-09-23 113 views
0

我想从C++代码使用SWIG构建python脚本,并且在标题中收到错误。如果我更改了界面并完全限定了外部头文件的路径,它可以正常工作。SWIG致命错误C1083:无法打开包含文件

几个问题:

  1. 能的路径获得包括在命令调用?我试过-IC:\Code\ExternalHeaders,但没有奏效。

  2. 这条路可以参数驱动吗?不同的开发者会有不同的路径。通过这种方式,他们可以在其project.scons文件中更改路径,并且一切都可以工作。

我们使用scons的构建所有的源代码。头文件位于C:\Code\Edwards\EWCppLibrary\EWBase。这里的日志:

C:\Code\Python\QTPythonExample\QETestProject_CLM>scons -f vs.scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build\win32\release build\win32\debug swig -o build\win32\debug\src\py_swig_interface_wrap.cc 

-IC:\Code\Edwards\EWCppLibrary -Iinc -Isrc -IEWBase -IC:\Python27\include 

-python -c++ -nodefault -templatereduce src\py_swig_interface.i SWIG(1) : Warning 123: dangerous, use -nodefaultctor, -nodefaultdtor instead. cl /Fobuild\win32\debug\src\py_swig_interface_wrap.obj /c build\win32\debug\src\py_swig_interface_wrap.cc /TP /DEBUG /Zi /MDd /Od /EHsc /nologo /D__WIN32__ /DWIN32 /DDEBUG /IC:\Code\Edwards\EWCppLibrary /Iinc /Isrc /IEWBase /IC:\Python27\include /Zi /Fdbuild/w in32/debug\py_swig_interface_wrap.obj.pdb py_swig_interface_wrap.cc build\win32\debug\src\py_swig_interface_wrap.cc(3065) : fatal error C1083: Cannot open include file: 'EWStddef.h': No such file or directory scons: *** [build\win32\debug\src\py_swig_interface_wrap.obj] Error 2 scons: building terminated because of errors. 

C:\Code\Python\QTPythonExample\QETestProject_CLM> 

回答

1

您需要指定:

/IC:\Code\Edwards\EWCppLibrary\EWBase 

你的编译器。

相关问题