Building C with automake under OS X and Linux
NickName:adur Ask DateTime:2016-07-28T17:03:22

Building C with automake under OS X and Linux

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

More about “Building C with automake under OS X and Linux” related questions

Building C with automake under OS X and Linux

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...

Show Detail

How to check the OS with automake

I have a project that uses automake to create the configure and all related files (I'm using autoreconf command to make all this stuff). So, I'm trying to set some conditional files to compile whe...

Show Detail

Automake under linux, executable missing the .out extension.

I'm using autotools (autoconfig and automake) under Linux, but my executables are missing the .out extension. What am I forgetting to do?

Show Detail

Automake conditional compilation from C or Objective-C sources

I'm using the following to do conditional compilation in automake of the amhello example program [1]: In configure.ac: AC_INIT([amhello], [1.0], [[email protected]]) AM_INIT_AUTOMAKE([-Wall -W...

Show Detail

Emulating Linux binaries under Mac OS X

How do I run Linux binaries under Mac OS X? Googling around I found a couple of emulators but none for running Linux binaries on a Mac. There are quite a few posts about running Mac OS X on Linux ...

Show Detail

Compiling a Linux program under Mac OS X

I am trying to use make under Mac OS X (El Capitan) to compile a program which I know to work under Linux. The program makes use of USB libraries. I had to modify the config.mk file for these libra...

Show Detail

YoctoProject error with automake and system clock

Im running yocto to build an image inside docker, but after all processes i get error related to automake. This is the error: checking whether build environment is sane... configure: error: newly

Show Detail

Trying to create sample linux mage with yocto prject but cause building error

I tried to create a Linux image based on "yocto project mega Manuel".But I got an error in building image step. I followed the mega Manuel. I'm using Ubuntu 18.04.1 LTS. Error: aju@aju-HP-15-

Show Detail

Automake-1.14 is failing at make

I downloaded automake-1.14 by following this tutorial on Ubuntu 16.04 ./configure passed without any error. But the moment I ran make it gave an error. I actually removed automake-1.15 from linux

Show Detail

Automake and files with the same name

I've a C++ autoconf managed project that I'm adapting to compile on FreeBSD hosts. The original system was Linux so I made one AM_CONDITIONAL to distinguish the host I'm building and separate the ...

Show Detail