Great thanks that works - I'm compiling the main code body now but it seems to not be able to pull the decelerations of the header file in; my output from the compiler is now (ignore the bit in bold for now):
C:\Users\benn\Documents\swigwin-2.0.7\DeepFocusControl>cl.exe /EHsc DeepFocusControl_wrap.cxx /I "C:\Program Files (x86)\Java\jdk1.6.0_29\Include" /I "C:\Program Files (x86)\Java\jdk1.6.0_29\Include\win32" /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Include" /I "C:\Users\benn\Documents\swigwin-2.0.7\DeepFocusControl" /I "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" /link /DLL /OUT:DeepFocusControl_wrap.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
DeepFocusControl_wrap.cxx
DeepFocusControl_wrap.cxx(222) : error C2065: 'DeepFocusObserver' : undeclared identifier
DeepFocusControl_wrap.cxx(222) : error C2065: 'arg1' : undeclared identifier
DeepFocusControl_wrap.cxx(222) : error C2065: 'DeepFocusObserver' : undeclared identifier
DeepFocusControl_wrap.cxx(222) : error C2059: syntax error : ')'
DeepFocusControl_wrap.cxx(227) : error C2065: 'arg1' : undeclared identifier
DeepFocusControl_wrap.cxx(227) : error C2065: 'DeepFocusObserver' : undeclared identifier
DeepFocusControl_wrap.cxx(227) : error C2059: syntax error : ')'
DeepFocusControl_wrap.cxx(228) : error C2065: 'arg1' : undeclared identifier
DeepFocusControl_wrap.cxx(228) : error C2227: left of '->Event' must point to class/struct/union/generic type
type is ''unknown-type''
DeepFocusControl_wrap.cxx(234) : error C2065: 'DeepFocusObserver' : undeclared identifier
DeepFocusControl_wrap.cxx(234) : error C2065: 'result' : undeclared identifier
DeepFocusControl_wrap.cxx(238) : error C2065: 'result' : undeclared identifier
DeepFocusControl_wrap.cxx(238) : error C2065: 'DeepFocusObserver' : undeclared identifier
DeepFocusControl_wrap.cxx(238) : error C2059: syntax error : ')'
DeepFocusControl_wrap.cxx(239) : error C2065: 'DeepFocusObserver' : undeclared identifier
It looks like it cannot find my header file but I have an include to the directory it is in (highlighted in bold in the compile command). The implementation is in a dll however do I need to reference that in some way?
Sorry to ask basic questions!
Cheers,
Neil
On 21 June 2012 21:04, Sami Kallio
<code.kallio <at> gmail.com> wrote:
Look at your interface file and see if you have this:
%module foo
{
#include DeepFocusControlDll.h
}
Replace with #include "DeepFocusControlDll.h", run swig and recompile.
Hello,
I have successfully run swig against my header file and generated some proper looking Java code. I'm now trying to compile the generated c++ code but I have a problem in compiling with the following error:
error C2006: '#include' : expected a filename
I'm compiling with MS Visual Studio Express C++ with the following console output:
C:\Users\benn\Documents\swigwin-2.0.7\DeepFocusControl>cl.exe DeepFocusControl_wrap.cxx /I "C:\Program Files (x86)\Java\jdk1.6.0_29\Include" /I "C:\Program Files (x86)\Java\jdk1.6.0_29\Include\win32" /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Include" /I . /I "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" /link /DLL /OUT:DeepFocusControl_wrap.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
DeepFocusControl_wrap.cxx
DeepFocusControl_wrap.cxx(214) : error C2006: '#include' : expected a filename, found 'identifier'
DeepFocusControl_wrap.cxx(214) : fatal error C1083: Cannot open include file: '': No such file or directory
Looking at that line which gives the error (214) it is the line that include my header file (the middle one of the three below):
--
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
#include DeepFocusControlDll.h
#ifdef __cplusplus
--
I've put it in quotes and it compiles to then give 100s of compilation errors so I don't want to start editing the generated C code in case I'm causing further problems.
Can anyone let me knwo if I should be editing this or if I have made another mistake somewhere please?
Thanks.
Cheers,
Neil
--
Neil Benn MSc
Ziath Ltd
Phone: +44 (0) 1223 655577
http://www.ziath.com
Please consider the environment before printing this email.
Follow us on Facebook, Twitter or LinkedIn
IMPORTANT NOTICE: This message, including any attached documents, is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify Ziath Ltd immediately by email at info <at> ziath.com. Thank you.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
Swig-user mailing list
Swig-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
--
Neil Benn MSc
Ziath Ltd
Phone: +44 (0) 1223 655577
http://www.ziath.com
Please consider the environment before printing this email.
Follow us on Facebook, Twitter or LinkedIn
IMPORTANT NOTICE: This message, including any attached documents, is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify Ziath Ltd immediately by email at info <at> ziath.com. Thank you.