Currently I'm writing a RPC system for delay tolerant networks based on the Serval project from Australia (GitHub) in C.
Mainly I'm developing on macOS El Capitan and everything works fine. But it is somewhat important that my code runs on macOS and Linux. But Linux makes trouble.
I choose automake as my build system since this is the only one I have at least a little experience. I also tried CMake, but with little success.
My problem is now that everything works nice on macOS. But on Linux (Debian) nothing compiles. autoreconf
produces a configure script without errors, configure
produces a Makefile without errors. But make
yields a lot errors. And if I say a lot I really mean a lot (about 75.000 lines).
The first issue is the following:
In file included
from /usr/include/x86_64-linux-gnu/sys/types.h:29:0,
from /usr/local/include/curl/curlbuild.h:131,
from /usr/local/include/curl/curl.h:34,
from rpc.h:1,
from main.c:1:
/usr/include/x86_64-linux-gnu/bits/types.h:30:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
typedef unsigned char __u_char;
I googled around and found some people saying that this type of error comes somewhere from the user code, maybe a missing ;
or similar. But I double-checked everything. And a missing ;
would also be a problem on macOS, too.
My code can be found in my Github repo. Please use the dev
branch.
At this point the repo is somewhat disgusting and not clean at all. I will clean up when everything is running.
Thank you for your help :)
Copyright Notice:Content Author:「adur」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38631709/building-c-with-automake-under-os-x-and-linux