Required Library of Imapi2 for Qt with mingw compiler on windows
-
I was trying to integrate IMAPI2 sources to my qt project , i was getting following linking error.
error: undefined reference to `IID_IDiscMaster2'
error: undefined reference to `_GUID const& __mingw_uuidof()'
All these linker errors are thrown while calling cocreateinstance function which is included from combaseapi.h(linked from mingw path)
I assume it is something to be a linking error , as i am working on Qt with mingw compiler i am unable to find respective lib file or .a file for this combaseapi.h in qt compiler path.
I tried adding windows imapi2.dll but it showing file not recognized error while running qmake
-
@Harish-Chikkaraju "I was trying to integrate IMAPI2 sources to my qt project " - this is not clear to me. Do you add source code of that library to your project? Or do you use a precompiled version (dll/lib)?
"I tried adding windows imapi2.dll but it showing file not recognized error while running qmake" - please show your pro file.
-
@jsulm I added header and cpp files to the current Qt Project . and in following way i have added dll to pro
LIBS+ = ./Libs/imapi2.dllafter adding dll in this way i am getting below error.
C:\Sample\Libs\imapi2.dll:-1: error: file not recognized: File format not recognized
-
@Harish-Chikkaraju If you add the library source code there is no need to add the dll. You either do the one or the other, not both.
"C:\Sample\Libs\imapi2.dll:-1: error: file not recognized: File format not recognized" - most probably the lib was compiled using different compiler than the one you're using. On Windows you can't mix different compilers. -
@Harish-Chikkaraju You should first decide whether you want:
- Directly add IMAP2 source code to your project
- Use precompiled version of that library
You also can compile first IMAP2 library using your compiler and then add it to your project.
-
@Harish-Chikkaraju said in Required Library of Imapi2 for Qt with mingw compiler on windows:
I am unable to find the respective lib or .a file for the imapi2 package.
Then you can try to create your own import library: http://www.mingw.org/wiki/CreateImportLibraries
Another way would still be to load the library dynamically with QLibrary and to resolve the symbols at runtime. That way you are completely compiler independent.
Regards
-
@jsulm said in Required Library of Imapi2 for Qt with mingw compiler on windows:
Use precompiled version of that lib
I have only added wrapper classes and headers to use the API's like CoCreateInstance function to create a instances of IDiscMaster2, IDiscFormat2Data from imapi2 package , i dont have complete source package of imapi2.
-
@Harish-Chikkaraju Then you have to possibilities:
- Find a binary of that library built using MinGW
- Build this library by yourself using your MinGW compiler
-
Find a binary of that library built using MinGW - I have an build exe in visual studio with msvc compiler with said wrapper files.
Build this library by yourself using your MinGW compiler - Could you suggest a way to do ?
-
@Harish-Chikkaraju said in Required Library of Imapi2 for Qt with mingw compiler on windows:
Could you suggest a way to do
You should check the documentation of that library. Usually there is a description how to build the project.