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. Adding new GUID to uuids.h and the new library won't link

Adding new GUID to uuids.h and the new library won't link

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingquestion
5 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.
  • V Offline
    V Offline
    Vaclav_
    wrote on last edited by
    #1

    I have added (to the working library) GUID for CLSID_IMGSinkFilter to uuids.h header using this : // 1d4d3676-96ef-4cd7-a3d7-07fac0d0c585 OUR_GUID_ENTRY(CLSID_IMGSinkFilter, 0x1d4d3676, 0x96ef, 0x4cd7, 0xa3, 0xd7, 0x07, 0xfa, 0xc0, 0xd0, 0xc5, 0x85) This GUID will be used in static library. The library compiles and builds, by itself. The main application complies but it fails to link to the GUID with following error: VidCapLib.lib(_Graph.obj) : error LNK2001: unresolved external symbol _CLSID_IMGSinkFilter Debug/TCC_MDI.exe : fatal error LNK1120: 1 unresolved externals So the VidCapLib.lib is not complete. What did I missed? Any help as always will be appreciated. Cheers Vaclav

    _ 1 Reply Last reply
    0
    • V Vaclav_

      I have added (to the working library) GUID for CLSID_IMGSinkFilter to uuids.h header using this : // 1d4d3676-96ef-4cd7-a3d7-07fac0d0c585 OUR_GUID_ENTRY(CLSID_IMGSinkFilter, 0x1d4d3676, 0x96ef, 0x4cd7, 0xa3, 0xd7, 0x07, 0xfa, 0xc0, 0xd0, 0xc5, 0x85) This GUID will be used in static library. The library compiles and builds, by itself. The main application complies but it fails to link to the GUID with following error: VidCapLib.lib(_Graph.obj) : error LNK2001: unresolved external symbol _CLSID_IMGSinkFilter Debug/TCC_MDI.exe : fatal error LNK1120: 1 unresolved externals So the VidCapLib.lib is not complete. What did I missed? Any help as always will be appreciated. Cheers Vaclav

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      In the header file you write this code -

      #include <guiddef.h>

      DEFINE_GUID(CLSID_IMGSinkFilter, 0x1d4d3676, 0x96ef, 0x4cd7, 0xa3, 0xd7, 0x07, 0xfa, 0xc0, 0xd0, 0xc5, 0x85);

      In the source file where you're using CLSID_IMGSinkFilter, include the initguid.h header file. This step is not needed for newer compilers.

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++) (October 2009 - September 2013)

      Polymorphism in C

      V 1 Reply Last reply
      0
      • _ _Superman_

        In the header file you write this code -

        #include <guiddef.h>

        DEFINE_GUID(CLSID_IMGSinkFilter, 0x1d4d3676, 0x96ef, 0x4cd7, 0xa3, 0xd7, 0x07, 0xfa, 0xc0, 0xd0, 0xc5, 0x85);

        In the source file where you're using CLSID_IMGSinkFilter, include the initguid.h header file. This step is not needed for newer compilers.

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++) (October 2009 - September 2013)

        Polymorphism in C

        V Offline
        V Offline
        Vaclav_
        wrote on last edited by
        #3

        Thanks, works as advertized! Now I need to get rid of some DirectShow multiple defintions, no problem. BTW what class(es) did you take to have this much knowledge? Or are you just a old as I am, but much smarter? Thanks again and if you ever in Houston, I owe you a beer. Vaclav

        V _ 2 Replies Last reply
        0
        • V Vaclav_

          Thanks, works as advertized! Now I need to get rid of some DirectShow multiple defintions, no problem. BTW what class(es) did you take to have this much knowledge? Or are you just a old as I am, but much smarter? Thanks again and if you ever in Houston, I owe you a beer. Vaclav

          V Offline
          V Offline
          Vaclav_
          wrote on last edited by
          #4

          Spoke too soon. My attempt to stop multiple defintions run into a snag. I added a "standard" #ifndef / #define flag/ switch to uuids.h - the one I have modified. I make sure I use that one. The "problem" is with plain / non modified DirectShow BaseClasses WXDebug.cpp file. It compiler get wild in this macro : /* Stuff for printing out our GUID names */ GUID_STRING_ENTRY g_GuidNames[] = { #define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ { #name, { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } }, #include }; D:\00\0 SDK\DIrectShow 8.1 SDK\samples\Multimedia\DirectShow\BaseClasses\wxdebug.cpp(936) : error C2059: syntax error : '}' D:\00\0 SDK\DIrectShow 8.1 SDK\samples\Multimedia\DirectShow\BaseClasses\wxdebug.cpp(936) : error C2143: syntax error : missing ';' before '}' D:\00\0 SDK\DIrectShow 8.1 SDK\samples\Multimedia\DirectShow\BaseClasses\wxdebug.cpp(936) : error C2143: syntax error : missing ';' before '}' D:\00\0 SDK\DIrectShow 8.1 SDK\samples\Multimedia\DirectShow\BaseClasses\wxdebug.cpp(939) : error C2070: illegal sizeof operand Error executing cl.exe. Apparently the #include header is no longer OK in the GUID_STRING_ENTRY macro. I have no clue how to modify this macro and keep the DirectShow debug happy. Not realy sure if I need the debug, so I may just skip it from compiling if things don't fall apart more.

          1 Reply Last reply
          0
          • V Vaclav_

            Thanks, works as advertized! Now I need to get rid of some DirectShow multiple defintions, no problem. BTW what class(es) did you take to have this much knowledge? Or are you just a old as I am, but much smarter? Thanks again and if you ever in Houston, I owe you a beer. Vaclav

            _ Offline
            _ Offline
            _Superman_
            wrote on last edited by
            #5

            Didn't take too many classes in programming. Mostly self learnt, like most of the people here. It's probably 16 years of doing the same thing that's helping. I also retain all the test code that I ever wrote with proper book keeping. So that becomes the perfect reference material. Was in Dallas for a couple of days last month. Never been to Houston except during transit a couple of times. Will ping you the next time I'm around and get that beer. :) If you're coming to India any time, please get in touch. :thumbsup:

            «_Superman_»  _I love work. It gives me something to do between weekends.

            _Microsoft MVP (Visual C++) (October 2009 - September 2013)

            Polymorphism in C

            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