|
From: yuan z. <tsi...@gm...> - 2010-12-06 09:54:12
|
Hi, Keith.
Thanks for your detailed and patient replay.I have fixed my bug
through your prompt!
2010/12/4 Keith Marshall <kei...@us...>
> On Saturday 04 December 2010 06:31:19 yuan zheng wrote:
> > I find that there are two libraries named libkernel32.lib and
> > libmsvcrt.lib in MinGW/lib/ ...
>
> There should not be; these should be libkernel32.a and libmsvcrt.a
> respectively.
>
> As you said, these should be .a files. I'm sorry for that I wrote the
wrong file name due to my carelessness.
> meanwhile, there are two libraries named kernel32.dll and msvcrt.dll
> > in win32(windows/system32).
>
> Correct.
>
> > When I link libraries with "-lkernel32 -lmsvcrt", it will link the
> > win32 libraries because the shared libraries' priority is higher.
>
> No, it will not; the win32 system DLL path is not (normally) included in
> the linker's search path. What the linker will use is the above named
> pair of *import* libraries -- the .a variants -- which cause dynamic
> linking to the system DLLs, at run time.
>
> Yes, this is my fault. I add the "c:/windows/system32/" into my index path.
And I want to confirm a point: I consider that it will choose the dynamic
library if
there is a dynamic library and a static library with the same name in the
same path.
I think it's right, do you think so?
> BTW, if you really do have libkernel32.lib and libmsvcrt.lib, the use
> of -lkernel32 and -lmsvcrt will *not* cause them to be linked anyway,
> because they are inappropriately named; see the binutils documentation
> for ld, for the actual naming conventions which are applicable.
>
>
Furthermore, if you are using gcc/g++ and friends correctly, rather than
> misusing ld directly for linking, then *you* don't need to specify the
> -lkernel32 or -lmsvcrt; they are automatically specified by the linker
> driver itself.
>
> > But actually, I want to link libkernel32.lib and libmsvcrt.lib.
>
> Why? If they are the .a import libraries we provide, then they link
> dynamically to the system DLLs anyway. If they are anything else, then
> they are likely not compatible with MinGW in any case.
>
> > And in my link options there are some shared libraries, so I can't use
> > the "-static" link option.
>
> If you really must override dynamic linking for a subset of libraries,
> refer to the ld documentation for the -Bdynamic and -Bstatic options,
> (specified through GCC as -Wl,-Bdynamic and -Wl,-Bstatic).
>
> --
> Regards,
> Keith.
>
> Thank you for your help again.
thanks,
yuanzheng.
>
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to
> build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> MinGW-users mailing list
> Min...@li...
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same. Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also: mailto:min...@li...?subject=unsubscribe
|