[SOLVED] OLE Issue Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

[SOLVED] OLE Issue

Post by dcbdbis »

Good Morning All,

Am doing a recompile of a client's app under windows. NOT cross-compiling under Linux. Win Server 2019, copied my app's code from Linux to the Windows VM.

I built wxWidgets with:

Code: Select all

mingw32-make SHELL=CMD.exe -j8 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1
Obviously I had to change some settings in my CodeBlocks build options for different locations for includes, libraries, etc.

When I compile my app (fairly large) - it compiles just fine. At link time - I am getting this error:

Code: Select all

undefined reference to `__imp_OleInitialize'
When I built wxWidgets - I didn't mention OLE anywhere. I reviewed the nice docs posted at the top of this thread's category - and found nothing about building wxWidgets with OLE.

I would appreciate some pointers - I am NOT a Windows guy nor am I a fan. Just following my client's instructions. I'm missing something obvious to a Windows dev.

Dave
Server 2019
CodeBlocks 20.03 with the bundled ming compiler suite
wxWidgets 3.1.4 (built from source using the ming compiler suite)
Last edited by dcbdbis on Wed Feb 24, 2021 7:29 pm, edited 3 times in total.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: OLE Issue

Post by PB »

While you may not use any OLE directly, wxWidgets does.

You need to add ole32 import library to your linker settings in the root item of your build targets. You may also need more Windows libraries, your list should look something like this:
cb-winlibs.png
cb-winlibs.png (31.61 KiB) Viewed 2771 times
It is easy just to google the function name (e.g., OleInitialize here) and MS docs will tell you which library the function is in.

And as always, with GCC the library order matters.
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: OLE Issue

Post by dcbdbis »

Thank you for the reply,

I figured it was something basic to Windows....I'll look for the library on my system....

I'll then report back with what I found and what I did - and if there are any further questions.

Thank you again, I do appreciate it...

Dave
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: OLE Issue

Post by PB »

dcbdbis wrote: Wed Feb 24, 2021 5:10 pm I'll look for the library on my system....
You do not have to look for the library, it is shipped with your MinGW. You just need to tell CodeBlocks to use it, as shown in my previous post.
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: OLE Issue

Post by dcbdbis »

AH - that's what I was doing next...Looking for the library.....

Thank you. I'll report back once everyhting is working...

D
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: [SOLVED] OLE Issue

Post by dcbdbis »

While I am not through parsing through the linker errors - I am off of the dime and moving forward, and now know where to go to find the various libraries I need.

I thank you very much for the assistance....



D
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: OLE Issue

Post by dcbdbis »

Looks like I "Solved" too early. I've worked through several linker erros and am now at this:

Code: Select all

IID_IPersistFile
Per the MS Doc link I was given, this resolves to objidl......I have no such library...I have an "h" file - but no library.

Does this mean I need to include it in my project? or Something different?

Thanks!

D

EDIT: Including the "h" file in the project doesn't resolve the issue.....
Last edited by dcbdbis on Wed Feb 24, 2021 7:05 pm, edited 1 time in total.
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: OLE Issue

Post by dcbdbis »

My linker settings..
Capture.PNG
Capture.PNG (43.1 KiB) Viewed 2745 times
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OLE Issue

Post by ONEEYEMAN »

Hi,
Can you copy&paste the exact error message?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: OLE Issue

Post by doublemax »

You need not only the libole* ones, you need *all* libs that are shown on PB's screenshot. E.g. IID_IPersistFile is inside libuuid

And you shouldn't need absolute paths either, as they are integral part of MinGW.
Use the source, Luke!
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: OLE Issue

Post by dcbdbis »

@doublemax...

Thank you for the clarification. I was trying to add only the libs that the linker was complaining about. I didn't know I needed all that was shown.

Thank you. I have downloaded the pic.

Question: How did you know it was inside libuuid? This was not in the MS docs previously linked in this thread (which was for sure very helpful)...


Thanks!

D
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: OLE Issue

Post by doublemax »

dcbdbis wrote: Wed Feb 24, 2021 7:23 pm Question: How did you know it was inside libuuid? This was not in the MS docs previously linked in this thread (which was for sure very helpful)...
In most cases googling for "msdn <unresolved symbol name>" does the trick
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: OLE Issue

Post by ONEEYEMAN »

Hi,
Also I believe using latest C::B version will add them for you and you will not need to do that.

Thank you.
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: OLE Issue

Post by dcbdbis »

OK- I have egg on my face.

Thank you , all of you for the assistance. If I would have looked down a tad further on the page - the library name was on the MSDN pager.

My apologies.

But again - THANK YOU!

D
dcbdbis
Experienced Solver
Experienced Solver
Posts: 80
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: [SOLVED] OLE Issue

Post by dcbdbis »

I want to thank all of those who responded. Sincerely so.

My large application (one years worth of work) now runs under Linux (the main target OS), and Windows.

Thank You!

D
Post Reply