CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2008
    Posts
    56

    Unresolved external symbol

    Hi! I'm trying to use the imaging library APIs but, when I try to create:

    ::CoCreateInstance(CLSID_ImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IImagingFactory, (void **)&pFactory);

    I get:

    Error 2 error LNK2019: unresolved external symbol IID_IImagingFactory referenced in function "public: virtual void __cdecl ImageLoader::run(void)" (?run@ImageLoader@@UAAXXZ) imageloader.obj SCD

    I tried to include as well:

    #include <initguid.h>
    #include <imgguids.h>

    but I got a multiple definition. Is there any other way of defining those symbols?
    Thanks!

  2. #2
    Join Date
    Sep 2008
    Posts
    70

    Re: Unresolved external symbol

    Goto your project properties goto c++ then code generation change the runtime library to multi threaded MT.

    See if that helps.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Unresolved external symbol

    Make sure you're linking the actual library. (#includes are only useful to the compiler; the linker doesn't care about them.)

  4. #4
    Join Date
    Feb 2008
    Posts
    56

    Re: Unresolved external symbol

    I already told the linker where to find imaging.lib. Is there anything else I should link?
    Thanks!

  5. #5
    Join Date
    Apr 2008
    Posts
    133

    Re: Unresolved external symbol

    Quote Originally Posted by Luc484 View Post
    Hi! I'm trying to use the imaging library APIs but, when I try to create:

    ::CoCreateInstance(CLSID_ImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IImagingFactory, (void **)&pFactory);

    I get:

    Error 2 error LNK2019: unresolved external symbol IID_IImagingFactory referenced in function "public: virtual void __cdecl ImageLoader::run(void)" (?run@ImageLoader@@UAAXXZ) imageloader.obj SCD

    I tried to include as well:

    #include <initguid.h>
    #include <imgguids.h>

    but I got a multiple definition. Is there any other way of defining those symbols?
    Thanks!
    Did you do the includes in a .h of .cpp file..Try putting the includes in a .cpp file

  6. #6
    Join Date
    Feb 2008
    Posts
    56

    Re: Unresolved external symbol

    This is working! Thanks!

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Unresolved external symbol

    Quote Originally Posted by sunil_cguru View Post
    Did you do the includes in a .h of .cpp file..Try putting the includes in a .cpp file
    If it was an includes problem if wouldn't have compiled.

  8. #8
    Join Date
    Apr 2008
    Posts
    133

    Re: Unresolved external symbol

    it would compile..but multiple definitions would get flagged by the linker

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