[Mingw-w64-public] how to link msvcr100.dll

2013-06-17 Thread zhangxinghai
 hi
I write a hello world program in c
#include stdio.h
int main()
{
printf(Hello world!\n);
return 0;
}
I try to link it with msvcr100.dll,I use the ruben win32 build from
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/
rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z/download
gcc -o hello.exe main.cpp -L c:\windows\system32 -l msvcr100.dll or
gcc -o hello.exe main.cpp -Wl,-Lc:\windows\system32,-lmsvcr100.dll
Both return error
d:/mingw/mingwrubwin32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w6
4-mingw32/bin/ld.exe: cannot find -lmsvcr100.dll
How do I do that?
I also have a question,Is mingw64 crt independent of msvcrt.dll or not?I search 
the archive and a little confused about
crt.
My understanding is under windows ,the most widely used crt is msvcrt.dll,there 
are also other versions.
msvcr70,80,90,100 etc.All come from microsoft visual studio.Both mingw and 
mingw64 depend on msvcrt.
If so,when I use stdio.h,which version do I use,mingw or vs.Under windows,How 
mingw stdio.h integrate with
msvcrt.dll?Should I  use visual studio's stdio.h under windows,which I think 
must cooperate better with msvcrt than
mingw's stdio.h
Thanks


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] how to link msvcr100.dll

2013-06-17 Thread Kai Tietz
2013/6/17 zhangxinghai zxh19750...@163.com:
  hi
 I write a hello world program in c
 #include stdio.h
 int main()
 {
 printf(Hello world!\n);
 return 0;
 }
 I try to link it with msvcr100.dll,I use the ruben win32 build from
 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/
 rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z/download
 gcc -o hello.exe main.cpp -L c:\windows\system32 -l msvcr100.dll or
 gcc -o hello.exe main.cpp -Wl,-Lc:\windows\system32,-lmsvcr100.dll
 Both return error
 d:/mingw/mingwrubwin32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w6
 4-mingw32/bin/ld.exe: cannot find -lmsvcr100.dll
 How do I do that?
 I also have a question,Is mingw64 crt independent of msvcrt.dll or not?I
 search the archive and a little confused about
 crt.
 My understanding is under windows ,the most widely used crt is
 msvcrt.dll,there are also other versions.
 msvcr70,80,90,100 etc.All come from microsoft visual studio.Both mingw and
 mingw64 depend on msvcrt.
 If so,when I use stdio.h,which version do I use,mingw or vs.Under
 windows,How mingw stdio.h integrate with
 msvcrt.dll?Should I  use visual studio's stdio.h under windows,which I think
 must cooperate better with msvcrt than
 mingw's stdio.h
 Thanks

You should simply use -lmsvcr100 option.  Why you specify here .dll?

Kai

PS: To avoid indirect dependencies to default-runtime msvcrt.dll you
might want to link libgcc/libstdc++/etc static.  You can achieve this
by specifying -static option.

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] how to link msvcr100.dll

2013-06-17 Thread Ruben Van Boxem
2013/6/17 zhangxinghai zxh19750...@163.com

  hi
 I write a hello world program in c
 #include stdio.h
 int main()
 {
 printf(Hello world!\n);
 return 0;
 }
 I try to link it with msvcr100.dll,I use the ruben win32 build from

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/

 rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z/download
 gcc -o hello.exe main.cpp -L c:\windows\system32 -l msvcr100.dll or
 gcc -o hello.exe main.cpp -Wl,-Lc:\windows\system32,-lmsvcr100.dll
 Both return error

 d:/mingw/mingwrubwin32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w6
 4-mingw32/bin/ld.exe: cannot find -lmsvcr100.dll
 How do I do that?


Link like this:
gcc -o hello.exe main.cpp -L c:\windows\system32 -l msvcr100


I also have a question,Is mingw64 crt independent of msvcrt.dll or not?I
 search the archive and a little confused about
 crt.


No. The MinGW-w64 CRT is basically msvcrt extended with C99 stuff and
improvements where MS' library is lacking in speed or functionality.


 My understanding is under windows ,the most widely used crt is
 msvcrt.dll,there are also other versions.
 msvcr70,80,90,100 etc.All come from microsoft visual studio.Both mingw and
 mingw64 depend on msvcrt.
 If so,when I use stdio.h,which version do I use,mingw or vs.Under
 windows,How mingw stdio.h integrate with
 msvcrt.dll?Should I  use visual studio's stdio.h under windows,which I
 think must cooperate better with msvcrt than
 mingw's stdio.h


msvcrt.dll is used by virtually every application in Windows. It will be
pulled in nearly always. Even if built with VS 2012, an app will in all
likelihood also indirectly depend on msvcrt.dll.

