![]() |
| | #1 |
| Registered User Join Date: Dec 2005
Posts: 82
| I am facing a problem in creating an executable. My code compiles fine but while linking with a static library it says undefined reference to "fuctionname". Where as instead of creating executable if i am creating a shared library of it then it works fine (i don’t know it will run fine or not, but compiling and creation of .so goes fine). Could you help me out of this problem? I have heard that shared libraries are permitted to have undefined references. Is it true? Thanks in advance.
__________________ S_cess is waiting for u. Go Ahead, put u there. |
| maven is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| A .so doesn't require all symbols to be resolved, so I'd guess that it simply hides the actual problem until you try to RUN the application that links to the .so. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Registered User Join Date: Dec 2005
Posts: 82
| ok, thanks for sharing the information. I will run the application and see the possible results. Any other information will also be appreciable.
__________________ S_cess is waiting for u. Go Ahead, put u there. |
| maven is offline | |
| | #4 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| It would also help if you let us know what the symbol that is undefined is. One of your symbols, something from the C library, or... ? -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #5 |
| Registered User Join Date: Dec 2005
Posts: 82
| It is from some third party library. I am trying to resolve, i will update you once i am done.
__________________ S_cess is waiting for u. Go Ahead, put u there. |
| maven is offline | |
| | #6 | |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Quote:
-- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. | |
| matsp is offline | |
| | #7 |
| Registered User Join Date: Dec 2005
Posts: 82
| It is solved. I was compiling my code with the library only. But there were few conditional comiplation in libarary code, which needs to be configure in a header file. When i compiled the library code with proper configuration then it worked fine. By the way, thanks a lot matsp for nice informations!
__________________ S_cess is waiting for u. Go Ahead, put u there. |
| maven is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Screwy Linker Error - VC2005 | Tonto | C++ Programming | 5 | 06-19-2007 02:39 PM |
| Problem Compiling | Flakster | C++ Programming | 4 | 06-13-2006 01:09 AM |
| Grrr.... SDL Linking Problem | 7EVEN | Game Programming | 5 | 08-12-2005 08:44 PM |
| simple compiling problem | waxydock | C++ Programming | 2 | 03-26-2005 10:33 AM |
| gcc 3.2 & linking | rotis23 | Linux Programming | 1 | 06-23-2003 06:46 AM |