2

So have a user interface that I wrote using MinGW QT. In the UI I'm trying to reference objects from my Visual Studio project. Some objects I can reference and use just fine, but the one I'm having problems with uses a 3rd party COM object.

These are the errors I'm getting:

undefined reference to 'CoInitialize@4' undefined reference to 'CoCreateInstance@20' 

I've read that you can't easily mix MinGW and VS libraries. The catch is, Some of the GUI libraries I'm using only compile with MinGW, so I can't just change QT to use the Microsoft compiler.

Is there any way I can get it to recognize these functions, or am I going to end up having to rewrite everything?

I've tried including the 3rd party dll in the .pro file, but that doesn't fix anything.

2 Answers 2

1

Those are linking errors, you just need to link with whatever lib has the COM functions (ole32 according to a quick google). You can probably call code in a dll compiled with msvc from mingw, as long as it's C code not C++ though.

Sign up to request clarification or add additional context in comments.

Comments

0

MSVC and MinGW are not ABI compatible, so you need to compile all modules with same compiler to avoid this kind of problems.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.