Wrt. stdio.h, this is one of those aspects that MinGW-w64 extends in
functionality and usefulness, if you want it.

See e.g.
http://sourceforge.net/apps/trac/mingw-w64/wiki/printf%20and%20scanf%20family

MinGW-w64 is not less compatible on Windows. Often, GCC beats MSVC at
compiled math code (see the blender MinGW-w64:
http://www.graphicall.org/dobz, unfortunately, the nice graph showing the
achieved speedup has since been removed :(

Ruben



 Thanks






 --
 This SF.net email is sponsored by Windows:

 Build for Windows Store.

 http://p.sf.net/sfu/windows-dev2dev
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Regression in trunk regarding InterlockedCompareExchange

2013-06-17 Thread Jacek Caban
On 06/16/13 11:42, Erik van Pienbroek wrote:
 Erik van Pienbroek schreef op vr 14-06-2013 om 19:28 [+0200]:
 For now I've managed to workaround the regression by partially reverting
 r5713. This change makes intrincs/ilockcxch.c part of libmingwex instead
 of libkernel32 (as it was before r5713). I'm using this patch now in the
 Fedora mingw-w64 toolchain where it will be used until a proper solution
 has come up.
 Unfortunately a similar issue has also started to show up on the x86_64
 target. As of r5898 shared libraries (which are generated without an
 explicit .def file) start to export the symbol __mingw_get_msvcrt_handle
 as can be seen with this minimal testcase:

 $ touch foo.c 
 $ cat foo.c
 $ x86_64-w64-mingw32-gcc -shared foo.c -o foo.dll
 $ x86_64-w64-mingw32-objdump -p foo.dll | grep -A2 '\[Ordinal/Name
 Pointer\] Table'
 [Ordinal/Name Pointer] Table
   [   0] __mingw_get_msvcrt_handle


 In Fedora we've also reversed this specific commit (r5898) for now until
 a proper solution comes up.


I committed a fix for that (r5912). Thanks for the report.

Jacek

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] WIDL feature requests

2013-06-17 Thread Geoffroy Couprie
Hi,

I am currently working on writing the IDL files for new WinRT interfaces
(mostly Windows.Storage and Windows.Foundation for now), and there are a
few things I would need to make it work. Right now, I can comment out the
problematic argument types and replace them with IInspectable (after all,
they're all just pointers), but it would be useful for future idl writing
to implement those features:

# Struct declaration

When I declare structs at the beginning of the file, like:
namespace Windows {
  namespace Foundation {
struct Datetime;
  }
}

It works if I define the struct later, but not if I am importing the struct
from another idl, with the message: error: syntax error, unexpected ';',
expecting '{'

If I don't declare it in the importing file, I can still use the type
without any problem, though.

# Delegates
Some interfaces are declared as delegate, like this:
namespace Windows { namespace Foundation { delegate TypedEventHandler; } }

It looks like they are interfaces inheriting from IUnknown with the method
HRESULT Invoke().

# Templates
New interfaces with parametric types were introduced. They are defined like
this:
generictypename TResult
interface IAsynOperation : AsyncInfo {
  [propput] HRESULT Completed(AsyncActionCompletedHandler* handler);
  [propget] HRESULT Completed(AsyncActionCompletedHandler** handler);
  TResult* GetResults();
}

And when it is used in another IDL file, it is declared like this:
interface Windows.Foundation.IAsyncOperationHSTRING;

And used directly like this: Windows.Foundation.IAsyncOperationHSTRING

No C headers are generated for this, only C++ headers, using templates.
This is probably the most complex part to implement (a lot of C++ classes
are defined to make this work).

# Cyclic dependencies
Some interfaces can depend on one another, like IAsyncAction and
AsyncActionCompletedHandler:

interface IASyncAction : IInspectable {
  [propput] HRESULT Completed(AsyncActionCompletedHandler* handler);
  [propget] HRESULT Completed(AsyncActionCompletedHandler** handler);
  HRESULT GetResults();
}

interface AsyncActionCompletedHandler : IUnknown {
  HRESULT Invoke(IAsyncAction *asyncAction, AsyncStatus status);
}

Right now, it fails with the message: error: write_ip_tfs: interface
IAsyncAction missing UUID

# Empty interfaces
I don't know if I read the documentation wrong, but for
Windows.Foundation.Collections.IPropertySet, there are no methods defined
(because it inherits methods from two other interfaces. So if I declare it
like this (I know it inherits directly from something else than
IInspectable):
interface IPropertySet : IInspectable {
}

and here is the message I get: error: syntax error, unexpected $end,
expecting '{'

I have tried to patch widl, but my parser fu is not very strong :(

I'm willing to test any patch for these features, though.

Best regards,

-- 
Geoffroy Couprie

http://geoffroycouprie.com
http://pilotssh.com
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public