From: Dmitry B. <db...@ma...> - 2001-10-17 16:34:51
|
I use MinGW integrated into cygwin distribution. Now I am trying to build mingw application that uses MSVC-compiled tcl/tk binary library: gcc -mno-cygwin -o <something> -Lc:/tcl/lib -ltcl80.a -ltk80.a (of course, libtcl80.a and libtk80.a were properly generated and placed there) but gcc linkes *cygwin* libraries /usr/lib/libtcl80.a and /usr/lib/libtk80.a (and the resulting application then crashes, no surprise). But if I remove libtcl80.a & libtk80.a from /usr/lib, everything goes fine. In both cases gcc is quite happy -- no error messages at all. I browsed gcc's specs file -- it'seems to be OK and /usr/lib is not specified there for -mno-cygwin linking. What can be a problem? Is there any workaround? Hope to hear from you soon, Dmitry |
From: Earnie B. <ear...@ya...> - 2001-10-17 18:59:33
|
Dmitry Bely wrote: > > I use MinGW integrated into cygwin distribution. Now I am trying to build > mingw application that uses MSVC-compiled tcl/tk binary library: > This cause a different issue. > gcc -mno-cygwin -o <something> -Lc:/tcl/lib -ltcl80.a -ltk80.a > The -L is supposed to be found first. The problem is probably the c:/tcl/lib that is assigned to it. Since you're using Cygwin's GCC then it will understand Cygwin path nomenclature so -L/cygdrive/c/tcl/lib or `mkdir /tcl && mount -b c:/tcl /tcl' then use -L/tcl/lib. > (of course, libtcl80.a and libtk80.a were properly generated and placed > there) > > but gcc linkes *cygwin* libraries /usr/lib/libtcl80.a and > /usr/lib/libtk80.a (and the resulting application then crashes, no > surprise). But if I remove libtcl80.a & libtk80.a from /usr/lib, everything > goes fine. In both cases gcc is quite happy -- no error messages at > all. I browsed gcc's specs file -- it'seems to be OK and /usr/lib is not > specified there for -mno-cygwin linking. What can be a problem? Is there > any workaround? > The other option would be to move the files in /tcl/lib to /usr/lib/mingw/ so that the default locations for -mno-cygwin take place. Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: Dmitry B. <db...@ma...> - 2001-10-18 12:05:14
|
Earnie Boyd <ear...@ya...> writes: > > I use MinGW integrated into cygwin distribution. Now I am trying to build > > mingw application that uses MSVC-compiled tcl/tk binary library: > > This cause a different issue. > > > gcc -mno-cygwin -o <something> -Lc:/tcl/lib -ltcl80.a -ltk80.a > > > > The -L is supposed to be found first. Yes, it should. But maybe /usr/lib is the special case, that is always searched first? Impossible? > The problem is probably the > c:/tcl/lib that is assigned to it. Since you're using Cygwin's GCC then > it will understand Cygwin path nomenclature so -L/cygdrive/c/tcl/lib or > `mkdir /tcl && mount -b c:/tcl /tcl' then use -L/tcl/lib. This should not make any difference. For any cygwin.dll-based application c:/tcl/lib and /cygdrive/c/tcl/lib in the command line are equivalent: cygwin.dll will trasparenly convert all filenames in the command line to their Unix form. > > (of course, libtcl80.a and libtk80.a were properly generated and placed > > there) > > > > but gcc linkes *cygwin* libraries /usr/lib/libtcl80.a and > > /usr/lib/libtk80.a (and the resulting application then crashes, no > > surprise). But if I remove libtcl80.a & libtk80.a from /usr/lib, everything > > goes fine. In both cases gcc is quite happy -- no error messages at > > all. I browsed gcc's specs file -- it'seems to be OK and /usr/lib is not > > specified there for -mno-cygwin linking. What can be a problem? Is there > > any workaround? > > > > The other option would be to move the files in /tcl/lib to > /usr/lib/mingw/ so that the default locations for -mno-cygwin take > place. It does not help; Cygwin's /usr/lib is anyway searched first, and only then /usr/lib/mingw. You can easily check it yourself: Create test.c int main() { } then build it with "gcc -mno-cygwin test.c". Then move /usr/lib/mingw/libmsvcrt.a to /usr/lib/libmsvcrt.a and try "gcc -mno-cygwin test.c" again. Gcc (ld) will not see any difference and link /usr/lib/libmsvcrt.a. Hope to hear from you soon, Dmitry |