Working with LCC-WIN32|
OK, welcome to the first tutorial, working with LCC.
LCC-WIN32 is a freeware C compiler that you can make
DLLs with. Sure its not very fancy, but hey, it gets the job
done, and doesn't cost a couple hundred bucks. If your
really serious about making Q2 mods, a professional compiler such as
MSVC++ might be a better option (it'll save you shitloads of time!),
but for now, we'll stick to LCC.
OK, this shouldn't be much of a problem.
Open up Winzip and unzip the lcc file into some easy directory. Lets say C:\Quake2\LCC.
Great, now run setuplcc.exe in the main directory. It will ask you for an include and
library directory name. Just go with the default, \include and \lib or \library.
Now you have finished installing your new compiler!
My first program in C!
Unfortunately, LCC has heaps of bugs, one of which prevents you from compiling your project
in the actual program. Instead, you will need to use a couple of DOS
commands to accomplish the same. OK, before we do any compiling, we need something to compile!!
Open up edit, and type in this code:
/* hiworld.c Hello World program! */
Great, now save it as Hiworld.c or something similar inside the bin directory under the main LCC dir.
Now you may or may not know what that stuff is that you just typed, but don't worry, that will be covered in the next tutorial!
printf("Hello, world\nBye bye, world");
Now, if everything's going well so far, type this at the DOS prompt:
C:\Quake2\LCC\bin\ LCC.exe hiworld.c
If every thing went as well as it should have, in the bin directory there
should be a new file called hiworld.obj. Next we have to link it, and create
the actual executable. Type this at the command propt:
C:\Quake2\LCC\bin\ LCCLNK.exe hiworld.obj
If everything went smoothly, in the same bin directory you should have a new
exe file waiting to be run! Execute it!
Tutorial by Puke