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. Linking with inline methods

Linking with inline methods

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiondebuggingtutorial
3 Posts 2 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.
  • 0 Offline
    0 Offline
    0v3rloader
    wrote on last edited by
    #1

    Hello, I was wondering if any of you CPers know how to solve this problem i've come across with. I've defined about four or so methods in this class of mine as inline and, it appears, the linker cannot find the method's definitions in the .OBJ. The only way of solving this issue is by NOT defining the method(s) as inline. How do I do about solving this, while at the same time keeping inline declaration? Thanks a lot David Linker Error:

    Linking...
    LINK : LNK6004: Debug/xtest.exe not found or not built by the last incremental link; performing full link
    xtestDlg.obj : error LNK2001: unresolved external symbol "public: char const & __thiscall XField::GetText(void)" (?GetText@XField@@QAEABDXZ)
    Debug/xtest.exe : fatal error LNK1120: 1 unresolved externals

    J 1 Reply Last reply
    0
    • 0 0v3rloader

      Hello, I was wondering if any of you CPers know how to solve this problem i've come across with. I've defined about four or so methods in this class of mine as inline and, it appears, the linker cannot find the method's definitions in the .OBJ. The only way of solving this issue is by NOT defining the method(s) as inline. How do I do about solving this, while at the same time keeping inline declaration? Thanks a lot David Linker Error:

      Linking...
      LINK : LNK6004: Debug/xtest.exe not found or not built by the last incremental link; performing full link
      xtestDlg.obj : error LNK2001: unresolved external symbol "public: char const & __thiscall XField::GetText(void)" (?GetText@XField@@QAEABDXZ)
      Debug/xtest.exe : fatal error LNK1120: 1 unresolved externals

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      inline methods must come in headers. Are you by chance defining the method in some .cpp instead? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!

      0 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        inline methods must come in headers. Are you by chance defining the method in some .cpp instead? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!

        0 Offline
        0 Offline
        0v3rloader
        wrote on last edited by
        #3

        Yes, that is true. I have defined it in the class declaration - in the header file - and I've coded the method(s) in the actual source file (.cpp) . I take it you mean I can't insert the code in the source file but only in the header? David BTW, thanks for the reply

        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