簡體   English   中英

SWIG致命錯誤C1083:無法打開包含文件

[英]SWIG Fatal error C1083: Cannot open include file

我正在嘗試使用SWIG從C ++代碼構建python腳本,並且標題中出現錯誤。 如果我更改了接口並完全限定了外部頭文件的路徑,則可以正常工作。

幾個問題:

  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>

您需要指定:

/IC:\Code\Edwards\EWCppLibrary\EWBase

對於您的編譯器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM