I am trying to connect a C ++ project to Qt (no Qt own libraries are used), the ole32 and oleaut32 libraries from the windows SDK set.

LIBS += -lole32 LIBS += -loleaut32 

Libraries (.lib) are in the project directory, he sees them, he seems to see the same functions from them. But it produces ~ 1000 errors in .h files of libraries. Apparently these are compiled into msvc, qt works through mingw, that's the problem (as it seems to me). Is there any way to still connect them without errors using Qt? Maybe you need to connect not the lib and the dll files? Or do they also depend on the compiler? Knowledge in this area is lacking, apparently I missed something important

  • Can there be tools for recompiling MSCV in MinGW? - KaraUL

2 answers 2

.dll or .lib depends on the linking method. If you are not sure, then most likely, it is dynamic, which means .dll

Try to add more

 LIBS += -lole32 -luuid 

Well, besides, when transferring a project from the studio to QtCreator and changing the compiler, many of the things that the old compiler has swallowed will not be accepted by MinGW. We'll have to redo the code. QtCreator, if I'm not mistaken, will output errors and warnings file-by-file. That is, not all errors in the project immediately, but file by file

  • I tried to add -luuid - nothing has changed. Now I noticed that all the errors in the oleauto.h file, that is, only the second library has jambs. And so I have both files and lib and dll for each of the libraries - KaraUL
  • And to the second LIBS actually tried to add it? Those. LIBS += -loleaut32 -luuid - Matty
  • Yes, I tried it of course. Do you really come across people who need to explain everything step by step and literally?) Nevertheless, thanks for the meticulousness, because of the option, except through dlltool, to make a dantool mingv out of dll. - KaraUL

It may be useful and maybe not. If you need to import external libraries and files into projects, it is very convenient to use the already existing Qt import function. Right-click on the project-> Add library-> Add external library-> path to lib. The most convenient is that the path to the pro file will be spelled correctly.

  • Yes, I tried it this way, but when choosing the path to Libe, it became red, and the "Next" button became inactive) did not understand - KaraUL
  • This is only a .lib campaign, that is, for dynamic linking, it does not roll - stiv