gcc (tdm64-1) 10.3.0 - undefined reference to `IID_IPropertySetStorage'

20 Views Asked by At

I'm trying to compile a Microsoft sample code from MSDN with GCC, but the linker can't find a definition.

I'm using the compiler "g++ (tdm64-1) 10.3.0".

The source code is "WriteRead.cpp" from https://learn.microsoft.com/pt-br/windows/win32/stg/writeread-sample.

Into the source the compile command line suggested is "cl /GX WriteRead.cpp". But as I'm trying to build with GCC, I have changed it to "g++ -m64 WriteRead.cpp -o WriteRead.exe -luser32 -lkernel32 -lOle32".

That's when I got the error:

C:/DESENV/TDM-GCC-64_v10.3.0/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\WillianBR\AppData\Local\Temp\ccJrTAQs.o:WriteRead.cpp:
(.rdata$.refptr.IID_IPropertySetStorage[.refptr.IID_IPropertySetStorage]+0x0): 
undefined reference to `IID_IPropertySetStorage'
collect2.exe: error: ld returned 1 exit status

The StgCreateStorageEx function define this parameter as being "REFIID riid".

[in] riid

A value that specifies the interface identifier (IID) of the interface pointer to return. This IID may be for the IStorage interface or the IPropertySetStorage interface.

Does anyone has a hint about this issue?

Build the Microsoft sample with GCC x64.

0

There are 0 best solutions below