News: SMF - Just Installed!
 
Welcome, Guest. Please login or register.
+  AnthraxBio
|-+  Return to Castle Wolfenstein
| |-+  Coding Tutorials
| | |-+  Compiling with Dev C++ 4.1
« previous next »
Pages: [1] Print
Author Topic: Compiling with Dev C++ 4.1  (Read 301 times)
SkreamerVirii
Administrator
Full Member
*****
Posts: 133


View Profile
« on: September 03, 2008, 11:19:11 PM »

When I first tried to, I got across some nasty ASM code DecCpp couldn't compile (it uses AT&T syntax at the moment), but I didn't notice the "C_ONLY" flag.
To compile it with DevCpp 4.1, do the following:
1. Create a new project, choose C as language and make sure you opt for an empty project. Use the name of the DLL you want to compile as filename for your project.
2. Add all files for the DLL you are going to compile. (See some easily readable Linux makefiles for this)
3. Open project options and choose to compile a DLL, and disable the console. In the "Extra compiler options" box, enter "-DGAMEDLL -DC_ONLY" if you're compiling the server DLL, or "-DCGAMEDLL -DC_ONLY" for a client DLL.
4. (Optional bugfix:) Finally, if you're compiling the server DLL, you should comment out the "#define MAX_PATH 144" line from AI_main.c to prevent a conflict with Stdlib.h
5. Remember to always choose "Rebuild all" instead of "Compile". It works better, and takes only little more time. Also, make sure to disable the "Project Explorer", or you'll risk horrible memory eating errors. (DevCpp bug, that) Just don't close any editor Windows and it should work fine.
Download the old Dev-C++ 4 from the Bloodshed.net development download site.
You should also note that the DLLs become a bit larger than those compiled with VC 6.0 (server is about 1mb, client 850kb)
Also, there's a bit of a problem with the linker not finding an export defenition. This doesn't effect the performance of the final product, but it might be the cause of the swollen file size, and it creates huge library files for easy dynamic linking, which aren't necessary, since we aren't recompiling the .EXE file anyway.
I dont know who to give credit to except to Board Guest 601007
WISH I HAD A NAME
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Free SMF 1.1.5 Forum Theme by Tamuril. © 2008.