ofxBox2D not compiling

I´ve downloaded vanderlin box2D addon without succes.

I´ve tryed the stable and the master version from this link :

Im running in Openframeworks version : 0.9.8
This are the errors that im getting :

Severity	Code	Description	Project	File	Line	Suppression State
Warning	C4002	too many actual parameters for macro 'assert' (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2d.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\dpoint.hpp	477	
Warning	C4002	too many actual parameters for macro 'assert' (compiling source file src\main.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\dpoint.hpp	477	
Error	C2131	expression did not evaluate to a constant (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2d.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	115	
Error	C2131	expression did not evaluate to a constant (compiling source file src\main.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	115	
Error	C3863	array type 'int [n]' is not assignable (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2d.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	129	
Error	C3863	array type 'int [n]' is not assignable (compiling source file src\main.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	129	
Warning	C4002	too many actual parameters for macro 'assert' (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2dEdge.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\dpoint.hpp	477	
Error	C2131	expression did not evaluate to a constant (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2dEdge.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	115	
Error	C3863	array type 'int [n]' is not assignable (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2dEdge.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	129	
Warning	C4002	too many actual parameters for macro 'assert' (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2dPolygon.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\dpoint.hpp	477	
Error	C2131	expression did not evaluate to a constant (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2dPolygon.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	115	
Error	C3863	array type 'int [n]' is not assignable (compiling source file ..\..\..\addons\ofxBox2d\src\ofxBox2dPolygon.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	129	
Warning	C4002	too many actual parameters for macro 'assert' (compiling source file ..\..\..\addons\ofxBox2d\libs\triangle\del_impl.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\dpoint.hpp	477	
Warning	C4996	'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. (compiling source file ..\..\..\addons\ofxBox2d\libs\triangle\del_impl.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\triangle_impl.hpp	12540	
Warning	C4996	'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. (compiling source file ..\..\..\addons\ofxBox2d\libs\triangle\del_impl.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\triangle_impl.hpp	15378	
Warning	C4996	'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	example_EdgeShape	C:\Users\Julian\Downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxBox2d\libs\triangle\del_impl.cpp	98	
Warning	C4002	too many actual parameters for macro 'assert' (compiling source file src\testApp.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\libs\triangle\dpoint.hpp	477	
Error	C2131	expression did not evaluate to a constant (compiling source file src\testApp.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	115	
Error	C3863	array type 'int [n]' is not assignable (compiling source file src\testApp.cpp)	example_EdgeShape	c:\users\julian\downloads\of_v0.9.8_vs_release\of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h	129	

I´ve tryed with different examples, no succes with none of them. What could be the problem?
Anyone has a working version for it or at least a Box2D working version?

1 Like

can you try using the stable branch ?

Yes, i´ve already tryed stable version without succes.

hey man, i have a completely same problem

I am not sure but have you posted an issue on the addon?

also, does this discussion help ?

https://github.com/vanderlin/ofxBox2d/issues/116

If I have a problem with an addon I usually post there first since it’s the best way to get get the attention of the addon author.

fix the code of file “of_v0.9.8_vs_release\addons\ofxbox2d\src\ofxBox2dPolygonUtils.h”

line 115

int mk[n];

to

int* mk = new int[n];

then it will work

7 Likes

It worked for me! (VS 2017 - oF v0.9.8)
Thank you @larchrono! :slight_smile:

It worked
thk

Brilliant! Thank you so much!