Please help! frustrated with many different compile errors.

Please help! frustrated with many different compile errors.

Hi everyone,

First of all I'm new to this community, but I've already had the chance to read alot of other posts while trying to fix all my compile errors. I'd just like to say that everyone here seems really awesome compared to other forums I've seen.

That being said, heres the problem I'm encountering:

I'm basically just trying to compile the standalone console app that was provided as a demo, but integrated with openGL. I'm sure that my openGL code is not the problem, as the regular console app won't compile either. I'm currently using MS VC++ 2003.net.

After including all the source and libs. I get these pretties:

Havok FiZiXSourceCommonBaseThreadCriticalSectionWin32hkWin32CriticalSection.inl(27) : error C3861: 'InitializeCriticalSectionAndSpinCount': identifier not found, even with argument-dependent lookup
Havok FiZiXSourceCommonBaseThreadCriticalSectionWin32hkWin32CriticalSection.inl(88) : error C3861: 'TryEnterCriticalSection': identifier not found, even with argument-dependent lookup

After reading some posts, I found that someone mentioned adding WINVER=0x500 and _WIN32_WINNT=0x500 to the preprocessor definitions. Certainly this seems to "work", but in turn provides new errors:

havok fizixfizix.cpp(460) : warning C4793: native code generated for function 'Update': 'aligned data types not supported in managed code'
havok fizixfizix.cpp(460) : error C2349: 'Update' cannot be compiled using /clr: 'functions containing both copy constructed arguments and inline asm are not supported'; compile without /clr

and MSDN told me to turn off my /clr ... so I disabled my Use Managed Extensions (which just didn't seem right) and got something that seems a whole lot worst:

hkBase.lib(hkSweptTransformClass.obj) : warning LNK4078: multiple '.CRT' sections found with different attributes (40300040)
hkpDynamics.lib(hkpGenericConstraintData.obj) : error LNK2019: unresolved external symbol __ftol2_sse referenced in function "protected: void __thiscall hkpGenericConstraintData::setLinearMotorW(int * &,class hkVector4 * &,class hkpGenericConstraintDataScheme &,class hkpGenericConstraintDataParameters &,class hkpConstraintQueryIn const &,class hkpConstraintQueryOut &)const " (?setLinearMotorW@hkpGenericConstraintData@@IBEXAAPAHAAPAVhkVector4@@AAVhkpGenericConstraintDataScheme@@AAVhkpGenericConstraintDataParameters@@ABVhkpConstraintQueryIn@@AAVhkpConstraintQueryOut@@@Z)
hkpUtilities.lib(hkpPulleyDrawer.obj) : error LNK2001: unresolved external symbol __ftol2_sse
hkBase.lib(hkStreamStatisticsCollector.obj) : error LNK2001: unresolved external symbol __ftol2_sse
hkBase.lib(hkMonitorStreamAnalyzer.obj) : error LNK2001: unresolved external symbol __ftol2_sse
Havok FiZiXDebugHavok FiZiX.exe : fatal error LNK1120: 1 unresolved externals

Basically, I'm not sure where I went wrong. I was really excited about using Havok and I'm facing alot of frustration now = . I hope I'm not just being incompetent, I kinda feel like I'm missing something with the 2003, because at work I was able to compile this with my VC++ 2005 during my lunch break.

Any help would be greatly apprectiated!!!

Thanks,

m1r4g3


5 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hi

First of all you could try compiling with the /clr option, but wrapping any Havok code and includes in #pragma unmanaged / #pragma managed. (This would solve "error C2349: 'Update' cannot be compiled using /clr".)
Your second problem ("multiple '.CRT' sections found") could be this same problem I had (see "Linking statically to Havok" thread and use the /NODEFAULTLIB linker option to remove unwanted libs).
Your third problem ("unresolved external symbol __ftol2_sse") is caused, I think, by the fact that Havok libs were build using VS2005, which implemets ftol() with Intel supplied __ftol2_sse function (see http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/d9e8ad86-1677-46...).
You could just provide your own implementation of ftol(). In the thread I gave link to you have some asm as a reference, a bit of it here:

_ftol2_sse:

00965A10 cmp dword ptr [___sse2_available (9F83BCh)],0

00965A17 je _ftol2 (965A46h)

So you could just try to make this:

_ftol2_sse:

00965A17 jmp _ftol2 (965A46h)

Provided that you would be able to find _ftol2.

Try also this thread: http://www.adobeforums.com/webx/.3c0533b5
Especially the part that tell to include this in your code:
extern "C" {
long _ftol( double );
long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
}

So I tried everything you mentioned, the wrapping seems to get rid of the /clr problem and leaves me with the multiple '.CRT' warning, which won't seem to go away (even with your /NODEAULTLIB trick).

Second, I added

extern "C" {

#include
#include

int _stat32( const char *path, struct _stat *buffer ) { return _stat(path, buffer); }
int _wstat32( const wchar_t *path, struct _stat *buffer ) { return _wstat(path, buffer); }
long _ftol( double );
long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }

}

As recommended on that forum you pointed me to. It took away the errors corresponding to _ftol2_sse and replaced it with this lovely gem:

hkBase.lib(hkSweptTransformClass.obj) : warning LNK4078: multiple '.CRT' sections found with different attributes (40300040)
hkBase.lib(hkArray.obj) : fatal error LNK1000: unknown error; consult documentation for technical support options

... anyone have any more recommendations on how to solve this? I know LNK1000 isn't exactly very descriptive.

At this point, would it be better for me to just get VC++ 2005? and would that guarantee that I wouldnt have these problems anymore?

Nevermind! I found out that I could get a free version of vs.net 2005 from my university.

Downloaded, installed and havok is compiling fine =D ... 2003 just seems to have alot of problems

Thanks for the help though! ;) can't wait to start making a game environment

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi