Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Martee

Creating a library in DJGPP

This topic is 6918 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.



Share this post


Link to post
Share on other sites

Thanx suburber!
It works great!

And DJGPP doesn''t suck, of course.


Martee
Magnum Games
http://MagnumGames.8m.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!