Game Development Community

How to compile Torque w/ MinGW & Dev-C++... (not finished)

by Garth "Ironstorm" Dahlstrom · in General Discussion · 10/06/2002 (9:53 pm) · 20 replies

Hi all,

I've been trying to build Torque with MinGW & Dev-C++ on
Windows... I've made some progress, but I've gotten stuck
at the including -lljpeg and those libs... anyway, perhaps
someone will know how to continue by following my steps...

Here's what I did:
1) Check-out the HEAD branch of Torque

2) Download and install
Dev-C++ 4.9.6.1 www.bloodshed.net/dev/
use "Tools->Check for updates" and apply the Dev-C++
patches

3) Use "Tools->Editor Options" on:
3.1) "General Tab" append ";cc" to the list of "use syntax highlighting"
3.2) "Class browsing" tab uncheck "Enable class browsing"
3.3) hit Ok

4) Use "File->Import->Import MS Visual C++ Project"
Select Torque/vc6/Torque Demo.dsp, select Release
as the configuration to import.

5) hit Alt+P to open the project options, append
" -fvtable-thunks" to the end of the list in the compiler
options field

6) Next go through the list of project files on the left
hand side and "right click->remove file" on each file
ending with the .asm extension... these are assembler
files that will give errors if Dev-C++ trys to build them.

I think the files to remove are the following:
blender_asm.asm
itfdump.asm
mMathAMD_ASM.asm
mMathSSE_ASM.asm
mMath_ASM.asm
platformCPUInfo.asm

(I might have missed one or two so scan over the list)


Now you will be start compiling and you should get to where
I am stuck...

"Torque Demo.exe" -L"C:/Dev-Cpp/lib" -L"../lib/out.VC6.RELEASE" -lCOMCTL32 -lCOMDLG32 -lUSER32 -lADVAPI32 -lGDI32 -lWINMM -lWSOCK32 -lljpeg -llpng -llungif -lzlib -lvfw32 -I"C:/GNU/Dev-Cpp/include" -I"C:/GNU/Dev-Cpp/include/g++-3" -I"C:/GNU/Dev-Cpp/include" -I"../lib/directx8" -I"../lib/zlib" -I"../lib/lungif" -I"../lib/lpng" -I"../lib/ljpeg" -I"../lib/openal/win32" -I"../engine" -D__GNUWIN32__ -fvtable-thunks -s

C:\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\2.95.3-6\..\..\..\..\mingw32\bin\ld.exe: cannot find -lljpeg

make.exe: *** ["Torque] Error 1

Execution terminated


I'm guessing I am to import and compile each of the VC6
projects in torque/vc6 that match ljpeg lpng... but I'm
a bit confused as to how to make them satisfy ld... i.e
do I set them to compile "static libs" and then override
their names so they match that expected by the linker
(which should be what)...

Please post ideas for me to try next... thanks!

-GED

#1
10/07/2002 (10:25 am)
Did you cd to lib/ and build the libraries with make?
#2
02/14/2003 (10:35 pm)
I've been trying to get this working too - I admit I have no idea how to compile .exe files though. My only experience thus-far is scripting with Tribes 2.
#3
02/14/2003 (10:41 pm)
I did eventually get it working with MinGW, just not with the Dev C++ ide...

Look at:
http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=7526
for details
#4
02/14/2003 (11:15 pm)
I would still like to use dev-C++ though because it looks cool and is free. Unlike all the warezed versions of VC6++ which I assume are being used.
#5
02/14/2003 (11:38 pm)
The problem I have had is Dev-C++ crashes when trying to add all the files for Torque it seems to work for small projects but on large projects like Torque it is EXTREMELY slow and crashes alot.

I gave up on it . . .
#6
02/14/2003 (11:55 pm)
It used to crash a lot, but now it works fine and even imports the VC6 project file properly, only missing one file "OpenAL.h".

I am good at tirelessly trying various combinations for hours as long as I know whatever I am trying to do is possible. But I do not know anyone who has compiled a Torque Demo.exe
#7
02/15/2003 (8:51 am)
> It used to crash a lot, but now it works fine and even imports the VC6 project file properly,
> only missing one file "OpenAL.h".
>
> I am good at tirelessly trying various combinations for hours as long as I know whatever I am
> trying to do is possible. But I do not know anyone who has compiled a Torque Demo.exe

Well, Dev-C++ may have improved since I was trying in Oct last year... so it's quite possible you could get it going now a days if the support has improved that much...
#8
02/15/2003 (8:53 pm)
I like the update feature in Devc++, it downloads all the directx libs and language packs, helpers etc. pretty nice all very easy to use.

the only bug I have seen in it so far is compiling a big project with no makefile causes an error, but you can still continue.

the problems I am having with torque is mainly that I can not get the jpeg.lib to include properly, once I get past that I am sure there will be more problems, but that one seems the most prominent at the moment.. since I have no real idea I just add folders to my project all over the place and try to reduce the amount of errors.
#9
02/16/2003 (9:12 am)
Please move this thread to Private SDK.

Jeff Tunnell GG
#10
02/17/2003 (8:02 am)
hey the easiest way to get VC++ is to buy the Game Developement Starter Kit....from McMillan i believe...costs like $40

it actually contains a version of VC++ 6 and a printed book on game development ideas..plus the ebook tricks of windows gurus....
#11
02/17/2003 (4:34 pm)
but dev-c++ is free, it uses mingW, so I expect it can be used.
and there is no point using something for $40 when you can use something else for free - Dev-C++ is pretty good with a built in update system and nice GUI.
#12
12/27/2003 (1:40 pm)
[i]$ make -f mk/configure.mk OS=WIN32 COMPILER=GCC2 BUILD=RELEASE
make: mk/configure.mk: No such file or directory
make: *** No rule to make target 'mk/configure.mk'. Stop.[i/]

This is what I get when inserting the code provided in the forums(?)


Aerny
#13
12/27/2003 (3:07 pm)
Aerny,

Make sure you are running that from the torque directory.
(aka the folder which has the mk folder in it)
#14
01/05/2004 (1:51 pm)
So --- did someone build TGE with Dev-C++?

Regards,
Dirk
#15
01/05/2004 (2:55 pm)
I never did
#16
01/06/2004 (12:49 am)
I'm currently cross-compiling on Linux, for win32 with legends, and it seems to work fine. However I'm not familiar with DevC++'s project file configuration etc, I just use the normal makefiles.

From what I can see is that the linker complains about being unable to find "ljpeg.a"

Under the torque tree structure you will find a lib/ directory, all the libraries in that subdirectory needs to be compiled too, so you may have to create a project file for them, if they're not already in your project.

Once they're built, they should end up in a lib/out.GCC2 or lib/out.GCC3 depending on the version of mingw you're using and your output directory configuration.

You will have to make sure that your project settings (linker options) include ../lib/out.GCC2 so that the linker can find ljpeg.a and friends there.

This is not the same as an -I (include) directive. You need a -L../lib/GCC2 directive somewhere along all your other linker directives.

Like I said, I dunno much about DevC++ but it's pretty obvious what ld (the linker) is complaining about. It can't find the ljpeg.a and other torque library files.

Hope this helps.
#17
01/06/2004 (10:55 am)
Well, I just compiled it with VC6 and it worked without any trouble. I just wonder if there is an OpenSource soulution available - and Roelf, you found one that is cross compatible? How did you set it up?
#18
01/07/2004 (1:37 pm)
OK, I know this is hideously late, but the version of VC++6 that comes with the Game Development Starter Kit is the Introductory Version, and has a clause in the EULA saying that this is for education purposes and is not to be used for the development of commercial applications. Just one more reason an open source/freeware option would be nice.
#19
01/07/2004 (6:09 pm)
I have managed to create a project file for the Torque demo (release) under Dev-C++ 4.9.8.5 This is for the game executable only. I already had the libraries compiled. Here is a summary of what I did. Be warned, however, this is probably not the optimal way since I am at best an advanced beginner.

I already had Mingw and Msys configured and was using that successfully to build Torque. Instead of attempting to build the project with Dev-C++'s Mingw, I reconfigured the IDE to use my current Mingw and Msys.

The Import From Visual C++ Project feature has always crashed for me, so I created a new project and added the files using the existing makefiles as a guide. Also had to configure the include directories, and compiler and linker switches. The linker command line also needed to list the specific library files such as ljpeg.a Each assembly file had to be configured separately to use NASM.

Some disadvantages:
There doesn't seem be a simple release/debug switch or option sets in the project options. So it might be simpler to have separate project files for release and debug.
Because there is no project or makefile import, each change to the project in CVS has to be manually changed in Dev-C++.

If someone else has had success with Dev-C++ and has pointers on how to this better I would appreciate it.
#20
01/09/2004 (5:35 am)
Like I said, I just use the makefiles with MingW, but Dev-C++ should be able to do the same. It just invokes MingW to do the compilation.

Unfortunately I've never worked in DevC++ but I can't imagine that it would be _unable_ to compile Torque, when configured properly.

It would however require an indepth knowledge of the Torque build process, and DevC++.

Like I said, the compile error your received was due to one of the lib/ files not being available in an appropriate directory.

So it seems like you got 99% of the way.