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/C++ problem.

C/C++ problem.

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++businesstutorialquestion
4 Posts 4 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.
  • M Offline
    M Offline
    Michael Liu
    wrote on last edited by
    #1

    I have head file and cpp file are written in C++. There is a GetItem() in it. I used it in a C file to create a lib file. The compile is fine. Then I use this lib file in a C++ application and got a Link2001 link error which says "unresolved external symbol _GetItem". Anyone knows how to fix this problem? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

    B R A 3 Replies Last reply
    0
    • M Michael Liu

      I have head file and cpp file are written in C++. There is a GetItem() in it. I used it in a C file to create a lib file. The compile is fine. Then I use this lib file in a C++ application and got a Link2001 link error which says "unresolved external symbol _GetItem". Anyone knows how to fix this problem? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

      B Offline
      B Offline
      Bill Wilson
      wrote on last edited by
      #2

      You need to reference the library where the _GetItem function is implemented.

      1 Reply Last reply
      0
      • M Michael Liu

        I have head file and cpp file are written in C++. There is a GetItem() in it. I used it in a C file to create a lib file. The compile is fine. Then I use this lib file in a C++ application and got a Link2001 link error which says "unresolved external symbol _GetItem". Anyone knows how to fix this problem? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

        R Offline
        R Offline
        realfly
        wrote on last edited by
        #3

        you should link the .lib if in vc, should be at "project setting"->link->object/library type in the libary name will be ok i am realfly8)

        1 Reply Last reply
        0
        • M Michael Liu

          I have head file and cpp file are written in C++. There is a GetItem() in it. I used it in a C file to create a lib file. The compile is fine. Then I use this lib file in a C++ application and got a Link2001 link error which says "unresolved external symbol _GetItem". Anyone knows how to fix this problem? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

          A Offline
          A Offline
          Alexandru Savescu
          wrote on last edited by
          #4

          Also, if the GetItem implementation is in a C file do not forget the extern "C" stuff:

          extern "C"
          {
          #include "Header_in_C_That_Contains_GetItem.h"
          }

          Best regards, Alexandru Savescu

          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