as I already posted some time ago,I'm trying to build a C++ library
written for gcc for use with win32 ie make it for mingw target.(of this
library I just had headers, sources and a configure script). When I
stick to cygwin, everything goes ok, so, the headers, sources, makefiles
and configure script seem to be ok, too.
Now I though of starting the same procedure using the mno-cygwin flag
After downloading and installing the headers and libs for mingw, which
are provided on by Mumit Khan, I started as following:
export CPPFLAGS="-I/usr/local/mingw/include -mno-cygwin"
export CXXFLAGS="-I/usr/local/mingw/include -mno-cygwin"
export LDFLAGS="-L/usr/local/mingw/lib -mno-cygwin" started the
configure script and after that started 'make'
After a while of compiling I got an 'implicit declaration of getpid..'
errormessage. On cygwin, that function is declared in 'unistd.h' but the
corresponding mingw header just points to io.h (as this ' maps (roughly)
'). But io.h doesn't declare getpid.
I searched the mingw headers I had and finally found a getpid function,
in /usr/include/mingw32/process.h and included that in the unistd.h (a
desperate action, but I didn't know better) and: make continued working
and didn't stop until it came to linking, where it gave me a bunch of
strange errormessages from files of the library I was about to build
(below the command which invoked the errors and the beginning of the
/bin/sh ../libtool --mode=link c++ -I/usr/local/mingw/include
exam_I.o exam_RA.o exam_SF.o exam_FF.o exam_DF.o exam_LF.o
exam_I_gcd.o exam_I_sqrtp.o ../src/libcln.la -lm -o exam
c++ -I/usr/local/mingw/include -mno-cygwin exam.o exam_I.o exam_RA.o
exam_SF.o exam_FF.o exam_DF.o exam_LF.o exam_I_gcd.o
exam_I_sqrtp.o ../src/.libs/libcln.a -lm -o exam
../src/.libs/libcln.a(cl_asm_.o)(.text+0x4a0):fake: multiple definition
first defined here
I couldn'd relate these errors directly to the change in the
unistd-header, but I suppose so, as it works without the compilerflag. I
looked at the sources, it's true, there are some functions which are
defined two times, but there are some Preprocessor guards, too. Well
it's very complicated, so I'm a bit afraid of making more changes to the
source. So my questions is, whether someone knows of another workaround
of the problem with the missing getpid-declaration, eg is there another
version of the mingw unistd, which exactly maps to the cygwin one?
Thanks, Tilman Utz