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. Error LNK 2019 problem

Error LNK 2019 problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
6 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.
  • A Offline
    A Offline
    Alex Cutovoi
    wrote on last edited by
    #1

    Hi fellows I'm using Visual C++ 2005 Express Edition and I'm getting some errors when I execute my app. This is my class that I defined in a ".h" file called "FloatText.h": #ifndef FLOATTEXT_H #define FLOATTEXT_H class FloatText { public: FloatText(); ~FloatText(); void SetText(char * cText); void MoveText(int iXPos, int iYPos); char * GetText(); private: float m_XPos, m_YPos, m_ZPos; double m_fModelviewMatrix[16]; double m_fProjectionMatrix[16]; int m_iViewportMatrix[4]; static int m_iTextObjects; char * m_cString; int m_iStringPos; }; #endif FLOATTEXT_H I implemented this class in a ".cpp" file, and include the "FloatText.h" in the "main.cpp" too. No problems until now. When I press CTRL+F5 these errors are shown to me: main.obj : error LNK2019: unresolved external symbol "public: char * __thiscall FloatText::GetText(void)" (?GetText@FloatText@@QAEPADXZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::MoveText(int,int)" (?MoveText@FloatText@@QAEXHH@Z) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: __thiscall FloatText::FloatText(void)" (??0FloatText@@QAE@XZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::SetText(char *)" (?SetText@FloatText@@QAEXPAD@Z) referenced in function "long __stdcall WindowProcedure(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z) So, what's going on if the code compilation runs normally??? thanks

    N N H 3 Replies Last reply
    0
    • A Alex Cutovoi

      Hi fellows I'm using Visual C++ 2005 Express Edition and I'm getting some errors when I execute my app. This is my class that I defined in a ".h" file called "FloatText.h": #ifndef FLOATTEXT_H #define FLOATTEXT_H class FloatText { public: FloatText(); ~FloatText(); void SetText(char * cText); void MoveText(int iXPos, int iYPos); char * GetText(); private: float m_XPos, m_YPos, m_ZPos; double m_fModelviewMatrix[16]; double m_fProjectionMatrix[16]; int m_iViewportMatrix[4]; static int m_iTextObjects; char * m_cString; int m_iStringPos; }; #endif FLOATTEXT_H I implemented this class in a ".cpp" file, and include the "FloatText.h" in the "main.cpp" too. No problems until now. When I press CTRL+F5 these errors are shown to me: main.obj : error LNK2019: unresolved external symbol "public: char * __thiscall FloatText::GetText(void)" (?GetText@FloatText@@QAEPADXZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::MoveText(int,int)" (?MoveText@FloatText@@QAEXHH@Z) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: __thiscall FloatText::FloatText(void)" (??0FloatText@@QAE@XZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::SetText(char *)" (?SetText@FloatText@@QAEXPAD@Z) referenced in function "long __stdcall WindowProcedure(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z) So, what's going on if the code compilation runs normally??? thanks

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      the error came because you might havent implement the following functions GetText MoveText FloatText SetText in the cpp file or the way u implement wasnt correct. Check whether you have implemented the fu nction as shown below eg: char* **FloatText**::GetText() { return ......; }

      nave

      1 Reply Last reply
      0
      • A Alex Cutovoi

        Hi fellows I'm using Visual C++ 2005 Express Edition and I'm getting some errors when I execute my app. This is my class that I defined in a ".h" file called "FloatText.h": #ifndef FLOATTEXT_H #define FLOATTEXT_H class FloatText { public: FloatText(); ~FloatText(); void SetText(char * cText); void MoveText(int iXPos, int iYPos); char * GetText(); private: float m_XPos, m_YPos, m_ZPos; double m_fModelviewMatrix[16]; double m_fProjectionMatrix[16]; int m_iViewportMatrix[4]; static int m_iTextObjects; char * m_cString; int m_iStringPos; }; #endif FLOATTEXT_H I implemented this class in a ".cpp" file, and include the "FloatText.h" in the "main.cpp" too. No problems until now. When I press CTRL+F5 these errors are shown to me: main.obj : error LNK2019: unresolved external symbol "public: char * __thiscall FloatText::GetText(void)" (?GetText@FloatText@@QAEPADXZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::MoveText(int,int)" (?MoveText@FloatText@@QAEXHH@Z) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: __thiscall FloatText::FloatText(void)" (??0FloatText@@QAE@XZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::SetText(char *)" (?SetText@FloatText@@QAEXPAD@Z) referenced in function "long __stdcall WindowProcedure(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z) So, what's going on if the code compilation runs normally??? thanks

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        Alex Cutovoi wrote:

        I implemented this class in a ".cpp" file

        Where is this cpp file. Is it included in the project.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        1 Reply Last reply
        0
        • A Alex Cutovoi

          Hi fellows I'm using Visual C++ 2005 Express Edition and I'm getting some errors when I execute my app. This is my class that I defined in a ".h" file called "FloatText.h": #ifndef FLOATTEXT_H #define FLOATTEXT_H class FloatText { public: FloatText(); ~FloatText(); void SetText(char * cText); void MoveText(int iXPos, int iYPos); char * GetText(); private: float m_XPos, m_YPos, m_ZPos; double m_fModelviewMatrix[16]; double m_fProjectionMatrix[16]; int m_iViewportMatrix[4]; static int m_iTextObjects; char * m_cString; int m_iStringPos; }; #endif FLOATTEXT_H I implemented this class in a ".cpp" file, and include the "FloatText.h" in the "main.cpp" too. No problems until now. When I press CTRL+F5 these errors are shown to me: main.obj : error LNK2019: unresolved external symbol "public: char * __thiscall FloatText::GetText(void)" (?GetText@FloatText@@QAEPADXZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::MoveText(int,int)" (?MoveText@FloatText@@QAEXHH@Z) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: __thiscall FloatText::FloatText(void)" (??0FloatText@@QAE@XZ) referenced in function _WinMain@16 main.obj : error LNK2019: unresolved external symbol "public: void __thiscall FloatText::SetText(char *)" (?SetText@FloatText@@QAEXPAD@Z) referenced in function "long __stdcall WindowProcedure(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z) So, what's going on if the code compilation runs normally??? thanks

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Did you declare body for functions on the FloatText.cpp


          WhiteSky


          A 1 Reply Last reply
          0
          • H Hamid Taebi

            Did you declare body for functions on the FloatText.cpp


            WhiteSky


            A Offline
            A Offline
            Alex Cutovoi
            wrote on last edited by
            #5

            Problem solved guys, I include the files in my project with the option, right clicking in my project and selecting "Add Existing Item". And works fine. thanks for the support

            H 1 Reply Last reply
            0
            • A Alex Cutovoi

              Problem solved guys, I include the files in my project with the option, right clicking in my project and selecting "Add Existing Item". And works fine. thanks for the support

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              I glad you find it:-D


              WhiteSky


              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