[Dev-C++] Adding and creating my own Lib files to Project
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Carlos d. M. <cg...@wo...> - 2002-08-26 19:18:57
|
I don't know if I sent this message to the right direction or not, I post it again. I have a couple of files: file.h and file.cpp which I want add to a project, but which I'll want add to other projects, too. So I think make a library file, libfile.a. I compile in command line g++ -c file.cpp Then I do ar -r libfile.a file.o Then ar -s libfile.a I copy it to c:\dev-cpp\lib\ I put in options (either project if it is organized as project or compiler if simply mainfile.cpp #include "file.cpp") -lfile, or -llibfile or -libfile or -lfile.a or -llibfile.a, but depending on what I use I get or it does not find it or undefined references. It happens the same if I leave libfile in the same directory than the rest of the project (one single more file, mainfile.cpp). What's my error? I mistake binutil? (ar -s = ranlib) P.S. - In my computer (windows 2000, Intel III x86 6.5.5), when I type in the command line ar -pv file it starts beeping continuosly, the command line does not respond anymore and that continues after it has printed all. I had to restart the computer. (I didn't proved without v[verbose], but surely it would do the same). |