[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
argp, strndup and MinGW
From: |
Daniel Martin |
Subject: |
argp, strndup and MinGW |
Date: |
Thu, 19 Oct 2006 15:31:52 +0100 |
Hi,
Basically I want to use argp but I also want to produce windows
binaries. So I need to use gnulib. I've been trying to cross-compile
from ix86-pc-linux-gnu to i386-mingw32.
I've been having some problems:
1.
/bin/sh ../../libtool --tag=CC --mode=compile i386-mingw32-gcc -DHAVE_CONFIG_H
-I. -I../../../../gnulib/src -I../.. -I/usr/local/i386-mingw32/include -c
-o argp-parse.lo ../../../../gnulib/src/argp-parse.c
i386-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../../../gnulib/src -I../..
-I/usr/local/i386-mingw32/include -c ../../../../gnulib/src/argp-parse.c
-DDLL_EXPORT -DPIC -o .libs/argp-parse.o
../../../../gnulib/src/argp-parse.c:872: error: conflicting types for
'argp_parse'
../../../../gnulib/src/argp.h:413: error: previous declaration of 'argp_parse'
was here
../../../../gnulib/src/argp-parse.c:872: error: conflicting types for
'argp_parse'
../../../../gnulib/src/argp.h:413: error: previous declaration of 'argp_parse'
was here
make[4]: *** [argp-parse.lo] Error 1
I can work around this though but editing argp.h:410-413 and removing
the names of the arguments. But of course this isn't really the
_correct_ way to fix this problem.
2.
First this warning crops up:
/bin/sh ../../libtool --tag=CC --mode=compile i386-mingw32-gcc -DHAVE_CONFIG_H
-I. -I../../../../gnulib/src -I../.. -I/usr/local/i386-mingw32/include -c
-o argp-help.lo ../../../../gnulib/src/argp-help.c
i386-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../../../gnulib/src -I../..
-I/usr/local/i386-mingw32/include -c ../../../../gnulib/src/argp-help.c
-DDLL_EXPORT -DPIC -o .libs/argp-help.o
../../../../gnulib/src/argp-help.c: In function `argp_doc':
../../../../gnulib/src/argp-help.c:1498: warning: assignment makes pointer from
integer without a cast
Which seems strange, but is just a warning. However when it tries to
link my executable together:
/bin/sh ../libtool --tag=CXX --mode=link i386-mingw32-g++
-I/usr/local/i386-mingw32/include -L/usr/local/i386-mingw32/lib -lglut -lglu32
-lopengl32 -o plasma.exe plasma-arguments.o plasma-complex.o plasma-fourier.o
plasma-gl_draw.o plasma-interface.o plasma-imaginary.o plasma-main.o
plasma-ode_solver.o plasma-simulation.o guis/libguis.la ../gnulib/src/libgnu.la
mkdir .libs
i386-mingw32-g++ -I/usr/local/i386-mingw32/include -o plasma.exe
plasma-arguments.o plasma-complex.o plasma-fourier.o plasma-gl_draw.o
plasma-interface.o plasma-imaginary.o plasma-main.o plasma-ode_solver.o
plasma-simulation.o -L/usr/local/i386-mingw32/lib guis/.libs/libguis.a
-L/usr/local/i386-mingw32//lib -lwx_base-2.6-i386-mingw32
-lwx_base_net-2.6-i386-mingw32 -lwx_msw_core-2.6-i386-mingw32
-lwx_msw_adv-2.6-i386-mingw32 -lwx_msw_gl-2.6-i386-mingw32
../gnulib/src/.libs/libgnu.a -lglut -lglu32 -lopengl32
guis/.libs/libguis.a(libwxwidgetsgui_la-main.o): In function
`_Z7wx_mainP9arguments':
../../../../../src/guis/wxwidgets/main.cpp:11: undefined reference to
`wx_main(int, char**)'
../gnulib/src/.libs/libgnu.a(argp-help.o):argp-help.c:(.text+0x21cd): undefined
reference to `_strndup'
collect2: ld returned 1 exit status
make[3]: *** [plasma.exe] Error 1
When I run strndup.c and argp-help.c through i386-mingw32-cpp they both
reference/implement strndup and not _strndup. So I don't understand what
is causing this. I would assume it's related to the warning though.
There is an additional warning that probably isn't related:
/bin/sh ../../libtool --tag=CC --mode=compile i386-mingw32-gcc -DHAVE_CONFIG_H
-I. -I../../../../gnulib/src -I../.. -I/usr/local/i386-mingw32/include -c
-o printf-args.lo ../../../../gnulib/src/printf-args.c
i386-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../../../gnulib/src -I../..
-I/usr/local/i386-mingw32/include -c ../../../../gnulib/src/printf-args.c
-DDLL_EXPORT -DPIC -o .libs/printf-args.o
../../../../gnulib/src/printf-args.c: In function `printf_fetchargs':
../../../../gnulib/src/printf-args.c:82: warning: `wint_t' is promoted to `int'
when passed through `...'
../../../../gnulib/src/printf-args.c:82: warning: (so you should pass `int' not
`wint_t' to `va_arg')
../../../../gnulib/src/printf-args.c:82: note: if this code is reached, the
program will abort
Perhaps the solution to these problems is obvious, but as they appear to
be due to the PreProcessor (which I avoid) I can't see a solution.
Any help would be greatly appreciated.
Thanks for your time,
Daniel.
PS: I'm not subscribed to this list so could you CC me replies or
something?
- argp, strndup and MinGW,
Daniel Martin <=