--- In anthemion-devtools%40yahoogroups.com">anthemion-devtools
yahoogroups.com, David Mathews
<grnbriar
...> wrote:
>
> Porting an app to Linux I have to make a static lib to link to the DB
> app.
> This was a windows support only app, so no unix makefile.
> I have already built it on the Mac using Xcode to just grab all the
> source files and make a static lib. Worked fine.
>
> On Linux, I used DB to make a makefile with all the source files,
> then hand altered to just leave the compile for each source file and
> added the ar command instead of the g++ link step.
>
> But none of the source files will compile. The first ones are the
> zlib files that I have compiled into many apps on windows and the
> Mac. Compiling the first one gives me this error:
>
>
> grnbriar
Dads-linux:/Devel/cximage580_src$ make -f MakefileMine
> g++ -c -o ReleaseGTK2/adler32.o -I"./CxImage" -I"./jpeg" -I"./tiff" -
> I"./zlib" -O -Wall zlib/adler32.c
> zlib/adler32.c:21: error: ‚uLong adler32‚ redeclared as different
> kind of symbol
> zlib/zlib.h:821: error: previous declaration of ‚uLong adler32(uLong,
> const Bytef*, uInt)‚
> zlib/adler32.c:21: error: ‚adler‚ was not declared in this scope
> zlib/adler32.c:21: error: ‚buf‚ was not declared in this scope
> zlib/adler32.c:21: error: ‚len‚ was not declared in this scope
> zlib/adler32.c:25: error: expected unqualified-id before ‚{‚ token
>
> zlib.h:821
> ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt
> len));
>
> adler32.c:21
> uLong ZEXPORT adler32(adler, buf, len)
> uLong adler;
> const Bytef *buf;
> uInt len;
> {
>
> from zconf.h
> # define ZEXPORT
> # define ZEXTERN extern
>
> # define OF(args) args
>
>
> Looks the same to me!
> Compiles everywhere else fine.
> Is there an additional flag I need to use old style C params in a .c
> file with g++??
>
> David
>
Hi!
It would be easier to tell what is going on with a .pjd and hand coded
sources...
If you need a good reference for GNU make, compilers, libs see:
Links > GNU GCC and Make > :
GCC and GNU Make
GNU glibc application
GNU glibc system
at wxMS_developers. These are zip archives of the .pdf for each.
HTH:
thx,
Dave S.
wxMS_developers - Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/
wxWidgets Code Exchange
http://www.wxCodex.net/
.