|
From: <or...@vp...> - 2003-09-20 17:48:57
|
age...@co... wrote: > I have been wanting to write my own library of classes that perform OpenGL > functions in order to reuse code effectivley. I was thinking about adding the > declerations in a .h file, and writing the actual definitions in a .cpp file, > which i would convert to a .lib file. Dev-C++ uses .a, so would I just run the > project static library to make the .a file, or is there a command line utility > which takes a .cpp file and makes it into a .a file? Thank you for replies in > advance. There IS a command line utility which creates archives, or libraries and it comes with Dev-C++ (MinGW). It is called "ar" (archiver). Actually, Dev-C++ uses this. It can create archives from object files. You first need to compile all sources to object files. Type "ar --help" to get a list of comand line options. The most common options are "ar cru <libxxx.a> *.o" In "*.o" * is a wildcard, so ar will get all .o object files and create the archive. A quick'n'dirty way to create an archive (library) of all sources (.cpp and .c) in the current dir, type these 2 commands: g++ -c *.cpp *.c - (compile all .cpp and .c files to objects) ar cru libxxx.a *.o - (create the archive) -- Greetings, Balázs |