Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C library and C++ application

C library and C++ application

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++learning
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CoY0te
    wrote on last edited by
    #1

    Hi there! My project looks like this: #1 - libiupwin.lib - library written completely in C #2 - app.exe - application written in C++ - depends on libiupwin.lib The problem: I can compile #1, and a .lib file is generated I can compile #2, but linker fails with plenty of messages like: Unresolved external '_iupDlgNext' referenced from (...)\libiupwin.lib|itraverse "itraverse" is one of C files included in library, and iupDlgNext is of course a function (placed in library, too). I found one instance of 'iupDlgNext' and one instance of '_iupDlgNext' in a .lib file (using a text search). I guess this has something to do with differences between C and C++ function calls, but since I have little experience with "linking problems" I could use some help with this one. Thanks in advance. [ CoY0te ] Coyotus incrediblus...

    J B C 3 Replies Last reply
    0
    • C CoY0te

      Hi there! My project looks like this: #1 - libiupwin.lib - library written completely in C #2 - app.exe - application written in C++ - depends on libiupwin.lib The problem: I can compile #1, and a .lib file is generated I can compile #2, but linker fails with plenty of messages like: Unresolved external '_iupDlgNext' referenced from (...)\libiupwin.lib|itraverse "itraverse" is one of C files included in library, and iupDlgNext is of course a function (placed in library, too). I found one instance of 'iupDlgNext' and one instance of '_iupDlgNext' in a .lib file (using a text search). I guess this has something to do with differences between C and C++ function calls, but since I have little experience with "linking problems" I could use some help with this one. Thanks in advance. [ CoY0te ] Coyotus incrediblus...

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      If you have a header file for this library, you might need to add some lines like this at the top: #ifdef _cplusplus extern "C" { #endif and lines like this at the bottom #ifdef _cplusplus } #endif rebuild your C++ components, then see if it links okay.

      1 Reply Last reply
      0
      • C CoY0te

        Hi there! My project looks like this: #1 - libiupwin.lib - library written completely in C #2 - app.exe - application written in C++ - depends on libiupwin.lib The problem: I can compile #1, and a .lib file is generated I can compile #2, but linker fails with plenty of messages like: Unresolved external '_iupDlgNext' referenced from (...)\libiupwin.lib|itraverse "itraverse" is one of C files included in library, and iupDlgNext is of course a function (placed in library, too). I found one instance of 'iupDlgNext' and one instance of '_iupDlgNext' in a .lib file (using a text search). I guess this has something to do with differences between C and C++ function calls, but since I have little experience with "linking problems" I could use some help with this one. Thanks in advance. [ CoY0te ] Coyotus incrediblus...

        J Offline
        J Offline
        John R Shaw
        wrote on last edited by
        #3

        The usual problem is that C linking is not specifed in the C header files. Therefor, the linker mangles the name found in the header file. #ifdef __cplusplus extern "C" { #endif /* C-Funcion prototypes */ #ifdef __cplusplus } #endif The error message you show does not seem to imply that this is the problem, but it is well worth checking out. Note: A function name mangled with an underscore in the error message is just the internal name of the function generated by the compilier (you may ignore the underscore). If you had named you function _Func the the error message would have called it __Func. Remember leading underscores are supposed to be reserved for vender/specific global variable/function names. Well I do not know it this helped. Good Luck! INTP

        1 Reply Last reply
        0
        • C CoY0te

          Hi there! My project looks like this: #1 - libiupwin.lib - library written completely in C #2 - app.exe - application written in C++ - depends on libiupwin.lib The problem: I can compile #1, and a .lib file is generated I can compile #2, but linker fails with plenty of messages like: Unresolved external '_iupDlgNext' referenced from (...)\libiupwin.lib|itraverse "itraverse" is one of C files included in library, and iupDlgNext is of course a function (placed in library, too). I found one instance of 'iupDlgNext' and one instance of '_iupDlgNext' in a .lib file (using a text search). I guess this has something to do with differences between C and C++ function calls, but since I have little experience with "linking problems" I could use some help with this one. Thanks in advance. [ CoY0te ] Coyotus incrediblus...

          C Offline
          C Offline
          CoY0te
          wrote on last edited by
          #4

          I've managed to solve my problem yesterday. I can't really tell what it really was, but it seem to me like a page size problem. Library had a page size increased to 64 since it was too large. I have created three libraries out of this one and left efault page size (16). Now it links juzt fine. Since I created new project, I'm not quite sure if something else didn't get involved, but perhaps it really was the page size. So in cae anybody runs into similar problem this may be the hint. Thanks for help. [ CoY0te ] Coyotus incrediblus...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups