Problem with compilation since 10.2 !


I met some problems with compilation since 10.2 Before, from 10 to 10.1 I had no problem at all with the same programs I'm trying to compile under 10.2 I found these problems only with program related with other libraries: GD (image), MySQL (database), etc.... Some real examples:

1. I'm trying to compile Pure-FTPd (an excellent FTP deamon) with MySQL support. Without the MySQL support, I can compile Pure-FTPd without any problem. Since 10.2, the scripts seems to have no more access (or not found) the shared libraries. Before, there was no problem.

2. I'm trying to compile Webalizer (an excellent Logs analyser) that runs only via GD and libpng to build beautiful graphic stats. Under 10 and 10.1 I had absolutely no problem to compile it. In fact, that was my first compilation on Unix! But since 10.2, the make script can't find the libpng and gd libraries.

Is there anything to do ".dylb" and ".so" extension mess since 10.2 ? Any body has an clue? Does anybody has the same problem as me since 10.2 ?

It's to bad if we can't compile anything on Mac OS X...


wandering shadow
You may need to recompile the libpng and gd libraries - there are some small diferences in 10.2 that requires some shared libraries to be recompiled.


I did recompiled these two libraries! I did also downloaded the December 2002 Developper Tools! Did I missed something?

Did anybody compiled one of the two examples above (Pure-FTPd with MySQL support or Webalizer) under Mac OS X 10.2 ????


I have been unable to compile a dict server (dictd-1.9.1) for Mac OS X -- as soon as I surmount one hurdle, another quickly presents itself. I may just have to use the Java server, since the C-based server just will not compile easily. I'm sure it would compile with some massaging, but I don't have the time to waste on it much beyond a vanilla compilation. So lashampoo, I share your sentiments.


Hey! Is there any Unix guru reading this forum who might help us? Some easy tricks like doing a symbolic link to a dispared library since 10.2 or a magic phrase... Or some dark tricks between Gcc 3.1 vs gcc 3.2 since Jaguar... Pleeeeease, let me compile again!

Or this means that since 10.2, Mac OS X is useless for Unix people: open source things and other stuff like Unix compilings were only before 10.2 ?

Is there any Apple staff people reading this forum?


keeper of the cheese
I installed webalizer from fink without any issues, downloaded, compiled, installed. Don't have mysql installed so I can't test the pureftp install with mysql support.



wandering shadow
You can compile things under 10.2 - I do it most everyday (my own stuff + some X11 stuff and others). What *exactly* are the errors you are getting? And where are the libpng, mysql, and gd files & libraries installed at?

If I get these, I may be able to help you better. I DO know how to compile things very well.


OS X 10.2.4, December 2000 Developer's Tools, fink 0.5.1.cvs
Somewhat abbreviated, but the relevant clues left intact. Here's the first error:
checking for ltdl.h... no
configure: error: Install ltdl library and appropriate header files
fink install libtool libtool-shlibs
sudo ln -s /sw/include/ltdl.h /usr/include/ltdl.h
source ~/.cshrc

Try, try again:
Configuring for dict
checking build system type... powerpc-apple-darwin6.4
checking host system type... powerpc-apple-darwin6.4
checking for gcc... gcc
[i]....(everything good until):[/i]
Making output files
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating dictdplugin-config
config.status: creating config.h
config.status: config.h is unchanged
configure: configuring in libmaa
configure: running /bin/sh './configure'  LDFLAGS=-flat_namespace --cache-file=/dev/null --srcdir=.
Configuring for libmaa 0.95
checking build system type... configure: error: cannot guess build type; you must specify one
configure: error: /bin/sh './configure' failed for libmaa
sed: confdefs.h: No such file or directory


keeper of the cheese
Originally posted by gatorparrots

....(everything good until):

Configuring for libmaa 0.95
checking build system type... configure: error: cannot guess build type; you must specify one
configure: error: /bin/sh './configure' failed for libmaa
sed: confdefs.h: No such file or directory[/code]

cp /sw/share/automake-1.6/config.guess libmaa/
cp /sw/share/automake-1.6/config.sub libmaa/
./configure --prefix /usr/local

Basically the libmaa directory in the source release does not have an update to date copy of config.guess and config.sub, you can find the up to date ones in /sw/share/automake-1.6, assuming you've installed automake via fink. the CPPFLAGS="-I/sw/include" tells gcc to look in /sw/include for header files in addition to the default places, so it removes the need for the symlink that you made.

Ofcourse, this now gets the software to pass the configure script, it doesn't compile after that due to issues with the code not working with darwin. In a quick look at things, the first problem you'll see is an issue with getopt when building libmaa, the patch for that problem is:
ibis-Sun Feb 23 23:29:59$ diff maaP.h maaP.h.bad
< #if !defined(__bsdi__) && !defined(__OpenBSD__) && !defined(__APPLE__)
> #if !defined(__bsdi__) && !defined(__OpenBSD__)

