Reputation: 13
I am trying to build python scripts from C++ code using SWIG and I am receiving the error in the title. If I change the interface and fully qualify the path to the external header file it works fine.
Couple of questions:
Can the path get included in the command call? I tried -IC:\Code\ExternalHeaders
but that did not work.
Can this path be argument driven? Different developers will have different paths. This way they can make the path change in their project.scons file and everything would work.
We use SCONS for building all source code. The header file is located in C:\Code\Edwards\EWCppLibrary\EWBase
. Here's the log:
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>
Upvotes: 0
Views: 688
Reputation: 28405
You need to specify:
/IC:\Code\Edwards\EWCppLibrary\EWBase
For your compiler.
Upvotes: 1