RE: [Dev-C++] Still more linker problems...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Siva C. <siv...@ya...> - 2004-06-03 15:49:16
|
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/ |