c++ - How to declare and link to RoInitialize,RoUninitialize,RoGetActivationFactory and HSTRING Functions in Mingw Gcc -


updated: added roinitialize looks in roapi.h

i in process of writing pure c++11 winrt library. not use wrl or c++/cx(obviously if want pure c++11).

i got code compile , run on msvc, want see if can code compile , run on mingw gcc. using gcc 4.7.2 obtained nuwen.net.

what need @ point way call windows api functions roinitialize rounitialize rogetactivationfactory , hstring functions windowscreatestring, windowsduplicatestring, windowsdeletestring.

i tried compiling program in g++ got error

extern "c"{ __declspec(dllimport)int __stdcall roinitialize(int); } int main(){     roinitialize(1); } 

i tried compile, got

c:\users\jrb\desktop>g++ gccwinrt.cpp c:\users\jrb\appdata\local\temp\ccy7y1v9.o:gccwinrt.cpp:(.text+0x1e): undefined reference `_imp__roinitialize@4' collect2.exe: error: ld returned 1 exit status 

if can point me in right direction on how declare these functions , libraries need link to, appreciate it. if required loadlibrary/getprocaddress still ok that

update: here roinitialize looks in header roapi.h

roapi _check_return_ hresult winapi roinitialize(     _in_ ro_init_type inittype );  roapi define __declspec(dllimport) _check_return_ part of sal (secure annotations language?) hresult maps int32 winapi define __stdcall ro_init_type enumeration int should cover 

the import library these functions runtimeobject.lib (which msdn documentation fails mention). can found in windows sdk windows 8.


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -