Using Windows XP, I tried to follow the README "To install PyBindGen,
issue the following commands" instructions but didn't get very far?
waf configure
seems to work fine (although I have multiple python versions and it
only seems o find one and not the one I want. For this issue I presume
I have to trudge throught the waf docs). However the last line is:
'configure' finished successfully (59.937s)
error: No such command '&'
It does that for EVERY waf command I issue from the command line?
It also says:
Checking for program python2.5-config : not found
Checking for program python-config-2.5 : not found
But I don't know if that is a problem or not?
waf
doesn't seem to do anything?
waf check
returns this mess:
Waf: Entering directory `F:\pybindgen-0.14.0\build'
[1/7] cxx: tests\foo.cc -> build\default\tests\foo_4.o
[2/7] command (${PYTHON}): tests\test-generation.py -> build\default\tests\test.cc
F:\pybindgen-0.14.0\pybindgen\cppclass_typehandlers.py:1088: UserWarning: Returning shared pointers is dangerous! The C++ API should be redesigned to avoid this situation.
warnings.warn("Returning shared pointers is dangerous!"
F:\pybindgen-0.14.0\pybindgen\module.py:167: DeprecationWarning: Duplicate call to write_preamble detected. Note that there has been an API change in PyBindGen and directly calling write_preamble should no longer be done as it is done by PyBindGen itself.
utils.write_preamble(code_sink)
[3/7] command (${PYTHON}): tests\foomodulegen.py -> build\default\tests\foomodule.cc
foo.cc
f:\pybindgen-0.14.0\tests\foo.h(482) : error C2146: syntax error : missing ';' before identifier 'FlowId'
f:\pybindgen-0.14.0\tests\foo.h(482) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(482) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(483) : error C2146: syntax error : missing ';' before identifier 'get_flow_id'
f:\pybindgen-0.14.0\tests\foo.h(483) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(483) : error C2086: 'int xpto::FlowId' : redefinition
f:\pybindgen-0.14.0\tests\foo.h(482) : see declaration of 'xpto::FlowId'
f:\pybindgen-0.14.0\tests\foo.h(483) : error C2146: syntax error : missing ')' before identifier 'flowId'
f:\pybindgen-0.14.0\tests\foo.h(483) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(483) : error C2059: syntax error : ')'
f:\pybindgen-0.14.0\tests\foo.h(724) : error C2146: syntax error : missing ';' before identifier 'word'
f:\pybindgen-0.14.0\tests\foo.h(724) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(724) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(727) : error C2146: syntax error : missing ';' before identifier 'low'
f:\pybindgen-0.14.0\tests\foo.h(727) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(727) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(727) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\pybindgen-0.14.0\tests\foo.h(840) : error C2065: 'uint32_t' : undeclared identifier
f:\pybindgen-0.14.0\tests\foo.h(931) : warning C4244: '+=' : conversion from 'double' to 'int', possible loss of data
f:\pybindgen-0.14.0\tests\foo.h(932) : warning C4244: '+=' : conversion from 'double' to 'int', possible loss of data
f:\pybindgen-0.14.0\tests\foo.h(1075) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
f:\pybindgen-0.14.0\tests\foo.h(1076) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
f:\pybindgen-0.14.0\tests\foo.h(1081) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
f:\pybindgen-0.14.0\tests\foo.h(1084) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
f:\pybindgen-0.14.0\tests\foo.h(1085) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
..\tests\foo.cc(442) : error C2065: 'uint32_t' : undeclared identifier
..\tests\foo.cc(444) : error C2079: 'get_set' uses undefined class 'std::set'
..\tests\foo.cc(445) : error C2065: 'uint32_t' : undeclared identifier
..\tests\foo.cc(445) : error C2133: 'rv' : unknown size
..\tests\foo.cc(445) : error C2512: 'std::set' : no appropriate default constructor available
..\tests\foo.cc(446) : error C2661: 'std::set<_Kty,_Pr,_Alloc>::set' : no overloaded function takes 1 arguments
..\tests\foo.cc(452) : error C2146: syntax error : missing ';' before identifier 'get_flow_id'
..\tests\foo.cc(452) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\tests\foo.cc(452) : error C2086: 'int xpto::FlowId' : redefinition
f:\pybindgen-0.14.0\tests\foo.h(482) : see declaration of 'xpto::FlowId'
..\tests\foo.cc(452) : error C2146: syntax error : missing ')' before identifier 'flowId'
..\tests\foo.cc(452) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\tests\foo.cc(452) : error C2374: 'xpto::get_flow_id' : redefinition; multiple initialization
f:\pybindgen-0.14.0\tests\foo.h(483) : see declaration of 'xpto::get_flow_id'
..\tests\foo.cc(452) : error C2059: syntax error : ')'
..\tests\foo.cc(453) : error C2143: syntax error : missing ';' before '{'
..\tests\foo.cc(453) : error C2447: '{' : missing function header (old-style formal list?)
..\tests\foo.cc(459) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
..\tests\foo.cc(471) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
..\tests\foo.cc(483) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
..\tests\foo.cc(495) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
..\tests\foo.cc(505) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
exception CannotBeConstructed cannot be constructed (no reason) in wrapper <pybindgen.function.Function object at 0x00EBD790>
exception CannotBeConstructed cannot be constructed (no reason) in wrapper public: CannotBeConstructed CannotBeConstructed::get_value ();
F:\pybindgen-0.14.0\pybindgen\cppclass_typehandlers.py:1088: UserWarning: Returning shared pointers is dangerous! The C++ API should be redesigned to avoid this situation.
warnings.warn("Returning shared pointers is dangerous!"
Waf: Leaving directory `F:\pybindgen-0.14.0\build'
Build failed
-> missing file: 'F:\\pybindgen-0.14.0\\build\\default\\tests\\foo_4.o'
gccxml not available; skipping the C hello demo
Where most of the problems seems to involve uint32_t?
This can be solved by telling people they have to download pstdint.h
from http://www.azillionmonkeys.com/qed/pstdint.h, renaming it to
stdint.h, and copying it to their C:\Program Files\Microsoft Visual
Studio 9.0\VC\include directory. Of course the appropriate files then
need to #include <stdint.h>
Once I added #include <stdint.h> to foo.h, then things seemed to work
other then lots of warnings about risky type conversions and lots of
the following:
f:\pybindgen-0.14.0\tests\foo.h(1076) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
waf --examples
doesn't seem to do anything??
waf install
Installs to python25 but I really want to install to python26?
I took a look at the tutorial files in first-example.zip, but those
are specifically targeted at gcc. Nothing there for Visual Studio 2008
users.
There seem to be several issues and questions being reported in a single bug report:
1. MSVC does not have <stdint.h>
-> I will add your instructions, check for the include, and include it in the unit test header.
2. Yes, 'waf' does not do anything, because Python code does not need to be compiled, and bytecode compilation is a post-install thing (runs on waf install)
3. On waf check, the pybindgen warnings are normal, but the compilation warnings are not expected. Although I have not tested in MSVC in a very long time, so I am not surprised. That specific warning that remained after you resolved the stdint issue seems to be a MSVC shortcoming [1]; I am not going to cripple my code just to please MSVC, sorry.
4. Regarding the installation to the wrong python version, WAF decides to install python files to the default python site-packages. "Default python" means whatever python is found in PATH first by trying to run the 'python' system command. If you want to install to a different python, you need to set the PYTHON environment variable to the exe of the python you wish to select. My batch skills are rusty, but I would guess something like "set PYTHON= C:\python26" , before running waf configure. If you have problems, just manually copy the tree, as is mentioned in the README.
[1] https:/ /issues. apache. org/activemq/ browse/ AMQCPP- 19?focusedComme ntId=37615& page=com. atlassian. jira.plugin. system. issuetabpanels: comment- tabpanel# action_ 37615