[cfe-dev] Compiling a simple Win32 program

Mikael Lyngvig mikael at lyngvig.org
Tue Jun 12 04:56:28 PDT 2012


Hi,

Take a look at http://lld.llvm.org.  It is the documentation for a planned
new linker which will eventually support PE-COFF as well as ELF and so on.
 I know that somebody is working on this, but it is my impression that help
is very much needed.

>From what I know, the Microsoft C++ ABI is not supported so you'll only get
away with linking trivial applications using the Microsoft linker.  If you
want to do advanced C++, you need to use the Mingw32 header files,
libraries, and linker.  I have tried all the major combinations and the
only one that works well at this time is Mingw32 and a 32-bit version of
Clang.


Cheers,
Mikael

2012/6/12 Cesar Mello <cmello at gmail.com>

> At the time I did that test, I was so excited that I didn't realize I was
> using the MS linker. That does not impact my excitment, but I'm curious if
> linkers are in the scope of LLVM, and if a Windows linker is planned.
>
> Thanks!
>
> Best regards
> Mello
>
> On Wed, Jun 6, 2012 at 10:22 AM, Cesar Mello <cmello at gmail.com> wrote:
>
>> Oh thank you so much Dmitry! It worked perfectly!
>>
>> clang -c test.cpp
>> link test.o user32.lib msvcrt.lib msvcprt.lib
>>
>> clang and llvm are awesome! Congratulations to all for the great work!!!
>>
>> Best regards
>> Mello
>>
>>
>> On Wed, Jun 6, 2012 at 8:01 AM, r4start <r4start at gmail.com> wrote:
>>
>>> On 06/06/2012 14:54, Cesar Mello wrote:
>>>
>>>> It compiles nicely, but fails to link. Please can you tell me how to
>>>> specify user32 and gdi32 libraries for the linker? Sorry if I'm being too
>>>> newbie. :-)
>>>>
>>> For example like this
>>> link test.obj user32.lib msvcrt.lib msvcprt.lib
>>>
>>>  - Dmitry Sokolov.
>>>
>>
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120612/7ac2813e/attachment.html>


More information about the cfe-dev mailing list