so thus the logical choice is MSVC, surely microsoft can make a compiler that works for their own platform in some rudimentary fashion... well, seemingly at least.
so first things first, I go to coreLibrary_300\projects\windows\project_vs2013
and in this folder I find four vcxproj files, no solutions but w/e - don't need 'em.
anyway - I spot that there are what appears to be four separate vcxproj files.
ampPhysics.vcxproj
core.vcxproj
newton.vcxproj
physics.vcxproj
alright - let's build 'em, all are set to win32 release (not releaseDLL - static makes for a simpler distribution package, will use dynamic if that's the only supported but the default was debug and not debugDLL which implies a functional static library configuration).
this gives me core.lib, ampPhysics.lib, newton.lib, and physics.lib.
next I add these to my libraries folder, and specify them to be linked (tried both the additional dependencies and #pragma comment(lib, "") approach - it finds the libraries just fine either way, it just can't find the symbols within)
This is simple enough, time to build.
- Code: Select all
2>------ Build started: Project: protolib, Configuration: Release Win32 ------
2> protolib.cpp
2>protolib.cpp(121): warning C4244: 'argument' : conversion from 'double' to 'dFloat', possible loss of data
2>
2> Searching libraries
2> Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\msvcprt.lib:
2> Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\MSVCRT.lib:
2> Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\OLDNAMES.lib:
2> Searching C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib:
2> Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\msvcprt.lib:
2> Searching C:\lib\newton.lib:
2> Searching C:\lib\core.lib:
2> Searching C:\lib\Mondlicht.lib:
2> Searching C:\lib\ampPhysics.lib:
2> Searching C:\lib\physics.lib:
2> Searching C:\lib\lua51.lib:
2> Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\MSVCRT.lib:
2> Searching C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\OLDNAMES.lib:
2>
2> Finished searching libraries
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonCreateSphere
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonCreate
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonSetMemorySystem
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodySetUserData
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodyGetRotation
2>protolib.obj : error LNK2001: unresolved external symbol "class dMatrix __cdecl dGetIdentityMatrix(void)" (?dGetIdentityMatrix@@YA?AVdMatrix@@XZ)
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodySetForce
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonUpdate
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodyGetUserData
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonSetSolverModel
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodySetForceAndTorqueCallback
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodySetMaterialGroupID
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodySetMassProperties
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodySetTransformCallback
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonBodyGetMassMatrix
2>protolib.obj : error LNK2001: unresolved external symbol __imp__NewtonCreateDynamicBody
2>C:\Users\Thunder\Documents\projects\libproto framework\protolib\Release\protolib.exe : fatal error LNK1120: 16 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Alright, so that's not brilliant - from what I can tell it searches the libraries but it doesn't find any symbols within (I tried to build with just newton.lib but that didn't work so I added core, then physics, then ampPhysics to see if any of those had the symbols)
Notice how mondlicht.lib links cleanly (my fork of irrlicht) without error - unless newton is built with some combination of flags that must also be replicated on the destination project I'm quite at loss for why it's not linking, relevant steps to linking:
library directory:
C:\lib\
includes:
- Code: Select all
#include <dMathDefines.h>
#include <dQuaternion.h>
#include <dVector.h>
#include <dMatrix.h>
#include <Newton.h>
includes
- Code: Select all
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
//we're under some unix environment, put unix relevant preprocessor directives here if needed.
#else
#if defined(_WIN32)
//we're on windows, assuming visual studio - visual studio linkage is weird so we're doing it here.
//terrible design, btw. preprocessor should never need to know this but that's VS for you.
#pragma comment(lib, "newton.lib")
#pragma comment(lib, "core.lib")
#pragma comment(lib, "Mondlicht.lib")
#pragma comment(lib, "ampPhysics.lib")
#pragma comment(lib, "physics.lib")
#pragma comment(lib, "lua51.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#else
//not windows or unix, put custom options here ploxxors.
#endif
#endif
as for the rest of the code, it can be provided on request but I doubt it's a problem with the code - most of it is pretty standard.