[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trying to build with MinGW under cygwin, but no luck, can't find dl
Re: trying to build with MinGW under cygwin, but no luck, can't find dllcrt2.o
Fri, 02 Jun 2006 08:13:38 -0700
Ed Hartnett wrote:
First, a note: the Cygwin list generally does not like to field
questions about -mno-cygwin because when doing so you are using another
project's toolchain, and so it's kind of off-topic. However, I think
your problem is actually build-environment related and not gcc related,
so I will continue, with reply-to set to the libtool list.
> I am trying to build my libtool-based library package on Cygwin, with
> the -mno-cygwin option.
> However, I am getting the following problem:
> libtool: link: cc -shared .libs/attr.o .libs/ncx.o .libs/putget.o
> .libs/dim.o .libs/error.o .libs/libvers.o .libs/nc.o .libs/string.o
> .libs/v1hpg.o .libs/var.o .libs/posixio.o -Wl,--whole-archive
> ./.libs/libnetcdf2.a ../fortran/.libs/libnetcdff.a
> -Wl,--no-whole-archive -mno-cygwin -o .libs/cygnetcdf-1.dll
> -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker
> /usr/bin/ld: dllcrt2.o: No such file: No such file or directory
> collect2: ld returned 1 exit status
> make: *** [libnetcdf.la] Error 1
> make: Leaving directory `/cygdrive/c/netcdf-3/libsrc'
> make: *** [all-recursive] Error 1
> make: Leaving directory `/cygdrive/c/netcdf-3'
> make: *** [all] Error 2
> I am trying to figure out what is wrong. Does anyone have an easy
> answer for me?
Something here looks rather broken. First, a non-cygwin DLL should
never be named "cygnetcdf-1.dll" because the prefix "cyg" is
specifically used for this purpose, i.e. so that they are never found by
non-Cygwin apps. A mingw DLL should be named libnetcdf-1.dll. So this
makes me think libtool is confused and thinks you're trying to build a
Second, dllcrt2.o is a mingw startup file and should be present in
/usr/lib/mingw. If not then you certainly have an installation
problem. Confirm that you can compile and link a hello world program
with "gcc -mno-cygwin" before continuing.
It would help if you would post more details, such as how you configured
the package. When trying to build a mingw package under Cygwin you are
in effect cross compiling, so the configury should probably look
something like the following, although there are many ways to skin a
./configure --host=i686-pc-mingw32 --build=i686-pc-cygwin CC="gcc
(And if you use C++ then CXX="g++ -mno-cygwin", and so on.)