Game Development Community

Compiling Problem

by Rodney (OldRod) Burns · in Torque Game Engine Advanced · 06/03/2004 (4:19 am) · 18 replies

VS 2003 .net, DX9SDK summer update, clean build, batch build with all selected:

The first few projects build ok, other than a few warnings here and there. Then it attempts to compile TSE Lib and I get this:

d3dx9.lib(d3dx.res) : fatal error LNK1241: resource file d3dx9.lib(d3dx.res) already specified

Build log was saved at "file://c:\Programming Projects\Tse\tse\lib\out.VC7.RELEASE\engine\BuildLog.htm"
TSE Lib - 1 error(s), 717 warning(s)

Almost all the warnings are complaints about something already being defined (various D3D stuff).

Is there some setting I'm missing here?

#1
06/03/2004 (10:36 am)
Curious. It builds great for me. Are you loading the main solution file, or are you loading the individual projects? Also, where did you stick the D3D libs?
#2
06/03/2004 (10:39 am)
Did you have some other version of the DXSDK installed? Maybe you are having include collisions between the two in your VC settings.
#3
06/03/2004 (2:59 pm)
I reinstalled the DXSDK to make sure I have the summer update. Still no luck. This is attempting to compile the entire TSE SDK solution. I first tried to just compile the demo, but the libs weren't compiled, so I attempted the entire sdk.

Is there a way to verify that the proper SDK is loading? I don't have any others installed, but in the past I've had 8.0 and 9.0 sdks on this machine.
#4
06/03/2004 (3:41 pm)
Ok, I just noticed that I had 2 sdk directories. Apparently when I reinstalled 9.0 this morning, it made a new folder and left the old one intact, which I think had 8.0 in it. I uninstalled 8.0 and cleaned/recompiled the full project. Now the demo compiles and runs, but map2dif and TSE lib still don't build (same error as above on TSE lib) and a missing engine.lib on map2dif, which I assume is the one I can't build?
#5
06/03/2004 (4:02 pm)
By default TSE looks for c:\DX90SDK\ if your DX9 SDK is somewhere else you will have problems compiling, unless you go into every single sub-project and change the Link reference from C:\DX90SDK\ to whatever is your DirectX 9 SDK directory
#6
06/03/2004 (8:40 pm)
I don't have my DX9 SDK installed there and my build worked fine. I do have the paths set up in my compiler, and that should be enough.

If you install multiple versions of the DX SDK, you're asking for bad things to happen. If you've multiple installed:
1) uninstall all versions
2)Reboot
3)clean up any remaining directories
4)Install the LATEST DX SDK (Summer Update 2003 right now)
5)Make sure the paths are set up properly in your compiler (lin & include)

Stay Casual,

Ken
DirectX MVP
#7
06/04/2004 (3:26 am)
Ok, here's the latest. I uninstalled the DXSDK and Visual Studio 2003, rebooted, reinstalled VS2003, rebooted (just to be safe :)) and installed the DX90SDK (summer update). Rebooted again.

Got fresh copy of TSE HEAD and compiled. 18 projects compile fine (with some conversion warnings here and there) but 4 failed.

Here are the 4 that failed:

------ Build started: Project: TSE Lib, Configuration: Release Win32 ------

(717 warnings of "xxxx already defined in xxxx; second definition ignored" clipped out)

d3dx9.lib(d3dx.res) : fatal error LNK1241: resource file d3dx9.lib(d3dx.res) already specified

TSE Lib - 1 error(s), 717 warning(s)

The debug version compiles ok, it's just the release version. These other 3 projects I think are failing because of the one above right?

------ Build started: Project: max2dtsExporter Max4, Configuration: Release Win32 ------

(7 warnings of "warning C4002: too many actual parameters for macro 'FN_0'" clipped)

LINK : fatal error LNK1181: cannot open input file "engine.lib"
max2dtsExporter Max4 - 1 error(s), 7 warning(s)

------ Build started: Project: max2dtsExporter Max3, Configuration: Release Win32 ------

LINK : fatal error LNK1181: cannot open input file "engine.lib"
max2dtsExporter Max3 - 1 error(s), 0 warning(s)

------ Build started: Project: map2dif, Configuration: Release Win32 ------

LINK : fatal error LNK1181: cannot open input file "engine.lib"
map2dif - 1 error(s), 0 warning(s)

So nobody else is having these problems?

I have clean installs of VS2003, DX90SDK, TSE. I checked the directories in VS2003 and they are pointing at the DX90SDK libs and includes.

What can I check next?
#8
06/04/2004 (5:20 am)
Have you moved your DX9 include and lib paths above the visual studio include and lib paths to ensure that DX9SDK is found before the included (and considerably older) version of the DX libraries and headers which ship with VS?
#9
06/04/2004 (2:05 pm)
Hey Ken, good to see you on here, don't see too many guys from the DIRECTXDEV list in these parts :)
#10
06/04/2004 (4:55 pm)
@Peter: yes they are at the top of the list in both the include and lib directory listings.
#11
06/04/2004 (5:25 pm)
Here's what MSDN says about this error:

==================================================
Linker Tools Error LNK1241
resource file "resource file" already specified

This error is generated if you run cvtres manually from the command line and if you then pass the resulting .obj file to the linker in addition to other .res files.

To specify multiple .res files, pass them all to the linker as .res files, not from within .obj files created by cvtres.
==================================================

If others are able to build with VS 2003 then I must have a setting messed up someplace for this to be happening
#12
06/05/2004 (4:14 pm)
Hate to bump this, but is anyone else getting this error? I looked all through the VS help files and googled and can't find a solution :(

The debug configuration of TSE Lib builds, but not the release version.
#13
06/05/2004 (7:02 pm)
@Brian: Thanks! I've been lurking for a long time. Hopefully I'll be having more time to be more active around here. If only I could get them to use Torque at my day job...

@Rodney: I did a clean checkout, and ran a Release build and other than some errors in the Max exporter, still no errors. For some reason it seems to be linking multiple times on your machine.

Since you have the DXSDK anyway, I'd recommend deleting the TSE/lib/directx (or whatever it's called). After you've done that do a Search (Start Menu -> Search) for d3dx9.lib and see if there are multiple copies laying around.

BTW, to clear up a number of warnings (~70) uncheck the libpng's dependancy on zlib, it's not needed.
#14
06/06/2004 (9:31 am)
@Rodney

What project are you compiling is it TSE_SDK or TorqueShaderEngine. If it is the latter, you are actually compiling the wrong project :oP
#15
06/06/2004 (12:05 pm)
@Ken: I deleted the \tse\lib\directx9 directory and then searched for an extra .lib. Found one off in a temp directory and deleted it. The only d3dx9.lib I have now is in my \dx90sdk directory. Cleaned and recompiled - same problem :(

@Peter: I'm compiling TSE Lib
#16
06/06/2004 (11:22 pm)
@Rodney

When you load the TSE SDK solution into VS2003 is Torque Shader Engine your default project?

If it isn't, set it as the default by using the right button menu.

If so go to the build menu and select clean solution. Now build Torque Shader Engine NOT TSE lib. This should build ok and produce a TSE executable in the examples directory.
#17
06/07/2004 (2:04 am)
Yeah, I'm getting the TSE Executable okay. It's always been the lib I've has trouble with. And that lib is used with map2dif and the exporters so they won't compile either (release only, debug compiles). It's not a big deal since the example compiles, but it's strange that it won't compile.
#18
06/07/2004 (8:12 am)
Make sure the release settings are the same as the debug settings.