Archived

This topic is now archived and is closed to further replies.

fatal error LNK1169: one or more multiply defined symbols found

This topic is 5013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a program that support Direct3D7-9,I use D3DX Utility Library in my program,and the library file for D3DX7 is d3dx.lib that D3DX9 is d3dx9.lib,when building,the following error is generated . [color=white] Linking... d3dx.lib(texture.obj) : error LNK2005: _D3DXCreateTexture@32 already defined in d3dx9.lib(d3dx9tex.obj) d3dx.lib(texture.obj) : warning LNK4006: _D3DXCreateTexture@32 already defined in d3dx9.lib(d3dx9tex.obj); second definition ignored Creating library Debug/d3dmoduled.lib and object Debug/d3dmoduled.exp d3dmoduled.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe.[/color] I can using d3d7 directly instead of d3dx7 utility library to resolve this problem.but I really want to know is there another way to resolve this problem?

Share this post


Link to post
Share on other sites
Well, you really arent supposed to have two sets of DX drivers running simultaneously. That said, ive never tried this me-self.
My guess is that every single function in the Direct X Extensions going to be redefined.
One option is to convert the functions that use DX7 libs to conform to DX9 specs... its usually a matter of adding a few NULLs here and there (at least for my app - i was goin dx8->dx9).
If you intentionally want to support D3D7 - D3D9, consider using a Bridge Pattern - its a perfect solution to this problem... (if youre unaware of it, just google).
Also, youll have to conditionally link to one of the libs (MSVC allows you to use #pragma "libname").
i hope something from this helps...

Share this post


Link to post
Share on other sites
You can''t link D3DX7 and D3DX9 in the same program; a number of the function share the same names, which is what gives rise to this error.

It may be possible to build DX7 support and DX9 support as seperate DLLs. If you do that, I *believe* the name collision problem disappears, because the DLLs (by default) won''t expose the D3DX functions to each other.

Share this post


Link to post
Share on other sites