A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by pHySiQuE » Fri Sep 02, 2011 9:57 pm
I am compiling for a few different platforms. It's always easiest to just include the Newton headers and add the .cpp files to my projects, rather than building a library with Newton. Are there any macros I need to define if I do this? What header files do I need to include to build it successfully?
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Sat Sep 03, 2011 9:48 pm
you can just add all the files, and it should work without problems.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Sun Sep 18, 2011 3:29 pm
Which header files get included in my main project? I tried to include "core/dg.h", "newton/Newton.h", but I get a lot of compiler errors.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by Julio Jerez » Sun Sep 18, 2011 3:41 pm
you add all teh header in folder Core, Newton, and Physics
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by pHySiQuE » Sun Sep 18, 2011 4:35 pm
Shouldn't there just be one header file to include for each subfolder, like this?:
- Code: Select all
#include "../Source/Libraries/newton-dynamics/coreLibrary_200/source/core/dg.h"
#include "../Source/Libraries/newton-dynamics/coreLibrary_200/source/newton/NewtonClass.h"
#include "../Source/Libraries/newton-dynamics/coreLibrary_200/source/physics/dgPhysics.h"
I have added all the .cpp files into the project.
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by pHySiQuE » Sun Sep 18, 2011 6:09 pm
I added some preprocessor macros:
- Code: Select all
NDEBUG
_LIB
_WIN_32_VER
Now I get the following errors:
fatal error C1083: Cannot open include file: 'dgCompoundCollision.h': No such file or directory
error C2491: 'NewtonCreateCompoundBreakable' : definition of dllimport function not allowed
error C2491: 'NewtonCreateCompoundAproximation' : definition of dllimport function not allowed
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by pHySiQuE » Sun Sep 18, 2011 6:26 pm
I removed the file "dgVehicleConstraint.cpp" from my project and that got rid of one error.
The only remaining error is this:
newton.cpp(2915) : error C2491: 'NewtonCreateCompoundBreakable' : definition of dllimport function not allowed
I also get more than 300 warnings like this:
newton.cpp(2775) : warning C4273: 'NewtonConvexHullModifierGetMatrix' : inconsistent dll linkage
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by pHySiQuE » Sun Sep 18, 2011 7:27 pm
I have it compiling now. Here's a summary of what I did to get Newton 2.33 to build for Visual Studio 2008:
1. Add all .cpp files in "core", "newton", and "physics", except for "dgVehicleConstraint.cpp".
2. Add these macros to your project:
_WIN_32_VER
_NEWTON_USE_LIB
It should then work!
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests