First Project Linker Errors

First Project Linker Errors

Ritratto di brutalgt

Hi all, first I want to say it is great to finally be using Havok. I went with Bullet thinking it would be easier for a first time physics engine experience. After a few weeks of slamming my head against poor documentation, crappy demos and horribly broken character controllers, I had enough. I am adding Havok to my project now, but I am running into the same linker errors it seems a lot of people have initially. I am using the standalone demo for the setup, my libs are linked in exactly as the demo has them.

//==========================================================
1>hkpDynamics.lib(hkpWorld.obj) : error LNK2005: "public: void __thiscall hkpWorld::markForWrite(void)" (?markForWrite@hkpWorld@@QAEXXZ) already defined in btPhysicsManager.obj
1>hkpDynamics.lib(hkpWorld.obj) : error LNK2005: "public: void __thiscall hkpWorld::unmarkForWrite(void)" (?unmarkForWrite@hkpWorld@@QAEXXZ) already defined in btPhysicsManager.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>hkBase.lib(hkBaseSystem.obj) : error LNK2001: unresolved external symbol "public: static class hkProductFeatures * hkSingleton::s_instance" (?s_instance@?$hkSingleton@VhkProductFeatures@@@@2PAVhkProductFeatures@@A)
1>hkBase.lib(hkBaseSystem.obj) : error LNK2001: unresolved external symbol "public: __thiscall hkProductFeatures::hkProductFeatures(void)" (??0hkProductFeatures@@QAE@XZ)
1>hkSerialize.lib(hkBuiltinTypeRegistry.obj) : error LNK2001: unresolved external symbol "public: static class hkClass const * const * const hkBuiltinTypeRegistry::StaticLinkedClasses" (?StaticLinkedClasses@hkBuiltinTypeRegistry@@2QBQBVhkClass@@B)
1>hkSerialize.lib(hkBuiltinTypeRegistry.obj) : error LNK2001: unresolved external symbol "public: static class hkTypeInfo const * const * const hkBuiltinTypeRegistry::StaticLinkedTypeInfos" (?StaticLinkedTypeInfos@hkBuiltinTypeRegistry@@2QBQBVhkTypeInfo@@B)
1>C:\\Users\\Brett\\Desktop\\Factions Online\\build\\release\\client\\client.exe : fatal error LNK1120: 4 unresolved externals
//==========================================================

btPhysicsManager.h
//==========================================================
[code]
#ifndef __PHYSICS_MANAGER_H__
#define __PHYSICS_MANAGER_H__

#include

// Math and base include
#include
#include
#include
#include
#include
#include
#include

// Dynamics includes
#include
#include
#include
#include
#include

#include
#include

#include
#include
#include

#include
#include
#include

// Visual Debugger includes
#include
#include

static void HK_CALL errorReportFunction(const char* msg, void*)
{
printf("%s", msg);
}

namespace Brutal
{
class PhysicsManager : public Ogre::Singleton, public Ogre::FrameListener
{

public:

PhysicsManager();
~PhysicsManager();

static PhysicsManager& getSingleton();
static PhysicsManager* getSingletonPtr();

void init(Ogre::SceneManager *sceneMgr);
void deinit();

hkpWorld *getWorld();

// Visual Debugger
void registerVisualDebugger();
hkVisualDebugger *getVisualDebugger();

bool frameStarted(const Ogre::FrameEvent& evt);

void stepSimulation(float dt);
void stepVisualDebugger(float dt);

protected:

hkpWorld *mPhysicsWorld;
hkVisualDebugger *mDebugger;
hkpPhysicsContext *mContext;

hkJobThreadPool *mThreadPool;
hkJobQueue *mJobQueue;

bool mActive;
bool mDebuggerActive;
};
}

#endif //__PHYSICS_MANAGER_H__
//==========================================================

btPhysicsManager.cpp
//==========================================================
#include "btPhysicsManager.h"
#include "InputManager.h"

// Keycode
#include

using namespace Brutal;

template<> PhysicsManager* Ogre::Singleton::ms_Singleton = 0;

PhysicsManager::PhysicsManager()
{
mActive = false;
}

PhysicsManager::~PhysicsManager()
{
deinit();
}

PhysicsManager& PhysicsManager::getSingleton(void)
{
assert( ms_Singleton ); return ( *ms_Singleton );
}

PhysicsManager* PhysicsManager::getSingletonPtr(void)
{
return ms_Singleton;
}

void PhysicsManager::init(Ogre::SceneManager *sceneMgr)
{
// Initialize Havok Memory System
//-------------------------------
hkMemoryRouter *memoryRouter = hkMemoryInitUtil::initDefault(hkMallocAllocator::m_defaultMallocAllocator, hkMemorySystem::FrameInfo(500000));
hkBaseSystem::init(memoryRouter, errorReportFunction);

int totalNumThreadsUsed;

// Get the number of physical threads available on the system
hkHardwareInfo hwInfo;
hkGetHardwareInfo(hwInfo);
totalNumThreadsUsed = hwInfo.m_numThreads;

// We use one less than this for our thread pool, because we must also use this thread for our simulation
hkCpuJobThreadPoolCinfo threadPoolCinfo;
threadPoolCinfo.m_numThreads = totalNumThreadsUsed - 1;

// This line enables timers collection, by allocating 200 Kb per thread. If you leave this at its default (0),
// timer collection will not be enabled.
threadPoolCinfo.m_timerBufferPerThreadAllocation = 200000;
mThreadPool = new hkCpuJobThreadPool( threadPoolCinfo );

// We also need to create a Job queue. This job queue will be used by all Havok modules to run multithreaded work.
// Here we only use it for physics.
hkJobQueueCinfo info;
info.m_jobQueueHwSetup.m_numCpuThreads = totalNumThreadsUsed;
mJobQueue = new hkJobQueue(info);

// Monitors have been enabled for thread pool threads already (see above comment).
hkMonitorStream::getInstance().resize(200000);

// Initialize Physics World Settings
//----------------------------------
hkpWorldCinfo worldInfo;

worldInfo.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_MULTITHREADED; // Simulation Type to Multithread
worldInfo.m_broadPhaseBorderBehaviour = hkpWorldCinfo::BROADPHASE_BORDER_REMOVE_ENTITY; // Remove Objects that Leave the World

//standard gravity settings, collision tolerance and world size
worldInfo.m_gravity.set(0,-9.8f,0);
worldInfo.m_collisionTolerance = 0.1f;;
worldInfo.setBroadPhaseWorldSize(5000.0f);

//initialize world with created info
mPhysicsWorld = new hkpWorld(worldInfo);

//When the simulation type is SIMULATION_TYPE_MULTITHREADED, in the debug build, the sdk performs checks
//to make sure only one thread is modifying the world at once to prevent multithreaded bugs. Each thread
//must call markForRead / markForWrite before it modifies the world to enable these checks.
mPhysicsWorld->markForWrite();

//Register all collision agents
//It's important to register collision agents before adding any entities to the world.
hkpAgentRegisterUtil::registerAllAgents(mPhysicsWorld->getCollisionDispatcher());

//register physics world with job queue
mPhysicsWorld->registerWithJobQueue(mJobQueue);

//world no loger modified - unmark it
mPhysicsWorld->unmarkForWrite();

// Physics World is Active
mActive = true;
}

void PhysicsManager::deinit()
{
if(mActive)
{
mPhysicsWorld->markForWrite();
mPhysicsWorld->removeReference();

mDebugger->removeReference();

mContext->removeReference();

delete mJobQueue;

mThreadPool->removeReference();

hkBaseSystem::quit();
hkMemoryInitUtil::quit();

mActive = false;
}
}

hkpWorld *PhysicsManager::getWorld()
{
return mPhysicsWorld;
}

void PhysicsManager::registerVisualDebugger()
{
if(!mDebuggerActive)
{
// Create context for Visual Debugger
mContext = new hkpPhysicsContext();

//Reigster all the physics viewers
hkpPhysicsContext::registerAllPhysicsProcesses();

//Add physics world to context, so viewers can see it
mPhysicsWorld->markForWrite();
mContext->addWorld(mPhysicsWorld);
mPhysicsWorld->unmarkForWrite();

hkArray contexts;
contexts.pushBack(mContext);

//Create VDB instance
mDebugger = new hkVisualDebugger(contexts);
mDebugger->serve();

mDebuggerActive = true;
}
}

hkVisualDebugger *PhysicsManager::getVisualDebugger()
{
return mDebugger;
}

bool PhysicsManager::frameStarted(const Ogre::FrameEvent& evt)
{
if(mActive)
{
stepSimulation(evt.timeSinceLastFrame);
stepVisualDebugger(evt.timeSinceLastFrame);
}

return true;
}

void PhysicsManager::stepSimulation(float dt)
{
//step multithreaded simulation using this thread and all threads in the thread pool
mPhysicsWorld->stepMultithreaded(mJobQueue, mThreadPool, dt);

hkMonitorStream::getInstance().reset();
mThreadPool->clearTimerData();
}

void PhysicsManager::stepVisualDebugger(float dt)
{
if(mDebuggerActive)
{
//synchronize the timer data and step Visual Debugger
mContext->syncTimers( mThreadPool );
mDebugger->step();
}
}
//==========================================================

14 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di havokchrisk

Hey brutalgt,

It looks like you have two linker issues... missing symbols, and multiply-defined symbols. In the case of missing symbols (hkProductFeatures, StaticLinkedClasses, StaticLinkedTypeInfos), it looks like you are missing the following code section, which defines all of them (this should be placed somewhere in code used in your executable project):

#define HK_CLASSES_FILE 
#include 

This code can be found in SimpleMultithreadedConsoleMain.cpp for reference.

Regarding the multiply-defined symbols (markForWrite/unmarkForWrite), it looks like you are likely linking against Havok debug libraries, but HK_DEBUG is not defined (and, specifically, HK_DEBUG_MULTI_THREADING is not defined)... you can see the top of hkMultiThreadCheck.h where this gets set. You'll see in our debug config Demo projects that we define this macro in the 'Preprocessor Definitions' section, and doing the same for your project should fix this. Basically, what is currently happening is that you are linking against debug Havok libs which are built with a particular (debug) definition of markForWrite/unMarkForWrite (which is internal), but the release-config definition is getting set as something different in hkpWorld.inl... so the linker is getting confused.

Chris

Developer Support Engineer
Havok
www.havok.com

Ritratto di brutalgt

Thank you Chris, I did not even realize I was linking against the debug libraries as this is my release build.
I was able to build my release build now fine with no issues, but I am having issues with Debug. I defined HK_DEBUG in the preprocessor definitions, but I am getting

1>hkpDynamics.lib(hkpWorld.obj) : error LNK2005: "public: void __thiscall hkpWorld::markForWrite(void)" (?markForWrite@hkpWorld@@QAEXXZ) already defined in hkpCollide.lib(MeshShapeUnitTest.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>hkpCollide.lib(MeshShapeUnitTest.obj) : error LNK2001: unresolved external symbol "struct hkTestEntry * hkUnitTestDatabase" (?hkUnitTestDatabase@@3PAUhkTestEntry@@A)
1>hkpCollide.lib(MeshShapeUnitTest.obj) : error LNK2019: unresolved external symbol "class hkBool __cdecl hkTestReport(int,char const *,char const *,int)" (?hkTestReport@@YA?AVhkBool@@HPBD0H@Z) referenced in function "int __cdecl hkMeshShape_degenerate_test(void)" (?hkMeshShape_degenerate_test@@YAHXZ)
1>C:\Users\Brett\Desktop\Factions Online\build\debug\client\client.exe : fatal error LNK1120: 2 unresolved externals

Ritratto di brutalgt

*Edit*

sorry double posted

Ritratto di havokchrisk

This looks like you are mixing debug/release versions of Havok libs (I'd guess that hkpCollide is release, and hkpDynamics is debug)... this would also explan the other linker errors for missing symbols. Can you ensure that all Havok libs are of the same build config?

Chris

Developer Support Engineer
Havok
www.havok.com

Ritratto di brutalgt

Don't know how I made such stupid mistakes twice, especially since MSVC provides a very clear display of libs being linked, but ah well, thank you!

Ritratto di brutalgt

I have one more question, I am probably doing something else extremely
stupid but that seems to be a pattern ever since I started adding Havok.

I am debugging my application (because it crashed) and it is crashing when I create the hpkWorld.
First-chance exception at 0x00000000 in client.exe: 0xC0000005: Access violation.
Unhandled exception at 0x00000000 in client.exe: 0xC0000005: Access violation.

CALLSTACK
--------------------------------------
00000000()
client.exe!hkpWorld::hkpWorld(const hkpWorldCinfo & info={...}, unsigned int sdkversion=20100100) Line 3330 + 0xd bytes C++
client.exe!Brutal::PhysicsManager::init(Ogre::SceneManager * sceneMgr=) Line 106 + 0x37 bytes C++

I double checked everything else before it, and it looks like all of the ptr's are valid. I noticed that in hkpWorldCInfo object, that m_broadPhaseBorderBehavior has m_storage's value at some unidentifiable value. It says 2 but then it has an upside down L next to it (which I am bad at debugging but in my experience thats not a good thing)

Just incase I am doing something dumb again, here in my entire init() function.

void PhysicsManager::init()
{
    // Initialize Havok Memory System
    //-------------------------------
    hkMemoryRouter *memoryRouter = hkMemoryInitUtil::initDefault(hkMallocAllocator::m_defaultMallocAllocator, hkMemorySystem::FrameInfo(500000));
    hkBaseSystem::init(memoryRouter, errorReportFunction);

    int totalNumThreadsUsed;

    // Get the number of physical threads available on the system
    hkHardwareInfo hwInfo;
    hkGetHardwareInfo(hwInfo);
    totalNumThreadsUsed = hwInfo.m_numThreads;

    // We use one less than this for our thread pool, because we must also use this thread for our simulation
    hkCpuJobThreadPoolCinfo threadPoolCinfo;
    threadPoolCinfo.m_numThreads = totalNumThreadsUsed - 1;

    // This line enables timers collection, by allocating 200 Kb per thread.  If you leave this at its default (0),
    // timer collection will not be enabled.
    threadPoolCinfo.m_timerBufferPerThreadAllocation = 200000;
    mThreadPool = new hkCpuJobThreadPool( threadPoolCinfo );

    // We also need to create a Job queue. This job queue will be used by all Havok modules to run multithreaded work.
    // Here we only use it for physics.
    hkJobQueueCinfo info;
    info.m_jobQueueHwSetup.m_numCpuThreads = totalNumThreadsUsed;
    mJobQueue = new hkJobQueue(info);

    // Monitors have been enabled for thread pool threads already (see above comment).
    hkMonitorStream::getInstance().resize(200000);

    // Initialize Physics World Settings
    //----------------------------------
    hkpWorldCinfo worldInfo;

    worldInfo.m_simulationType = hkpWorldCinfo::SIMULATION_TYPE_MULTITHREADED; // Simulation Type to Multithread
    worldInfo.m_broadPhaseBorderBehaviour = hkpWorldCinfo::BROADPHASE_BORDER_REMOVE_ENTITY; // Remove Objects that Leave the World
    
    //standard gravity settings, collision tolerance and world size
    //worldInfo.m_gravity.set(0,-9.8f,0);
    //worldInfo.m_collisionTolerance = 0.1f;
    //worldInfo.setBroadPhaseWorldSize(5000.0f);

    //initialize world with created info //**CRASHING HERE**//
    mPhysicsWorld = new hkpWorld(worldInfo);

    //When the simulation type is SIMULATION_TYPE_MULTITHREADED, in the debug build, the sdk performs checks
    //to make sure only one thread is modifying the world at once to prevent multithreaded bugs. Each thread
    //must call markForRead / markForWrite before it modifies the world to enable these checks.
    mPhysicsWorld->markForWrite();

    //Register all collision agents
    //It's important to register collision agents before adding any entities to the world.
    hkpAgentRegisterUtil::registerAllAgents(mPhysicsWorld->getCollisionDispatcher());
    
    //register physics world with job queue
    mPhysicsWorld->registerWithJobQueue(mJobQueue);

    //world no loger modified - unmark it
    mPhysicsWorld->unmarkForWrite();

    // Physics World is Active
    mActive = true;
}

Ritratto di havokchrisk

Are you linking against debug Havok libs here? If not, I'd highly recommend doing so, as warnings/asserts will pop up and generate breakpoints which make it easier to identify bugs.

From the callstack, it looks like there might be a NULL function pointer that you are registering with Havok somewhere... perhaps the errorReportFunction? Since the crash happened after a few memory allocations, I'm assuming your allocator is working fine.

If any asserts pop up, those would help identify what's happening.

Chris

Developer Support Engineer
Havok
www.havok.com

Ritratto di brutalgt

Yeah, I am linked against the debug libs. I threw asserts in for every pointer that I have setup in the init() function and none of them popped. The was on top of stepping through the entire function with breakpoints.

This is what my output is looking like.

		hkpWorld::operator new returned	0x08fa6420	void *
		hkpWorldCinfo::BROADPHASE_BORDER_REMOVE_ENTITY	2	int
+		mPhysicsWorld	0xcdcdcdcd {m_simulation=??? m_gravity={...} m_fixedIsland=??? ...}	hkpWorld *
+		this	0x007eff40 {mPhysicsWorld=0xcdcdcdcd mDebugger=0xcdcdcdcd mContext=0xcdcdcdcd ...}	Brutal::PhysicsManager * const
+		worldInfo	{m_gravity={...} m_broadPhaseQuerySize=1024 m_contactRestingVelocity=1.0000000 ...}	hkpWorldCinfo
+		worldInfo.m_broadPhaseBorderBehaviour	{m_storage='' }	hkEnum

Since none of my pointers are NULL, my next guess is there is a setting that it wants from hkpWorldCinfo that I am not setting. Mine are the same as the standalone demo, but it seems to be the most likely, although this is a completely new API for me so I could be way off.

Ritratto di havokchrisk

It looks like hkpMultiThreadedSimulation_registerSelf() is likely not being called for some reason (in hkProductFeatures.cxx). Do you have the physics keycode setup properly in keycode.h, or is the 'HK_FEATURE_PRODUCT_PHYSICS' macro undefined? Are you including keycode.cxx somewhere?

Chris

Developer Support Engineer
Havok
www.havok.com

Ritratto di brutalgt

That did it Chris, I know it had to be something stupid I was missing. Thank you so much for your help mate, you are absolutely amazing.

Ritratto di Hamed E.

Hi
I have the same problem of multiply-defined symbols.I'm using vc2010 and havok free binary .
My core game engine is a static library and I want to build my program as debug multi threaded.I also added this macros to pre process definitions
HK_DEBUG
HK_CONFIG_SIMD=1
HK_DEBUG_MULTI_THREADING

I got 77 errors like these:

1>Main.obj : error LNK2005: "void __cdecl hkProductFeatures::initialize(void)" (?initialize@hkProductFeatures@@YAXXZ) already defined in FreeCamera.obj
1>Main.obj : error LNK2005: "char const * const HK_PHYSICS_KEYCODE" (?HK_PHYSICS_KEYCODE@@3QBDB) already defined in FreeCamera.obj
1>Main.obj : error LNK2005: "char const * const HK_ANIMATION_KEYCODE" (?HK_ANIMATION_KEYCODE@@3QBDB) already defined in FreeCamera.obj
1>Main.obj : error LNK2005: "char const * const HK_BEHAVIOR_KEYCODE" (?HK_BEHAVIOR_KEYCODE@@3QBDB) already defined in FreeCamera.obj

Why is it so hard to link havok to my game engine?

this is my source class:(its copy past of SimpleMultithreadedConsoleMain.cpp)


#pragma once

#ifndef __Havok_H__

#define __Havok_H__
/**************************************havok***************************************/
// Math and base include

#include 

#include 

#include 

#include 

#include 

#include 

#include 
// Dynamics includes

#include 

#include 

#include 

#include 

#include 					
#include 

#include 			
#include 

#include 

#include 	
#include 

#include 

#include 
// Visual Debugger includes

#include 

#include 				
// Keycode

#include 
#if !defined HK_FEATURE_PRODUCT_PHYSICS

#error Physics is needed to build this demo. It is included in the common package for reference only.

#endif
// This excludes libraries that are not going to be linked

// from the project configuration, even if the keycodes are

// present
#undef HK_FEATURE_PRODUCT_AI

#undef HK_FEATURE_PRODUCT_ANIMATION

#undef HK_FEATURE_PRODUCT_CLOTH

#undef HK_FEATURE_PRODUCT_DESTRUCTION

#undef HK_FEATURE_PRODUCT_BEHAVIOR

#undef HK_FEATURE_PRODUCT_NEW_PHYSICS

#define HK_FEATURE_REFLECTION_PHYSICS

#define HK_CLASSES_FILE 

#define HK_EXCLUDE_FEATURE_MemoryTracker

#define HK_EXCLUDE_FEATURE_SerializeDeprecatedPre700

#define HK_EXCLUDE_FEATURE_RegisterVersionPatches

#define HK_EXCLUDE_LIBRARY_hkGeometryUtilities

#include 
//#include 
#ifdef HK_PLATFORM_CTR

#define PRINTF nndbgDetailPrintf

#elif defined(HK_PLATFORM_ANDROID)

#include 

#define PRINTF(...) __android_log_print(ANDROID_LOG_INFO, "Havok", __VA_ARGS__)

#else

#define PRINTF printf

#endif
static void HK_CALL HavokerrorReport(const char* msg, void* userArgGivenToInit)

{

	printf("%s", msg);

}
#if defined(HK_PLATFORM_PS3_PPU)

#include 

#include 
// Set stack size to 1Mb on PS3

SYS_PROCESS_PARAM(1001, 1024*1024);

#endif
#if defined( HK_ATOM )

typedef struct {unsigned long field[4];} ADP_APPLICATIONID;

extern "C" ADP_APPLICATIONID ADP_DEBUG_APPLICATIONID;

extern "C" int __cdecl ADP_Initialize( void );

extern "C" int __cdecl ADP_IsAuthorized( ADP_APPLICATIONID );
ADP_APPLICATIONID applicationID = ADP_DEBUG_APPLICATIONID;
#include 

#include 

#endif

/************************
havok physic engine

**************************/

class CHavokPhysic :

	public IPhysicEngine

{

	DECLARE_SUPER(IPhysicEngine);

public:

	CHavokPhysic();

	~CHavokPhysic();
	void PlatformInit();

    void PlatformQuit();
	virtual void StepSimulation(float DT);//step the simulation
	virtual void SetPhysicalComponentTranslation(CPhysicComponent* C,vect3 *pos,Quat *rotation,vect3 *scale){};//set the position of component in the world

private:

	hkMemoryRouter* memoryRouter;

	hkVisualDebugger* vdb ;
	// : Register physics specific visual debugger processes

		// By default the VDB will show debug points and lines, however some products such as physics and cloth have additional viewers

		// that can show geometries etc and can be enabled and disabled by the VDB app.

		hkpPhysicsContext* context;
		//

		// Initialize the VDB

		//

		hkArray contexts;
		//

		// : Create the physics world.

		// At this point you would initialize any other Havok modules you are using.

		//

		hkpWorld* physicsWorld;
		hkJobQueue* jobQueue;
		//

		// Initialize the multi-threading classes, hkJobQueue, and hkJobThreadPool

		//
		// They can be used for all Havok multithreading tasks. In this exmaple we only show how to use

		// them for physics, but you can reference other multithreading demos in the demo framework

		// to see how to multithread other products. The model of usage is the same as for physics.

		// The hkThreadpool has a specified number of threads that can run Havok jobs.  These can work

		// alongside the main thread to perform any Havok multi-threadable computations.

		// The model for running Havok tasks in Spus and in auxilary threads is identical.  It is encapsulated in the

		// class hkJobThreadPool.  On PlayStation(R)3 we initialize the SPU version of this class, which is simply a SPURS taskset.

		// On other multi-threaded platforms we initialize the CPU version of this class, hkCpuJobThreadPool, which creates a pool of threads

		// that run in exactly the same way.  On the PlayStation(R)3 we could also create a hkCpuJobThreadPool.  However, it is only

		// necessary (and advisable) to use one Havok PPU thread for maximum efficiency. In this case we simply use this main thread

		// for this purpose, and so do not create a hkCpuJobThreadPool.

		hkJobThreadPool* threadPool;
};
#endif //__Havok_H__

Ritratto di Hamed E.

I solved it by moving these code from header to the cpp file:
// Keycode
#include

#if !defined HK_FEATURE_PRODUCT_PHYSICS
#error Physics is needed to build this demo. It is included in the common package for reference only.
#endif

// This excludes libraries that are not going to be linked
// from the project configuration, even if the keycodes are
// present

#undef HK_FEATURE_PRODUCT_AI
#undef HK_FEATURE_PRODUCT_ANIMATION
#undef HK_FEATURE_PRODUCT_CLOTH
#undef HK_FEATURE_PRODUCT_DESTRUCTION
#undef HK_FEATURE_PRODUCT_BEHAVIOR
#undef HK_FEATURE_PRODUCT_NEW_PHYSICS
#define HK_FEATURE_REFLECTION_PHYSICS
#define HK_CLASSES_FILE
#define HK_EXCLUDE_FEATURE_MemoryTracker
#define HK_EXCLUDE_FEATURE_SerializeDeprecatedPre700
#define HK_EXCLUDE_FEATURE_RegisterVersionPatches
#define HK_EXCLUDE_LIBRARY_hkGeometryUtilities
#include

//#include

#ifdef HK_PLATFORM_CTR
#define PRINTF nndbgDetailPrintf
#elif defined(HK_PLATFORM_ANDROID)
#include
#define PRINTF(...) __android_log_print(ANDROID_LOG_INFO, "Havok", __VA_ARGS__)
#else
#define PRINTF printf
#endif

static void HK_CALL HavokerrorReport(const char* msg, void* userArgGivenToInit)
{
printf("%s", msg);
}

#if defined(HK_PLATFORM_PS3_PPU)
#include
#include

// Set stack size to 1Mb on PS3
SYS_PROCESS_PARAM(1001, 1024*1024);
#endif

#if defined( HK_ATOM )
typedef struct {unsigned long field[4];} ADP_APPLICATIONID;
extern "C" ADP_APPLICATIONID ADP_DEBUG_APPLICATIONID;
extern "C" int __cdecl ADP_Initialize( void );
extern "C" int __cdecl ADP_IsAuthorized( ADP_APPLICATIONID );

ADP_APPLICATIONID applicationID = ADP_DEBUG_APPLICATIONID;

#include
#include
#endif

Ritratto di HavokTim

Hi Hamad E.-

Glad to hear that you solved this issue. Let me know if you encounter any other keycode problems.

--Tim

Accedere per lasciare un commento.