I’m trying to get ofxBox2d from Github ( https://github.com/vanderlin/ofxBox2d ) to work with Visual C++ 2010 Express.
Since it may have been made for xCode I would like to ask:
Does it work for anyone?
Should it?
I get this error message which I cannot seem to fix:
[tt]1>c:\of_prerelease_v0070_vs2010\addons\ofxbox2d\lib\triangle\triangle_impl.hpp(365): fatal error C1083: Cannot open include file: ‘sys/time.h’: No such file or directory[/tt]
I think as long as the value is a constant integer, VCC is ok with it. I don’t have a windows computer, so I have no idea if this will work, but I think it might:
const int sz = v.size() - 1;
b2Vec2 verts[sz];
This might just be C and not C++, but if that array is at the class scope, i.e. you’re not doing it in the body of a method, I think you have to use the #define, like
Nope, didn’t work. I used to set it very high like at 1000, but I have no idea how this breaks the Triangle library.
It also only seems to happen on Visual C++, the code runs fine in Code Blocks.
Does anyone know what this does to the triangle code?
[quote=“joshuajnoble, post:7, topic:7806”]Does using 1000 break things for you or are you just worried that it will?
[/quote]
Not really, I just wanted to know if I should expect weird stuff to happen because of that value or if it is not a variable array size then would I eventually expect a memory leak or something of which I have no knowledge.
Any thoughts? =)
Not really, I just wanted to know if I should expect weird stuff to happen because of that value or if it is not a variable array size then would I eventually expect a memory leak or something of which I have no knowledge.
Any thoughts? =)
[/quote]
No worry. Even 32 will be enough cuz b2_maxPolygonVertices is defined as 32 and the array vertices[32] will be copied to b2PolygonShape::m_vertices[32] in shape.Set(verts, size()-1) function later. Since vertices[32] isn’t dynamically allocated, there is no worry for memory leak or other stuff.
I have also finally done creating an empty ofxBox2d project for Visual C++ Express 2010 yesterday.
Hi, I am trying to get this to work with VS10, got the sys/timeh error, tryed to #define NO_TIME & #define CYGWIN, but the I get stuck with this error:
openframeworks\addons\ofxbox2d\libs\triangle\dpoint.hpp(337): error C3861: 'MyAssertFunction': identifier not found
c:\users\paulo barcelos\lab\openframeworks\addons\ofxbox2d\libs\triangle\dpoint.hpp(336) : while compiling class template member function 'reviver::dpoint<NumType,D>::dpoint(void)'
with
[
NumType=double,
D=2
]
c:\users\paulo barcelos\lab\openframeworks\addons\ofxbox2d\libs\triangle\dpoint.hpp(615) : see reference to class template instantiation 'reviver::dpoint<NumType,D>' being compiled
with
[
NumType=double,
D=2
]
Does anyone have a clue what it could be? Or even better, woud it be possible for anyone to share a an empty, compiling, VS10 project? Would be a lifesaver…
Hi There ! @paulobarcelos not sure if you solved your problem but I ran into the same issue. I was able to get ofxBox2D to compile by commenting out all the lines with “assert”
really don’t remember what i did,anyway,here’s the vs2010 project. as far as i recall its not working with debug mode but fine with released. the easiest way is that you can created myApp folder within the apps folder,then put it there,should be working.
Thanks for the feedback @benMcChesney & @liquid!
I ended up not going for windows at all in the end… I was for the better…
The only reason I needed it was because I was using the Kinect SDK… so I ended up with 2 computers in my installation, a pc handling the kinect, connected via osc to a mac, where box2d and all the graphics were being processed.