[cfe-dev] Workaround for #import

via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 3 07:10:05 PDT 2018


Hey Kim,

your idea worked! Thank you a lot!

Kind regards
Björn



From:   Kim Gräsman <kim.grasman at gmail.com>
To:     bjoern.gaier at horiba.com
Cc:     Clang Dev <cfe-dev at lists.llvm.org>
Date:   23.03.2018 18:20
Subject:        Re: [cfe-dev] Workaround for #import



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



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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180403/9d93650f/attachment.html>


More information about the cfe-dev mailing list