Re: [Dev-C++] implementation .o procedure
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Elizabeth B. <sog...@ya...> - 2002-10-13 19:41:58
|
"Santiago" <sa...@ho...> writes: > Hi, I only have DevC++, I don't know if it's possible to use the commands > gcc -c a.c and gcc -c b.c in DevC++. Anyway I'm still stuck with the first > part of the process, creating a .o object file out of the implementation of > a class I made. These are my questions again: > 1- How do I create an object file using the implementation I created? I want > someone else to use this object file so I don't have to give them my > implementation code. > 2- Once the object file is created, how does the user use it to compile > his/her own client code? how does the user refer to the file in his/her > client code by using #include "myClass.h", or "myClass.o", or both, or some > other way? > > I'll play class creator and main creator(user) myself using DevC++ for > testing purposes. > > I'll appreciate your help! Normally, to do such a thing, one makes a library, which is simply a collection of .o files. On Win32, people tend to make DLL's, which are libraries that are linked in at run-time. But, anyway, just pass the .o file (the object file) to the linker when linking the library or executable. I explained the "menu steps" in the last message. > Project > Project Options > > dialog and placing "myClass.o" in the field labeled, "Linker > options/Optional Libs or Object Files" - the key words being "Object > Files" in this case (files that have the .o extension). Elizabeth |