You'll also later see an error about libregex.a and ranlib, just run: 'ranlib regex/libregex.a' to fix that issue. The biggest thing you'll run into after that is that darwin doesn't have wctype.h implemented, and starting with version 1.8.0 of dictd it started using it. No FreeBSD OS's before 5.x supported wctype.h, and since Darwin is based pre-5.x it doesn't either. There is a patch out for FreeBSD to replace the functionality that wctype.h in 1.8.0, but it's a pretty long patch, and it's for 1.8 not 1.9, but wouldnt' be hard to port it to 1.9, you can find the patch searching for it, the subject of the thread is "ports/45755: /usr/ports/net/dictd does not build, at least on 4.7-RELEASE". Basically you need to move the functionality it adds to the proper files in 1.9 and you'll want to replace __FreeBSD__ with __APPLE__. Or, install dictd 1.7 that doesn't rely on wctype.h and it's associated utf stuff.



Hi btoneill! Thanks for the explanations. Reading your answer I found that now Fink is obligatory to install library related software. Isn't it?

Do you know why I could install programs with related library (as Pure-FTPd with MySQL support, and Webalizer with PNG) without any problem and now something install and we need the help of Unix guru?

As for Windows OS: is it a bug or a feature?

Darkshadow: I don't know exactly where are the PNG and GD libraries. I just know that I installed them doing a ./configure ; make ; make install

I think that the libraries are where they should be. But the question is why things are not going right since Jaguar? Is there a missing configuration file in Jaguar that prevent make install from installing correctly with exactly the same configuration and libraries installed that allowed me compile the same version of Webalizer or Pure-FTPd before?


wandering shadow
No, fink's not necessary, it just makes things easier. I don't use it at all.

if you just did a normal ./configure; make; make install then the files will be in /usr/local/lib and /usr/local/include

No, there's no missing configuration file problem with 10.2. One of the main problems is that most of this software doesn't have any support for Darwin, so if you want to compile it, you'll have to edit files. This will probably be the case with most things for a while yet, until software developers either get patches from people and incorporate them into the software package or directly code in support for Darwin themselves. Either one will take a while.

As to why it won't compile now when it did before - are you trying to compile the same exact version of the software you had before, or an updated version? If it's an updated version, you may need to update the libraries it depends on, or (like the package above) may not be (very) compileable on Darwin.


Darkshadow tanks for your answer.

As to why it won't compile now when it did before - are you trying to compile the same exact version of the software you had before, or an updated version? If it's an updated version, you may need to update the libraries it depends on, or (like the package above) may not be (very) compileable on Darwin.

It was not an updated version of the program. But I deleted the directory by mistake and try to build it again. But yes, as I had problem compiling I did upadted the libraries. But I still have the same compiling error message. This happens with ALL the programm needing related libraries.

Here is the message during the compilation:

[lashampoo:/usr/local/webalizer] root# ./configure --with-language=french
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking whether ln -s works... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking how to run the C preprocessor... (cached) gcc -E -traditional-cpp
checking whether char is unsigned... (cached) no
checking for main in -l44bsd... (cached) no
checking for main in -lm... (cached) yes
checking for main in -lz... (cached) yes
checking for gzrewind in -lz... (cached) yes
checking for main in -lpng... (cached) yes
checking for gdImagePng in -lgd... (cached) yes
checking for gd.h... (cached) /usr/local/include
checking for getopt.h... (cached) no
checking for math.h... (cached) yes
checking default config dir... (cached) /etc
checking for language file... yes - french
creating ./config.status
creating Makefile
linking ./lang/webalizer_lang.french to webalizer_lang.h
[lashampoo:/usr/local/webalizer] root# make
gcc -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o -lgd -lpng -lz -lm
ld: warning multiple definitions of symbol _main
webalizer.o definition of _main in section (__TEXT,__text)
/usr/local/lib/libgd.dylib(libgd.2.0.0.dylib-master.o) definition of _main
ld: Undefined symbols:
make: *** [webalizer] Error 1

Obviously there is a problem with warning multiple definitions of symbol _main I don't know what it might be...


Found on

The installation of GD-2.06 dies on me. I've attached some hopefully useful information in the mail. I apologize for the bulky noise. Any help form the experts would be very much appreciated.

I've noticed a few problems like this since 10.2.3. It seems that the linker isn't set to limit symbols locally. If you're linking against a lib with a main(), you may not need to use it (since you're probably calling lib functions only). "It" being "main()". Ahem.

I don't have GD installed, but try something like this against your libgd.2.dylib:
% echo '_main' > syms.txt
% nmedit -R syms.txt parse.o

This will cause '_main' to be treated as a private symbol, not exported during linking.

As far as I can understand, since 10.2 the linker isn't set to limit symbols locally. So some compilations does not work if libraries shared functions wih the same names.

But how force compilation to use symbols locally?