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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. error LNK2019: unresolved external symbol

error LNK2019: unresolved external symbol

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsonhelpquestion
11 Posts 5 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.
  • B Offline
    B Offline
    bankai123
    wrote on last edited by
    #1

    Hi, I've recently opened a vc6 MFC project into vs2005 and let it do the conversions. The code would compile fine. Next I added a class called AviFile(Creating Movie from HBitmap on Codeproject) to the project which I assume is just using win32 API. However when I try to compile, I get his error message. 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileInit@0 referenced in function "public: __thiscall CAviFile::CAviFile(char const *,unsigned long,unsigned long)" (??0CAviFile@@QAE@PBDKK@Z) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileExit@0 referenced in function "public: __thiscall CAviFile::~CAviFile(void)" (??1CAviFile@@QAE@XZ) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileRelease@4 referenced in function "private: void __thiscall CAviFile::ReleaseMemory(void)" (?ReleaseMemory@CAviFile@@AAEXXZ) ...etc I think there's something wrong with the linker settings, but I can't quite figure it out. I've googled for possible solutions, but still no luck. Does anyone have an idea? Thanks

    T R N 3 Replies Last reply
    0
    • B bankai123

      Hi, I've recently opened a vc6 MFC project into vs2005 and let it do the conversions. The code would compile fine. Next I added a class called AviFile(Creating Movie from HBitmap on Codeproject) to the project which I assume is just using win32 API. However when I try to compile, I get his error message. 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileInit@0 referenced in function "public: __thiscall CAviFile::CAviFile(char const *,unsigned long,unsigned long)" (??0CAviFile@@QAE@PBDKK@Z) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileExit@0 referenced in function "public: __thiscall CAviFile::~CAviFile(void)" (??1CAviFile@@QAE@XZ) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileRelease@4 referenced in function "private: void __thiscall CAviFile::ReleaseMemory(void)" (?ReleaseMemory@CAviFile@@AAEXXZ) ...etc I think there's something wrong with the linker settings, but I can't quite figure it out. I've googled for possible solutions, but still no luck. Does anyone have an idea? Thanks

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      the compiler probably doesn't find the related .lib file into which those symbols are defined...


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      1 Reply Last reply
      0
      • B bankai123

        Hi, I've recently opened a vc6 MFC project into vs2005 and let it do the conversions. The code would compile fine. Next I added a class called AviFile(Creating Movie from HBitmap on Codeproject) to the project which I assume is just using win32 API. However when I try to compile, I get his error message. 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileInit@0 referenced in function "public: __thiscall CAviFile::CAviFile(char const *,unsigned long,unsigned long)" (??0CAviFile@@QAE@PBDKK@Z) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileExit@0 referenced in function "public: __thiscall CAviFile::~CAviFile(void)" (??1CAviFile@@QAE@XZ) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileRelease@4 referenced in function "private: void __thiscall CAviFile::ReleaseMemory(void)" (?ReleaseMemory@CAviFile@@AAEXXZ) ...etc I think there's something wrong with the linker settings, but I can't quite figure it out. I've googled for possible solutions, but still no luck. Does anyone have an idea? Thanks

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

        link it with Vfw32.lib.

        1 Reply Last reply
        0
        • B bankai123

          Hi, I've recently opened a vc6 MFC project into vs2005 and let it do the conversions. The code would compile fine. Next I added a class called AviFile(Creating Movie from HBitmap on Codeproject) to the project which I assume is just using win32 API. However when I try to compile, I get his error message. 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileInit@0 referenced in function "public: __thiscall CAviFile::CAviFile(char const *,unsigned long,unsigned long)" (??0CAviFile@@QAE@PBDKK@Z) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileExit@0 referenced in function "public: __thiscall CAviFile::~CAviFile(void)" (??1CAviFile@@QAE@XZ) 1>AviFile.obj : error LNK2019: unresolved external symbol _AVIFileRelease@4 referenced in function "private: void __thiscall CAviFile::ReleaseMemory(void)" (?ReleaseMemory@CAviFile@@AAEXXZ) ...etc I think there's something wrong with the linker settings, but I can't quite figure it out. I've googled for possible solutions, but still no luck. Does anyone have an idea? Thanks

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

          specify the Vfw32.lib in the "object/library modules"( project settings->Link ) of your project settings.

          nave [OpenedFileFinder]

          B 1 Reply Last reply
          0
          • N Naveen

            specify the Vfw32.lib in the "object/library modules"( project settings->Link ) of your project settings.

            nave [OpenedFileFinder]

            B Offline
            B Offline
            bankai123
            wrote on last edited by
            #5

            The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h. I'm using Visual Studio 2005, so would "object/library modules" be the Additional Library Directories? Thanks

            N R C 3 Replies Last reply
            0
            • B bankai123

              The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h. I'm using Visual Studio 2005, so would "object/library modules" be the Additional Library Directories? Thanks

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

              bankai123 wrote:

              The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h.

              Vfw32.lib will be having the link information for that functions.

              bankai123 wrote:

              I'm using Visual Studio 2005

              I dont have VS2005 now. How ever it is not Additional Library Directories.

              nave [OpenedFileFinder]

              1 Reply Last reply
              0
              • B bankai123

                The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h. I'm using Visual Studio 2005, so would "object/library modules" be the Additional Library Directories? Thanks

                R Offline
                R Offline
                Rajkumar R
                wrote on last edited by
                #7

                Hi, you may included vfw.h so you didn't get compilation error. you got link error, find the option for linking corresponding to your IDE, VS2005 needs to add vfw32.lib to project-><name>property->configuation property->linker->Input->Additional Dependency field.

                B 1 Reply Last reply
                0
                • B bankai123

                  The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h. I'm using Visual Studio 2005, so would "object/library modules" be the Additional Library Directories? Thanks

                  C Offline
                  C Offline
                  Cedric Moonen
                  wrote on last edited by
                  #8

                  bankai123 wrote:

                  The AviFile class doesn't use the Vfw32.lib library, but uses vfw.h.

                  The header file only contains the class declaration. From where do you think the implementation of the methods comes from ? Bingo, from the library file ;). In visual studio 2005, go into "Project Properties" -> "Linker" -> "Input" and specify the library in "Additional Dependencies".


                  Cédric Moonen Software developer
                  Charting control [v1.2]

                  1 Reply Last reply
                  0
                  • R Rajkumar R

                    Hi, you may included vfw.h so you didn't get compilation error. you got link error, find the option for linking corresponding to your IDE, VS2005 needs to add vfw32.lib to project-><name>property->configuation property->linker->Input->Additional Dependency field.

                    B Offline
                    B Offline
                    bankai123
                    wrote on last edited by
                    #9

                    Thanks for that, that solution solved the linker problem. Now I seem to get this error LINK : fatal error LNK1104: cannot open file 'C:\Program.obj' Is this a problem with my directory path I specified? Which was C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib

                    R 1 Reply Last reply
                    0
                    • B bankai123

                      Thanks for that, that solution solved the linker problem. Now I seem to get this error LINK : fatal error LNK1104: cannot open file 'C:\Program.obj' Is this a problem with my directory path I specified? Which was C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib

                      R Offline
                      R Offline
                      Rajkumar R
                      wrote on last edited by
                      #10

                      when you add vfw32.lib does the field already had other libs, if so donot put commas in between only spaces or add it using IDE as seperate entry. also for long path having spaces c:/program files use "c:/program files" include it in quotes Best Regards

                      B 1 Reply Last reply
                      0
                      • R Rajkumar R

                        when you add vfw32.lib does the field already had other libs, if so donot put commas in between only spaces or add it using IDE as seperate entry. also for long path having spaces c:/program files use "c:/program files" include it in quotes Best Regards

                        B Offline
                        B Offline
                        bankai123
                        wrote on last edited by
                        #11

                        Thanks for the help!:laugh: I forgot the quotes, the directory path should be in Dos 8.3 format, am I correct? Oh well, thanks, all is working now. -- modified at 7:58 Friday 1st June, 2007

                        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