[cfe-dev] Workaround for #import

Kim Gräsman via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 23 10:20:27 PDT 2018


Hi Björn,

It's been a decade or two since I used #import, so I could be
misremembering, but here's an idea:

#import of x.tlb generates two files: x.tlh and x.tli. They are (heavily
VC-specific) C++ sources.

If you can get your VC build to generate those, and #include the tlh and
compile the tli as a source file in your Clang build, I think Clang
supports enough language features for it to work.

Fingers crossed,
- Kim

Den 23 mars 2018 11:42 fm skrev "via cfe-dev" <cfe-dev at lists.llvm.org>:

Hello everyone,

currently I'm converting some old visual studio projects for the use with
the clang compiler. Everything was fine, until I hit the following line:
#import <file.tlb> rename("SendMessage", "SendMessage")

Clang stop the work and complained:
error : #import of type library is an unsupported Microsoft feature

I get it - this doesn't work, but is there no workaround or another
solution for this problem?

Kind regards
Björn

Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.

_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180323/dff9a8a7/attachment.html>


More information about the cfe-dev mailing list