CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Location
    Malaysia
    Posts
    99

    LNK 2001 : unresolved external symbol

    I have duplicated a Visual c++ class from other people source code. There is no any errors when I compile my source code, but error "LNK 2001: unresolved external symbol" ocurr when I build the exe file.

    I wonder what is the problem. I guess it is because I just copy the .cpp and .h file of the class and paste it to my source code.

    Anybody could please help me? thanx

    ty

  2. #2
    Join Date
    Apr 1999
    Posts
    27

    Re: LNK 2001 : unresolved external symbol

    not include all necessary lib


  3. #3
    Guest

    Re: LNK 2001 : unresolved external symbol

    Make sure that you copied everything over to the new file. You also want to make sure that you included all the header files. If parts of the class are in C you may have to use extern "C".


  4. #4
    Join Date
    May 1999
    Posts
    35

    Re: LNK 2001 : unresolved external symbol

    Hi,
    goto project->addfiles
    and add obj or lib file that contain function implementation.
    error will gies away
    ksheeraj

    39639,Leslie St.
    Apt #157
    Fremont USA 94538

  5. #5
    Join Date
    Apr 1999
    Posts
    45

    Re: LNK 2001 : unresolved external symbol

    It sounds like you have not included a needed library.
    The easiest (and least documented) way to do this is to got to the StdAfx header file and add the library ... for example if you are using wininet functions and need to include the wininet library:

    #pragma comment(lib,"wininet.lib")

    Most of the shell functions also require an additional library, which can be added to your project the same way, just check in the help documentation to find the library name.

    Gordito


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured