Link error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dheer
    New Member
    • Sep 2007
    • 3

    Link error

    I am trying to create an exe from a simple C program whilch calls some functions having implementation in a lib file . There are 3 functions i am invoking of which the compiler is able to just link 2 functions , for the third the compiler throws unresolved symbol error . I have set the path to lib directory . Since the lib was initially i coff type i have converted it into omf using coff2omf .Is this causing any problem or there is something else i need to do ?

    Can anyone help me?
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Include the library on the linker command line.

    Comment

    • Dheer
      New Member
      • Sep 2007
      • 3

      #3
      Originally posted by Banfa
      Include the library on the linker command line.
      I have included the lib file on cmd line otherwise how could i link the 2 functions

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        In that case either the function does not exist in the libray you think it exists in or you have got it's name wrong in your source code, it took me 3 days once to spot that a O should have been a 0.

        Comment

        • Dheer
          New Member
          • Sep 2007
          • 3

          #5
          Originally posted by Banfa
          In that case either the function does not exist in the libray you think it exists in or you have got it's name wrong in your source code, it took me 3 days once to spot that a O should have been a 0.
          Actually there is no mismatch in the function signature.Could you pls clear my one doubt.Initially the lib file was in coff format. I opened the lib file in Visual Studio.net and could see this function which wasn't linking.Since the lib was not of coff type i used coff2omf to convert it to omf the first time.When I opened this converted file I couldn't see this function. It was stripped off.Next i tried to convert the coff to omf giving the cmd coff2omf -lib:ms which allows entries that have MS C++ name mangling and when I opened the converted file I luckly saw the function which was not stripped off.But when I used this lib in the cmd line during compilation I find the same error.What is this C++ mangling, .Or is there some other option i need to give during coff2omf or compilation. Pls help

          Comment

          Working...