Updating from 2011_3_0_r1 to 2011_3_1_r1: unresolved external symbol

Updating from 2011_3_0_r1 to 2011_3_1_r1: unresolved external symbol

I updated from version 2011_3_0_r1 to 2011_3_1_r1, and I started getting an error:

error LNK2001: unresolved external symbol "struct hkQuadReal const * const g_vectorConstants" (?g_vectorConstants@@3QBUhkQuadReal@@B)

I tried adding and switching libraries, but I always get that same error (both in debug_multithreaded and release_multithreaded builds). If I switch back to 2011_3_0_r1 it builds again.
Any ideas?

12 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
havok_josh的头像

hey mona2001-I think something declared in one of the header files from your project (originally based on the 2011_3_0_r1 build references some symbol that is no longer defined in the new libs. I am not sure exactly what you did so I can only give you very general feedback, but I think you want to make sure you update both your headers and your libs to the new 2011_3_1_r1 files. Let me know how it goes.-Josh

Josh Developer Support Engineer Havok www.havok.com

Hi josh,

The symbol in question (g_vectorConstants) is used in many of the .inl files from 2011_3_1_r1, so I'm pretty sure it's not a missing symbol issue.
What bugs me is that i compared the 2011_3_0_r1 and 2011_3_1_r1 source files with WinMerge and the changes to the headers are minimal - nothing that could cause my problem. I suspect the issue is somehow related with the libraries, but I tried everything from linking libraries I don't even need to trying every possible link order - all to no avail.
I really doubt it's a bug on the Havok part, since no one else complained about it, but I don't really know what to try any more.

Mona

HavokNick的头像

Hi Mona,

After switching fromversion 2011_3_0_r1 to 2011_3_1_r1 have you
performed a full rebuild?

-Nick

Nick S. Developer Support Engineer Havok www.havok.com

Yes.
I tried a full rebuild, cleaning the project and even removing all object files by hand. Unfortunately none of those steps helped.

Mona

HavokNick的头像

Hi Mona,

What version of 2011_3_1_r1 did you
download, the version with SIMD or the one without? From the linker
erroryou are getting it looks like you are using a version of 2011_3_0_r1
Without SIMD. If this is correct and youhappened to grab 2011_3_1_r1 With
SIMD that might be causing your problem.

Otherwise, if that isn't the issue,
there might be a discrepancy between the libraries and headers with which
youare linking. If you could explain to me in detail how you are
extracting 2011_3_1_r1 as well as how you are linkingto its libraries and
header files, we might be able to rule out possible errors.

-Nick

Nick S. Developer Support Engineer Havok www.havok.com

Indeed, I downloaded the version with SIMD. My project is built with SIMD support, because it's fairly heavy on floating point computations and requires high performance. Unless there's something I'm missing, I think Havok with SIMD is the one I should be using, but maybe I misunderstood what you're trying to tell me.
As for the second question, I'm extracting the entire contents of the archive and updating the library/include paths to point to it. I included the .h files like the documentation told me to (i.e. Collide\hkpCollide.h before Collide\somethingelse). KeyCode.cxx and hkProductFeatures.cxx are included from one of my .cpp files, and that's pretty much it. This setup worked fine with 2011_3_0_r1, do I maybe need to change something specific for the SIMD build?

HavokNick的头像

Hey Mona,

I've been having difficulties
reproducing your linking error. This seems like a fairly unique issue, and I'd
like to get you a fix as soon as I can. In the meantime, could you give me a
detailed, step-by-step explanation as to how you are going about updating your
libraries and headers? Even things as simple as how you are linking in VS might
help me reproduce your problem. Also, please let me know what version of VS you
are using.

-Nick

Nick S. Developer Support Engineer Havok www.havok.com

Hi Nick,

turns out i was missing a define (HK_CONFIG_SIMD=HK_CONFIG_SIMD_ENABLED), because by default SIMD is disabled on x86 platforms, even if the package is labeled as SIMD (perhaps a mistake?). Now it works great.

Thank you again anyway, it's nice to see that even free products get great support!

Mona

That worked for me too. Thanks. AlsoHK_CONFIG_SIMD=1 works.

Sorry to breath life back in to this thread but where exactly do you put that define? (i.e. HK_CONFIG_SIMD=HK_CONFIG_SIMD_ENABLED)

I am getting the same error but adding that definition doesn't seem to help, possibly missing an include?

HavokTim的头像

Hi Will--

I don't have information about where these users put this #define, but the variable is typically defined in hkConfigSimd.h. I suggest #defining this value before any Havok header (or even as a Preprocessor Definition in the Project Properties dialog). Please let me know if this fixes your issue. Thanks!

--Tim

登陆并发表评论。