More problems

Harald Barth haba at pdc.kth.se
Thu Jul 27 16:14:32 CEST 2000



1. As #include <sys/types.h> is in greater-less brackets, the
   compiler will search at the "usual places" (see you compiler
   docs, /usr/include is among the "usual places". We want the
   compiler (eh preprocessor, I know) to find the include files,
   not supply the whole (and probably wrong) path.

2. Same is for atypes.h with the modification that the search list
   can be extended with -I flag to the compiler. See 3.

3. Go to the top of the build tree (where you type make)
   Copy the foo.c file there

   Yes, you'll need -o and not -c. Something like:

   gcc -o foo -DHAVE_CONFIG_H -I./include -g -Wall -Wmissing-prototypes -Wnested-externs foo.c 
                                ^^^^^^^^^
                              This tells the compiler where to find additional .h files like
                              atypes.h

   This will give you an executable foo

   ./foo

   Let us know the output.
   If you attach the config.status and config.cache files, that might help us, too.

To compare:

On my i386 Linux box I compiled foo.c like 
$ gcc -o foo  -DHAVE_CONFIG_H -I./include  -I/usr/athena/include -I. -DDEBUG -g  -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs  -DRXDEBUG foo.c

and got the following result:

$ ./foo
sizeof(int32_t) = 4
data = 0x7856341200000000

Harald.





More information about the Arla-drinkers mailing list