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. Linker error when adding Ole to my application, what am I missing?

Linker error when adding Ole to my application, what am I missing?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++comhardwarequestion
6 Posts 3 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.
  • C Offline
    C Offline
    charlieg
    wrote on last edited by
    #1

    I'm trying to get some code to run to work around another issue, and for the life of me, I cannot make the VS2008 linker happy. This is for a smart device, Windows Embedded Compact 7, but I think the target is only a symptom. I've tried this against 3 different SDKs for VS2008 as well as EVC++ (going way back) and two different SDKs - all have the same issue. I need the application to run OLE. So, I created a very simple dialog app - think default code base, C++. It compiles and links. I then add one call: "OleInitialize(0);" and I get this:

    Quote:

    1>Linking... 1>OleTest.obj : error LNK2019: unresolved external symbol OleInitialize referenced in function "public: virtual int __cdecl COleTestApp::InitInstance(void)" (?InitInstance@COleTestApp@@UAAHXZ)

    You can say I need to add an input to the linker line for ole32.lib, but it still fails. Oddly, VS2008 shows that I've inherited these from the solution. Of course the desktop links fine. Any random or "oh crap, yeah, I had that problem" ideas? It's almost as if the ole32.lib doesn't have OleInitialize. I could believe that for one SDK but not 5.

    Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

    CPalliniC L 2 Replies Last reply
    0
    • C charlieg

      I'm trying to get some code to run to work around another issue, and for the life of me, I cannot make the VS2008 linker happy. This is for a smart device, Windows Embedded Compact 7, but I think the target is only a symptom. I've tried this against 3 different SDKs for VS2008 as well as EVC++ (going way back) and two different SDKs - all have the same issue. I need the application to run OLE. So, I created a very simple dialog app - think default code base, C++. It compiles and links. I then add one call: "OleInitialize(0);" and I get this:

      Quote:

      1>Linking... 1>OleTest.obj : error LNK2019: unresolved external symbol OleInitialize referenced in function "public: virtual int __cdecl COleTestApp::InitInstance(void)" (?InitInstance@COleTestApp@@UAAHXZ)

      You can say I need to add an input to the linker line for ole32.lib, but it still fails. Oddly, VS2008 shows that I've inherited these from the solution. Of course the desktop links fine. Any random or "oh crap, yeah, I had that problem" ideas? It's almost as if the ole32.lib doesn't have OleInitialize. I could believe that for one SDK but not 5.

      Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      As rough guess, the linker is not able to find the ole32 library for the embedded platform target (the reason I really don't know).

      "In testa che avete, Signor di Ceprano?" -- Rigoletto

      In testa che avete, signor di Ceprano?

      C 1 Reply Last reply
      0
      • C charlieg

        I'm trying to get some code to run to work around another issue, and for the life of me, I cannot make the VS2008 linker happy. This is for a smart device, Windows Embedded Compact 7, but I think the target is only a symptom. I've tried this against 3 different SDKs for VS2008 as well as EVC++ (going way back) and two different SDKs - all have the same issue. I need the application to run OLE. So, I created a very simple dialog app - think default code base, C++. It compiles and links. I then add one call: "OleInitialize(0);" and I get this:

        Quote:

        1>Linking... 1>OleTest.obj : error LNK2019: unresolved external symbol OleInitialize referenced in function "public: virtual int __cdecl COleTestApp::InitInstance(void)" (?InitInstance@COleTestApp@@UAAHXZ)

        You can say I need to add an input to the linker line for ole32.lib, but it still fails. Oddly, VS2008 shows that I've inherited these from the solution. Of course the desktop links fine. Any random or "oh crap, yeah, I had that problem" ideas? It's almost as if the ole32.lib doesn't have OleInitialize. I could believe that for one SDK but not 5.

        Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hi, Have you tried using CoInitializeEx? [Determining Supported COM APIs (Windows CE 5.0) | Microsoft Learn](https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms862136(v=msdn.10))

        C 1 Reply Last reply
        0
        • CPalliniC CPallini

          As rough guess, the linker is not able to find the ole32 library for the embedded platform target (the reason I really don't know).

          "In testa che avete, Signor di Ceprano?" -- Rigoletto

          C Offline
          C Offline
          charlieg
          wrote on last edited by
          #4

          Well that's the obvious thing, but for the life of me I don't know why. I have other code that links with a few non-default libraries, and these are found fine. I searched my SDKs, and all of them have the library in question. Very weird.

          Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

          1 Reply Last reply
          0
          • L Lost User

            Hi, Have you tried using CoInitializeEx? [Determining Supported COM APIs (Windows CE 5.0) | Microsoft Learn](https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms862136(v=msdn.10))

            C Offline
            C Offline
            charlieg
            wrote on last edited by
            #5

            Give that man a cigar! It had to be something stupid like that - I didn't pick up on that because if I hit :: - OleInitialize is actually in the popup. I guess it's in a header file but not in the binary. Thank you

            Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

            L 1 Reply Last reply
            0
            • C charlieg

              Give that man a cigar! It had to be something stupid like that - I didn't pick up on that because if I hit :: - OleInitialize is actually in the popup. I guess it's in a header file but not in the binary. Thank you

              Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Charlie,

              charlieg wrote:

              I guess it's in a header file but not in the binary. Thank you

              You are welcome.

              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