RE: [Dev-C++] Still more linker problems...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-06-03 16:23:06
|
When you create a library, you are supposted to _link_ to the functions in the library. What use is a library if you are using inline functions? Then you don't need a library but may just include the header file. /Per W On Thu, 3 Jun 2004, Siva Chandra wrote: > > Hello Scott, > > --- Scott Simontis <age...@co...> wrote: > > I think it is because you are putting the > > definitions in the .h file. > > Instead, it would be better to make x.h have only > > variable declarations, > > defines, and function prototypes, and an x.cpp file > > which has all the > > function definitions. > > But aren't inline functions supposed to be defined in > the header files itself?...!! > > ...if no, then how would the compiler know the > function definition to generate code in-line? > > /Siva Chandra > > > -----Original Message----- > > From: dev...@li... > > On Behalf Of Siva Chandra > > Subject: [Dev-C++] Still more linker problems... > > > > Hello, > > > > I am still trying to solve my linker problems. I am > > trying to do the following: > > > > 1. Build a static library; > > For this I use a header file say x.h. This header > > file > > contains few inline functions( and of-course their > > definitions). So I comfortably compile all the > > source > > files, then put them together as libx.a file. The > > going is great so far!! > > > > 2. Next I try to use this library in an application. > > So I create a source file and compile it. Its all > > too > > simple and I get an object file, say, appx.o. Note > > that I include the header x.h in my source file. > > > > 3. Now I try to link my object file appx.o with > > libx.a. > > Here is where I am stuck. The linker complains about > > all the inline functions defined in x.h to be > > multiple-ly defined. > > > > Can somebody please help me out in getting around > > this > > problem!! > > > > TIA, > > > > Siva Chandra > > > ------------------------------------------------------- > > PS :: The problem I am facing is while try to build > > OpenCV and its support libs. > > > ------------------------------------------------------- > > > > > > __________________________________ > Do you Yahoo!? > Friends. Fun. Try the all-new Yahoo! Messenger. > http://messenger.yahoo.com/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > >From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |