RE: [Dev-C++] Still more linker problems...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Scott S. <age...@co...> - 2004-06-03 14:42:32
|
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. What is happening is that the definitions are being held in the libx.a file and in the header, and thus the compiler doesn't know which definition to use. SO the choices here are to put all the definitions in an x.cpp file, or just use one big header for everything. -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Siva Chandra Sent: Thursday, June 03, 2004 7:15 AM To: dev...@li... 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 |