VC ++ #import directive for GCC / g ++

I am trying to check out a library that provides a VC ++ example; however, I use gcc / g ++ for all of my projects.

Well, as an example, VC ++ accesses the library, it uses the #import directive , passing the location of the DLL, and then uses the LIBRARYNAME namespace , and then it can create some type undefined (I would assume that it is defined in the DLL) and create new instance of it using __uuidof. From now on, to call one of the library functions, the example simply executes createdObj-> foo () and what it is.

Well ... g ++ #import is different than importing VC ++ (see here ), so this example will not work for me.

Can this be converted to compilation under g ++, or am I SOL until the library developer gives me a static library that I can try?

+3
source share
3 answers

If you are using cygwin, then this page: http://www.cygwin.com/cygwin-ug-net/dll.html will provide you with all the help you need.

If you use mingw, you can do the same thing, but you probably won't have grep and sed, so you have to use some other filtering method to get your .def file.

+2
source

, OLEViewer " ", IDL. , , V++ .tlh .tli g++.

, , , . , .

.

+2

If you used #importVC ++, it means that the DLL is not a regular DLL, it is a COM library.

Since gcc does not support COM, you just need to wait until the author of the library writes a non-COM version.

+1
source

Source: https://habr.com/ru/post/1711367/


All Articles