Problems in compiling zlib into my app (using mingw + msys)

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Problems in compiling zlib into my app (using mingw + msys)

sowiso
Hi,

I'm new in this here, so please bear with me.

I'm trying to _compile in_ zlib support into my app, and to basically
understand this, I've tried to compile the zpipe.c (
http://www.zlib.net/zpipe.c ) sample application but I only get error
messages about not found references to _deflateInit_ etc:

Scouring the net, I've also found out about mingwPORT of zlib, *but* I
think this is mainly for *building* zlib. But I do not want to build
zlib.but_compile it in_!

Eventually, I did decide to fire a 'sh' onto the mingwPORT.sh and got a
working libzdll.a (resp. libz.dll.a) and also the other components were
there. However, the linker does not find them and there is no
"ldconfig -v" which would have solved my problems.

In the wiki, I also found an information
that it can be necessary to store some paths in the registry like
include and library path, but even this did not do the trick.

BTW, I'd loved to install both MingW and MSYS into the same directory,
so that they share one /bin directory, however, I read this is not
recommended. (However, it would make things neater and easier)

LIBRARY_PATH would be a possible culprit. But export'ing it to
$LIBRARY_PATH;/mingw/lib did not do the trick either, unfortunately.

I'll appreciate any help on this....

-Andreas

P. S. I attached the VERBOSE output of the gcc line I used...
Interesting is that it says something about "non-existing directory
/mingw/include", however, I can say that
ls -al  /mingw/include
will output the correct .h file list with no error messages at all.

$ gcc -v -o z1 -lzdll zlibsample.c
Using built-in specs.
Target: mingw32
Configured with:
../gcc-4.3.0/configure --enable-languages=c,ada,c++,fortran,java,objc,ob
j-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enable
-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug
 --enable-concept-checks --enable-version-specific-runtime-libs --build=
mingw32 --with-bugurl=http://www.mingw.org/bugs.shtml --prefix=/mingw --
with-gmp=/mingw/src/gcc/gmp-mpfr-root --with-mpfr=/mingw/src/gcc/gmp-mpf
r-root --with-libiconv-prefix=/mingw/src/gcc/libiconv-root
Thread model: win32
gcc version 4.3.0 20080305 (alpha-testing) mingw-20080502 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'z1.exe' '-mtune=i386'

e:/devel/mingw32/bin/../libexec/gcc/mingw32/4.3.0/cc1.exe -quiet -v -ipr
efix e:\devel\mingw32\bin\../lib/gcc/mingw32/4.3.0/
zlibsample.c -quiet -dumpbase zlibsample.c -mtune=i386 -auxbase
zlibsample -version -o C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp/cc21xx0V.s
ignoring nonexistent directory
"e:\devel\mingw32\bin\../lib/gcc/mingw32/4.3.0/../../../../mingw32/inclu
de"
ignoring nonexistent directory "/mingw/include"
ignoring nonexistent directory
"e:/devel/mingw32/lib/gcc/../../lib/gcc/mingw32/4.3.0/../../../../mingw3
2/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 e:\devel\mingw32\bin\../lib/gcc/mingw32/4.3.0/../../../../include
 e:\devel\mingw32\bin\../lib/gcc/mingw32/4.3.0/include
 e:\devel\mingw32\bin\../lib/gcc/mingw32/4.3.0/include-fixed
 e:/devel/mingw32/lib/gcc/../../include
 e:/devel/mingw32/lib/gcc/../../lib/gcc/mingw32/4.3.0/include
 e:/devel/mingw32/lib/gcc/../../lib/gcc/mingw32/4.3.0/include-fixed
End of search list.
GNU C (GCC) version 4.3.0 20080305 (alpha-testing) mingw-20080502
(mingw32)
        compiled by GNU C version 4.3.0 20080305 (alpha-testing)
mingw-20080502, GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=99 --param
ggc-min-heapsize=131005
Compiler executable checksum: 1a6d13bee46ae6726d6d2b400c936f40
COLLECT_GCC_OPTIONS='-v' '-o' 'z1.exe' '-mtune=i386'
 as -o C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp/cc1ORmj9.o
C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp/cc21xx0V.s
COMPILER_PATH=e:/devel/mingw32/bin/../libexec/gcc/mingw32/4.3.0/;e:/deve
l/mingw32/bin/../libexec/gcc/
LIBRARY_PATH=e:/devel/mingw32/bin/../lib/gcc/mingw32/4.3.0/;e:/devel/min
gw32/bin/../lib/gcc/;e:/devel/mingw32/bin/../lib/gcc/mingw32/4.3.0/../..
/../
COLLECT_GCC_OPTIONS='-v' '-o' 'z1.exe' '-mtune=i386'

e:/devel/mingw32/bin/../libexec/gcc/mingw32/4.3.0/collect2.exe -Bdynamic
 -o z1.exe e:/devel/mingw32/bin/../lib/gcc/mingw32/4.3.0/../../../crt2.o
e:/devel/mingw32/bin/../lib/gcc/mingw32/4.3.0/crtbegin.o -Le:/devel/ming
w32/bin/../lib/gcc/mingw32/4.3.0 -Le:/devel/mingw32/bin/../lib/gcc -Le:/
devel/mingw32/bin/../lib/gcc/mingw32/4.3.0/../../.. -lzdll
C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp/cc1ORmj9.o -lmingw32 -lgcc -lmoldname
 -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -
lgcc -lmoldname -lmingwex -lmsvcrt
e:/devel/mingw32/bin/../lib/gcc/mingw32/4.3.0/crtend.o
C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp/cc1ORmj9.o:zlibsample.c:(.text+0x31):
undefined reference to `_deflateInit_'
C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp/cc1ORmj9.o:zlibsample.c:(.text+0x80):
undefined reference to `_deflateEnd'
<more undefined references...>
collect2: ld returned 1 exit status



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

JonY-2
On 11/9/2008 07:24, sowiso wrote:

> Hi,
>
> I'm new in this here, so please bear with me.
>
> I'm trying to _compile in_ zlib support into my app, and to basically
> understand this, I've tried to compile the zpipe.c (
> http://www.zlib.net/zpipe.c ) sample application but I only get error
> messages about not found references to _deflateInit_ etc:
>
> Scouring the net, I've also found out about mingwPORT of zlib, *but* I
> think this is mainly for *building* zlib. But I do not want to build
> zlib.but_compile it in_!
>
> Eventually, I did decide to fire a 'sh' onto the mingwPORT.sh and got a
> working libzdll.a (resp. libz.dll.a) and also the other components were
> there. However, the linker does not find them and there is no
> "ldconfig -v" which would have solved my problems.
>
> In the wiki, I also found an information
> that it can be necessary to store some paths in the registry like
> include and library path, but even this did not do the trick.
>
> BTW, I'd loved to install both MingW and MSYS into the same directory,
> so that they share one /bin directory, however, I read this is not
> recommended. (However, it would make things neater and easier)
>
> LIBRARY_PATH would be a possible culprit. But export'ing it to
> $LIBRARY_PATH;/mingw/lib did not do the trick either, unfortunately.
>
> I'll appreciate any help on this....
>
> -Andreas
>
>
>

Hi,
Basically, apps requiring zlib will expect to link with "-lz". That
means libz.dll.a or libz.a in /mingw/lib.

Have you tried "gcc -v -o z1 zlibsample.c -lzdll"? Sometimes linking
order does matter.

About the nonexistent "/mingw/include". Try using E:\devel\mingw instead
of mingw32.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

Greg Chicares
In reply to this post by sowiso
On 2008-11-08 23:24Z, sowiso wrote:
>
> Eventually, I did decide to fire a 'sh' onto the mingwPORT.sh and got a
> working libzdll.a (resp. libz.dll.a) and also the other components were
> there. However, the linker does not find them and there is no
> "ldconfig -v" which would have solved my problems.

I would use the '-L' linker switch, e.g.
  -L path/to/library -l library_name

> In the wiki, I also found an information
> that it can be necessary to store some paths in the registry like
> include and library path, but even this did not do the trick.

That advice seems strange. Not all information in a wiki is
necessarily reliable.

> Interesting is that it says something about "non-existing directory
> /mingw/include", however, I can say that
> ls -al  /mingw/include
> will output the correct .h file list with no error messages at all.

MinGW gcc is a native application, not an MSYS application,
so it doesn't understand MSYS paths. Maybe that MSYS path
is mapped to this native path:

>  e:/devel/mingw32/lib/gcc/../../include

but you shouldn't need to tell the compiler where to find
its own include directory--it does that automatically.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso
In reply to this post by JonY-2

----- Original Message -----
From: "JonY" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 12:49 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)

> Hi,
> Basically, apps requiring zlib will expect to link with "-lz". That
> means libz.dll.a or libz.a in /mingw/lib.

Yes, both there. Since mingwPORT.sh worked fine and did not output any
errors.

> Have you tried "gcc -v -o z1 zlibsample.c -lzdll"? Sometimes linking
> order does matter.
>

Thank you JonY!

I will try to change the order, maybe it helps.

To another note, would you recommend installing the MSYS package into
the same directory as MingW?
There's really a hell of different opinions about this, and perfectly
confusing every user who is new to this. (Meant to be a critical note.)
Well, as it's apparently recommended (?), I installed it into a
different directory.

> About the nonexistent "/mingw/include". Try using E:\devel\mingw
instead
> of mingw32.

e:\devel\mingw does not exist. I *do* have MingW installed in
e:\devel\mingw32, since it is its original name.
This should not matter, should it? Otherwise I would have to reinstall
everything, and this time to ....\mingw.
However, if this is _really_ necessary, then I'd better not tell about
my personal opinion to that, otherwise this might arouse lots of riot ;p


-Andreas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso
In reply to this post by Greg Chicares

----- Original Message -----
From: "Greg Chicares" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 12:57 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)


> On 2008-11-08 23:24Z, sowiso wrote:
> I would use the '-L' linker switch, e.g.
>   -L path/to/library -l library_name

Thanks, I can try that.
BTW, I'm quite sure I must not use spaces next to -L or -l.
At least that mattered on my previous Linux distro. (IIRC)

> > In the wiki, I also found an information
> > that it can be necessary to store some paths in the registry like
> > include and library path, but even this did not do the trick.
>
> That advice seems strange. Not all information in a wiki is
> necessarily reliable.

Got that from here:
http://wiki.wxwidgets.org/Eclipse,_CDT_&_MingW_&_MSYS_Setup_Guide#MinGW_Installation

As it did not look very different to my problem (also telling about how
the ..../lib is known to the system), I used this.
However, in the verbose gcc output (which was attached to my other
post), I saw the option "do not use Win32 registry", so I might set
anything there, but it would not be regarded anyway!

-Andreas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso
In reply to this post by JonY-2

----- Original Message -----
From: "JonY" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 12:49 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)

> Have you tried "gcc -v -o z1 zlibsample.c -lzdll"? Sometimes linking
> order does matter.

That was the problem!!

Thank you VERY much!

LOL, who the heck can think of THAT?!?!

-Andreas´
(avid shell script enthusiast, and very used to 'shift' and random
option order with tools)


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

JonY-2
In reply to this post by sowiso
On 11/9/2008 08:16, sowiso wrote:

> ----- Original Message -----
> From: "JonY"<[hidden email]>
> To: "MinGW Users List"<[hidden email]>
> Sent: Sunday, November 09, 2008 12:49 AM
> Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
> mingw + msys)
>
>> Hi,
>> Basically, apps requiring zlib will expect to link with "-lz". That
>> means libz.dll.a or libz.a in /mingw/lib.
>
> Yes, both there. Since mingwPORT.sh worked fine and did not output any
> errors.
>
>> Have you tried "gcc -v -o z1 zlibsample.c -lzdll"? Sometimes linking
>> order does matter.
>>
>
> Thank you JonY!
>
> I will try to change the order, maybe it helps.
>
> To another note, would you recommend installing the MSYS package into
> the same directory as MingW?
> There's really a hell of different opinions about this, and perfectly
> confusing every user who is new to this. (Meant to be a critical note.)
> Well, as it's apparently recommended (?), I installed it into a
> different directory.
>

It comes from the fact that older versions of MSYS couldn't tell MSYS
apps from native apps, often breaking them when UNIX/Win32 path
translation takes place.

I won't recommend installing MSYS packages to the same directory as
MinGW. Occasionally, I do port some tools to MSYS, its really a mess if
I can't call MSYS gcc or MinGW gcc properly, though it shouldn't matter
to MinGW users.

>> About the nonexistent "/mingw/include". Try using E:\devel\mingw
> instead
>> of mingw32.
>
> e:\devel\mingw does not exist. I *do* have MingW installed in
> e:\devel\mingw32, since it is its original name.
> This should not matter, should it? Otherwise I would have to reinstall
> everything, and this time to ....\mingw.
> However, if this is _really_ necessary, then I'd better not tell about
> my personal opinion to that, otherwise this might arouse lots of riot ;p
>

If you are using Windows 2000/XP/Vista, try using a junction point.
Sysinternals junction utility does this quite nicely.

Use "junction <mingw folder> <mingw32 folder>". It will link them up
like soft links in UNIX. It will only work on NTFS drives though.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

Greg Chicares
In reply to this post by sowiso
On 2008-11-09 00:26Z, sowiso wrote:
>
> (avid shell script enthusiast, and very used to 'shift' and random
> option order with tools)

The linker's options are order dependent. See:

http://article.gmane.org/gmane.os.cygwin/89771

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso
In reply to this post by JonY-2

----- Original Message -----
From: "JonY" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 1:32 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)

> It comes from the fact that older versions of MSYS couldn't tell MSYS
> apps from native apps, often breaking them when UNIX/Win32 path
> translation takes place.

OK I see.

> I won't recommend installing MSYS packages to the same directory as
> MinGW.

Thanks for your opinion. Well, I too assumed it comes from old times of
MSYS, but I wasn't sure.
BTW is the last version of MSYS really that of 2004, read aloud, from a
whoppin' 4 years ago?

> If you are using Windows 2000/XP/Vista, try using a junction point.
> Sysinternals junction utility does this quite nicely.

Thanks for the tip, this could indeed do some good.

Now I have zpipe.c up and running, there's even more woes:
This thing appears to use its own special ZIP format!

My app must also support files that were zipped using common tools like
WinRAR or WinZIP, however, the sample tool appears to use it's own shiny
algorithm which is only understood by zlib, i. e. only zlib can unpack
the files again.
Now, this really makes less sense.

-Andreas



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

JonY-2
On 11/9/2008 09:09, sowiso wrote:

> ----- Original Message -----
> From: "JonY"<[hidden email]>
> To: "MinGW Users List"<[hidden email]>
> Sent: Sunday, November 09, 2008 1:32 AM
> Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
> mingw + msys)
>
>> It comes from the fact that older versions of MSYS couldn't tell MSYS
>> apps from native apps, often breaking them when UNIX/Win32 path
>> translation takes place.
>
> OK I see.
>
>> I won't recommend installing MSYS packages to the same directory as
>> MinGW.
>
> Thanks for your opinion. Well, I too assumed it comes from old times of
> MSYS, but I wasn't sure.
> BTW is the last version of MSYS really that of 2004, read aloud, from a
> whoppin' 4 years ago?
>

SourceForge says the last MSYS update was on August 28, 2008. Most of
the core functionality hasn't changed.

>> If you are using Windows 2000/XP/Vista, try using a junction point.
>> Sysinternals junction utility does this quite nicely.
>
> Thanks for the tip, this could indeed do some good.
>
> Now I have zpipe.c up and running, there's even more woes:
> This thing appears to use its own special ZIP format!
>

More like gzip, which is not to be confused with zip.

> My app must also support files that were zipped using common tools like
> WinRAR or WinZIP, however, the sample tool appears to use it's own shiny
> algorithm which is only understood by zlib, i. e. only zlib can unpack
> the files again.
> Now, this really makes less sense.
>

Both gzip and zip are using the DEFLATE algorithm, which is what zlib is
for.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso

----- Original Message -----
From: "JonY" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 10:18 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)


> On 11/9/2008 09:09, sowiso wrote:
> > ----- Original Message -----
> > From: "JonY"<[hidden email]>
> > To: "MinGW Users List"<[hidden email]>
> > Sent: Sunday, November 09, 2008 1:32 AM
> > Subject: Re: [Mingw-users] Problems in compiling zlib into my app
(using
> > mingw + msys)
> >
> > Now I have zpipe.c up and running, there's even more woes:
> > This thing appears to use its own special ZIP format!
> >
>
> More like gzip, which is not to be confused with zip.

I know it that far :) However, although I've tried to rename the
blah.zip to blah.gz, WinRAR refused to unpack it.
I reckon the team should put things like this in the FAQ to not confuse
newbies.

In the meantime, I've finally found out what I _actually_ need: Gilles
Volant's zip and unzip add-on for zlib.
The Makefile in the contrib directory was the horror, and 'make' did not
work at all:
UNZ_OBJS = miniunz.zip.o unzip.o ioapi.o ../../libz.a
ZIP_OBJS = minizip.o zip.o unzip.o ioapi.o ../../libz.a

What a nonsense, as libz.a was up and running - so why rebuild it again?
However, there wasn't even a trace in the various files of the zlib
source distribution that there is really a way to also build the tools
in the contrib/ directory. There weren't configure files either (except
for one unrelated),  not even configure.in / configure.ac you could fire
on autoconf - nada.

Eventually, the thing only worked by typing this by hand, simply
ignoring the stupid Makefile:

gcc -o unz unzip.c iowin32.c ioapi.c miniunz.c -lzdll

and bingo!
I could only know that because I was LUCKY to have programmed a tool
which needs several *.c files, and thus know what to pass gcc at the
command line.
However, for any beginner, this is doomed to fail with THIS wonderful
kind of "documentation."
But somehow the mailing lists must be kept busy, huh? :P

-Andreas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

JonY-2
On 11/9/2008 11:10, sowiso wrote:

> ----- Original Message -----
> From: "JonY"<[hidden email]>
> To: "MinGW Users List"<[hidden email]>
> Sent: Sunday, November 09, 2008 10:18 AM
> Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
> mingw + msys)
>
>
>> On 11/9/2008 09:09, sowiso wrote:
>>> ----- Original Message -----
>>> From: "JonY"<[hidden email]>
>>> To: "MinGW Users List"<[hidden email]>
>>> Sent: Sunday, November 09, 2008 1:32 AM
>>> Subject: Re: [Mingw-users] Problems in compiling zlib into my app
> (using
>>> mingw + msys)
>>>
>>> Now I have zpipe.c up and running, there's even more woes:
>>> This thing appears to use its own special ZIP format!
>>>
>> More like gzip, which is not to be confused with zip.
>
> I know it that far :) However, although I've tried to rename the
> blah.zip to blah.gz, WinRAR refused to unpack it.
> I reckon the team should put things like this in the FAQ to not confuse
> newbies.
>

Hmm, at this point, I'm not even sure if its gzip. The final output
format (file headers/lengths/offsets and all the details) which is
written to disk is probably up to the programmer using the library.

> In the meantime, I've finally found out what I _actually_ need: Gilles
> Volant's zip and unzip add-on for zlib.
> The Makefile in the contrib directory was the horror, and 'make' did not
> work at all:
> UNZ_OBJS = miniunz.zip.o unzip.o ioapi.o ../../libz.a
> ZIP_OBJS = minizip.o zip.o unzip.o ioapi.o ../../libz.a
>
> What a nonsense, as libz.a was up and running - so why rebuild it again?
> However, there wasn't even a trace in the various files of the zlib
> source distribution that there is really a way to also build the tools
> in the contrib/ directory. There weren't configure files either (except
> for one unrelated),  not even configure.in / configure.ac you could fire
> on autoconf - nada.
>

Are you sure those are make targets? They look like dependencies.

iirc, zlib doesn't use autotools at all. The Makefile you saw was
designed to link with libz.a (the static library) which is the created
when "make" was run in the root directory.

> Eventually, the thing only worked by typing this by hand, simply
> ignoring the stupid Makefile:
>
> gcc -o unz unzip.c iowin32.c ioapi.c miniunz.c -lzdll
>
> and bingo!
> I could only know that because I was LUCKY to have programmed a tool
> which needs several *.c files, and thus know what to pass gcc at the
> command line.
> However, for any beginner, this is doomed to fail with THIS wonderful
> kind of "documentation."
> But somehow the mailing lists must be kept busy, huh? :P
>

I don't think I understand your request, which "documentation" are you
referring to? The gcc parameters are already in the gcc docs.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso

----- Original Message -----
From: "JonY" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 4:29 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)

> > I know it that far :) However, although I've tried to rename the
> > blah.zip to blah.gz, WinRAR refused to unpack it.
> > I reckon the team should put things like this in the FAQ to not
confuse
> > newbies.
> >
>
> Hmm, at this point, I'm not even sure if its gzip.

You can't be. It appears to be a special format which is simply
targeting on even better speed and performance.

> Are you sure those are make targets? They look like dependencies.
>
> iirc, zlib doesn't use autotools at all. The Makefile you saw was
> designed to link with libz.a (the static library) which is the created
> when "make" was run in the root directory.

I thought that too. However, I know it better :-)
The contrib tools absolutely require iowin32.c on windows.
Just go from the root directory and do a search for iowin32.c.
You will only find references to this file either in the contrib/minizip
directory, or in its subdirectory where you can find VC project files.
Yes, I did look closely. Those contrib tools are NOT touched (and not
able to get compiled) when make'ing from the root directory.
You cannot make them from there. Either you are using Visual Studio
(where project files are provided), or you are on your own (just as I
was).

> > I could only know that because I was LUCKY to have programmed a tool
> > which needs several *.c files, and thus know what to pass gcc at the
> > command line.
> > However, for any beginner, this is doomed to fail with THIS
wonderful
> > kind of "documentation."
> > But somehow the mailing lists must be kept busy, huh? :P
> >
>
> I don't think I understand your request, which "documentation" are you
> referring to? The gcc parameters are already in the gcc docs.

The "comprehensive" documentation found in the zlib package, for
example.

-Andreas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

JonY-2
On 11/9/2008 12:35, sowiso wrote:

> ----- Original Message -----
> From: "JonY"<[hidden email]>
> To: "MinGW Users List"<[hidden email]>
> Sent: Sunday, November 09, 2008 4:29 AM
> Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
> mingw + msys)
>
>>> I know it that far :) However, although I've tried to rename the
>>> blah.zip to blah.gz, WinRAR refused to unpack it.
>>> I reckon the team should put things like this in the FAQ to not
> confuse
>>> newbies.
>>>
>> Hmm, at this point, I'm not even sure if its gzip.
>
> You can't be. It appears to be a special format which is simply
> targeting on even better speed and performance.
>

I found out more in the zlib faq, link bellow.

>> Are you sure those are make targets? They look like dependencies.
>>
>> iirc, zlib doesn't use autotools at all. The Makefile you saw was
>> designed to link with libz.a (the static library) which is the created
>> when "make" was run in the root directory.
>
> I thought that too. However, I know it better :-)
> The contrib tools absolutely require iowin32.c on windows.
> Just go from the root directory and do a search for iowin32.c.
> You will only find references to this file either in the contrib/minizip
> directory, or in its subdirectory where you can find VC project files.
> Yes, I did look closely. Those contrib tools are NOT touched (and not
> able to get compiled) when make'ing from the root directory.
> You cannot make them from there. Either you are using Visual Studio
> (where project files are provided), or you are on your own (just as I
> was).
>

I think you're supposed to run "make" in the root first, then run "make"
in the contrib directories.

>>> I could only know that because I was LUCKY to have programmed a tool
>>> which needs several *.c files, and thus know what to pass gcc at the
>>> command line.
>>> However, for any beginner, this is doomed to fail with THIS
> wonderful
>>> kind of "documentation."
>>> But somehow the mailing lists must be kept busy, huh? :P
>>>
>> I don't think I understand your request, which "documentation" are you
>> referring to? The gcc parameters are already in the gcc docs.
>
> The "comprehensive" documentation found in the zlib package, for
> example.

I found <http://www.zlib.net/zlib_faq.html>. It does explain about gzip
and pkzip briefly.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

sowiso

----- Original Message -----
From: "JonY" <[hidden email]>
To: "MinGW Users List" <[hidden email]>
Sent: Sunday, November 09, 2008 5:51 AM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app (using
mingw + msys)



> I found <http://www.zlib.net/zlib_faq.html>. It does explain about
gzip
> and pkzip briefly.

At a second look ... thanks, indeed that would've been the solution!
The actual problems is that they "want to keep everything brief", and
put totally crappy "highly-interesting" information on-top, i. e.
whether zlib is Y2K-compliant. WTF??!
This stuff is mainly used by developers who want to compile in support
for compressed files.
So they go there, see zlib and say, "ah! this is what I need, probably
an abbreviation of zipLib".
But they go to the zpipe.c page, want to see how the thing works, then
get a highly performant but completely proprietary algorithm that no
other software in this world could apparently unpack. Useless, time
wasted!
Not until after a whale of a time, they discover Gilles' ZIP add-on and
say, "yes this is what I need! So why not from the beginning?"

*I* would have put the ZIP files thing ON TOP of the FAQ instead of
squeezing it somewhere in-between, simple as that.
Given that at least one of the dev team comes from PkZip world, ZIP
should be built in and not rely on 3rd-party contributions anyway!

Apart from that, half of the FAQ entries are very unrelevant bullshit
and could be stripped off so only the important parts remain.

-Andreas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlibinto my app (using mingw + msys)

Роман Донченко
> But they go to the zpipe.c page, want to see how the thing works, then
> get a highly performant but completely proprietary algorithm that no
> other software in this world could apparently unpack. Useless, time
> wasted!

I would not call an openly-documented format
(http://tools.ietf.org/html/rfc1950) "proprietary". And if it's not used for
on-disk storage, that doesn't mean it's useless.

> *I* would have put the ZIP files thing ON TOP of the FAQ instead of
> squeezing it somewhere in-between, simple as that.
> Given that at least one of the dev team comes from PkZip world, ZIP
> should be built in and not rely on 3rd-party contributions anyway!

zlib is a data compression library, not a ZIP format library.

Roman.

--
Manually typed signature.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

Earnie Boyd
In reply to this post by JonY-2

Quoting JonY <[hidden email]>:

>
> It comes from the fact that older versions of MSYS couldn't tell MSYS
> apps from native apps, often breaking them when UNIX/Win32 path
> translation takes place.
>

Actually it comes from the fact that prior to 1.0.11 MSYS would not do
translation magic for executables in the /bin or /usr/bin directory.  
Translation magic isn't done for files that are dependent on the
msys-1.0.dll.

> I won't recommend installing MSYS packages to the same directory as
> MinGW. Occasionally, I do port some tools to MSYS, its really a mess if
> I can't call MSYS gcc or MinGW gcc properly, though it shouldn't matter
> to MinGW users.
>

Since 1.0.11 MSYS reads the executable objects and finds the dependent
msys-1.0.dll object to determine if the translation magic is
applicable.  Putting binaries not dependent on msys-1.0.dll with those
that are is no longer an issue.

For MSYS development I put the msysDVLPR files in /usr/msys instead.  
All other binaries are in /bin.  I put the /usr/msys/bin directory as
the first path.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys)

Earnie Boyd
In reply to this post by sowiso

Quoting sowiso <[hidden email]>:

> BTW is the last version of MSYS really that of 2004, read aloud, from a
> whoppin' 4 years ago?
>

Yes, it is correct.  I am no longer maintaining it and had turned over
maintenance to Cesar Strauss who has made some progress with 1.0.11 but
we still don't have a new release.  Charles Wilson has provided newer
versions of the developer tools tools against the 1.0.11 dll.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app(using mingw + msys)

sowiso
In reply to this post by Earnie Boyd

----- Original Message -----
From: "Earnie Boyd" <[hidden email]>
To: <[hidden email]>
Sent: Sunday, November 09, 2008 4:33 PM
Subject: Re: [Mingw-users] Problems in compiling zlib into my app(using
mingw + msys)

> Since 1.0.11 MSYS reads the executable objects and finds the dependent
> msys-1.0.dll object to determine if the translation magic is
> applicable.  Putting binaries not dependent on msys-1.0.dll with those
> that are is no longer an issue.
>
> For MSYS development I put the msysDVLPR files in /usr/msys instead.
> All other binaries are in /bin.  I put the /usr/msys/bin directory as
> the first path.

 So you *do* have MSYS and MinGW installed into one and the same
directory?

-Andreas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Problems in compiling zlib into my app (using mingw + msys )

Keith Marshall
In reply to this post by sowiso
On Sunday 09 November 2008 00:22:20 sowiso wrote:

> > > In the wiki, I also found an information
> > > that it can be necessary to store some paths in the registry
> > > like include and library path, but even this did not do the
> > > trick.
> >
> > That advice seems strange. Not all information in a wiki is
> > necessarily reliable.
>
> Got that from here:
>
http://wiki.wxwidgets.org/Eclipse,_CDT_&_MingW_&_MSYS_Setup_Guide#MinGW_Installation

Well, that is not *our* wiki, and it is not in our purview to maintain
it.  There are many other sites, besides our own, which purvey advice
on using MinGW; much of it is notoriously unreliable, if not not just
downright inaccurate.

Regards,
Keith.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
12