« general | Main | MacOSX - the daily life »

Wednesday, March 21, 2007

error: 'errno' undeclared

when trying to compile some *nix-based sources you might encounter the the compiler stops and throws an error similar to this:

error: 'errno' undeclared

Solution is to include

#include <errno.h>

to the header section of the affected source file(s).

Posted by Markus at 11:24 AM
Edited on: Wednesday, March 21, 2007 12:17 PM
Categories: healty from*nix to MacOSX

Monday, March 19, 2007

compiler&linker flags from shell for universal binary

okay, just as a reminder for myself - this is the compiler flag:

CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"

and here comes the linker flag:

LDFLAGS="-arch i386 -arch ppc"

to use if compilation of stdIO-progs via shell is intended.

Posted by Markus at 7:59 PM
Edited on: Monday, March 19, 2007 8:22 PM
Categories: healty from*nix to MacOSX

Friday, January 26, 2007

Apple preprocessor OR Gnu ?

Apparently sometimes it is a good idea to use the GNU preprocessor instead of Apple´s. In this case extend the compiler flags with:

-no-cpp-precomp

Posted by Markus at 5:36 PM
Categories: healty from*nix to MacOSX

libtool: link: cannot find the library `' - error

A "typical" problem I encountered with libtool is that the error messages sometimes are not really helpful. For example:

libtool: link: cannot find the library `'

gives more headache than insight, doesn´t it? =;)

In this case one can make libtool be more verbose by editing the apropriate line *usually in the configure script* to

$echo "$modename: cannot find the library \`$lib' (lib${name}.la: $deplib)" 1>&2

Resulting error message becomes something like:

libtool: link: cannot find the library `' (whatever-library-is-missed: and-where-it-is-missed)

Posted by Markus at 5:35 PM
Categories: healty from*nix to MacOSX

Missing "values.h"

On BSD based operating systems *like MacOSX* the header file "values.h" does not exist. Replacing the include file is one possible option to get legacy code compiled.

Most of the functionality of "values.h" seems to be incorporated in "floats.h" and "limits.h" under MacOSX (or other BSD based systems), so please use:

#include <limits.h>

#include <float.h>

Reminder: it looks like that not all constant defines from "values.h" are in these two files - in that case you might have to redefine the needed constant by yourself.

Posted by Markus at 5:34 PM
Categories: healty from*nix to MacOSX