Closed sphaero closed 3 years ago
It could be an include order. In general, I've had to either include dummy structs so SWIG has something before doing the %include later on or simply %including certain headers earlier. You can see the early stuff listed in main.i. You could try commenting out the %ignore ofDefaultVec2;
lines to see if that helps.
One useful approach to deep stuff like this is to examine the generated C code and do some manual experimentation there to get it to build, then see if you can get SWIG to generate similar code.
I use swig-openframeworks to generate the Lua bindings for ofxLua, so I'm not very much help outside of general SWIG usage. The best person to loop in would be @chaosct who worked on ofxPython some years ago.
Also, try make openFrameworks-symbols
or make glm-symbols
to generate a text file with the wrapped classes & symbol names. This is helpful in finding out if SWIG is finding everything or not.
Thanks for all suggestions. I'm quite new to swig so bare with me. I'll see what I can find out where I find time. For now; the make openFrameworks-symbols errors:
make openFrameworks-symbols
swig -c++ -lua -O -small -debug-lsymbols -I../../openframeworks/libs/openFrameworks -DMODULE_NAME=of -DOF_SWIG_RENAME openFrameworks.i > of_lua_symbols.txt
../../openframeworks/libs/openFrameworks/utils/ofXml.h:148: Warning 509: Overloaded method ofXml::removeAttribute(ofXml::Attribute &&) effectively ignored,
../../openframeworks/libs/openFrameworks/utils/ofXml.h:147: Warning 509: as it is shadowed by ofXml::removeAttribute(ofXml::Attribute const &).
rm -f *.cxx
if [ lua == "python" ]; then rm -f *.py; fi
/bin/sh: 1: [: lua: unexpected operator
Not sure what platform you're targetting but on my the commands are issued by /bin/sh which doesn't support '=='. For me replacing them with '=' fixes it.
just opened #20 which fixes it for me
Fixed via #20.
When I import openframeworks I get errors which imply somethings are not yet defined but already referenced:
Commenting that line:
commenting that line:
OF_PRIMITIVE_TRIANGLE_STRIP gets defined at line 3346