Creating a library in DJGPP
I have a bunch of routines I would like to put into a library (i.e. MyLib.a or something like that). How would i go about doing this? How do i get around needing a main() function?
Martee
Magnum Games
http://MagnumGames.8m.com
Ack, here''s an idea, don''t use DJGPP, it sux. If you are doing VGA programming use turbo c (lite), if you are dealing with standard graphics aka direct3d/directdraw or opengl, use VC++(yes, you can find free "intro" editions), and for general c++ programming use borland.
but on your question. don''t compile it, just put what you need in there and then save as [whatever].h, to see whether it worx or not i believe you can then include it and try and compile/build the project its in....
-Run_The_Shadows
-Run_The_Shadows@excite.com
but on your question. don''t compile it, just put what you need in there and then save as [whatever].h, to see whether it worx or not i believe you can then include it and try and compile/build the project its in....
-Run_The_Shadows
-Run_The_Shadows@excite.com
Another thing you can do is just compile the cpp file to an obj file, and then link that in with your other stuff. That is, if all the routines you want to make into a library are in one source file.
You should check the documentation for the linker, to see what parameter to use to make it output a lib file instead of exe.
And DJGPP doesn''t suck! I heard id used it to compile the DOS version of Quake, since they coded it in VC++ (I don''t know if this is actually true, but that''s what I heard).
Good luck!
------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge
You should check the documentation for the linker, to see what parameter to use to make it output a lib file instead of exe.
And DJGPP doesn''t suck! I heard id used it to compile the DOS version of Quake, since they coded it in VC++ (I don''t know if this is actually true, but that''s what I heard).
Good luck!
------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge
DJGPP does NOT suck! Having said that, about making libraries...
First you compile your source into an object. In DJGPP, those files have a .o extension. You add the object to an already existing library, or create a new one, by writing:
ar rvs MyLib.a whatever.o
Check this out:
http://www.delorie.com/djgpp/doc/ug/larger/archives.html
It''s all there. Good luck.
First you compile your source into an object. In DJGPP, those files have a .o extension. You add the object to an already existing library, or create a new one, by writing:
ar rvs MyLib.a whatever.o
Check this out:
http://www.delorie.com/djgpp/doc/ug/larger/archives.html
It''s all there. Good luck.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement