我想在linux上编译一些我知道在OSX上编译的代码,但是我遇到了一些问题.
所有文件都有名为.h的头文件,所有文件都在同一目录下.我这样编译:
gcc *.c -std=c99 -lpthread
Run Code Online (Sandbox Code Playgroud)
虽然这段代码在OSX上编译,但我在Ubuntu安装上遇到了一堆奇怪的链接器错误.我错过了一些编译器选项吗?它是一个默认的Ubuntu服务器安装,带有附加软件包gcc并build-essential已安装.
In file included from errorLogger.h:24:0,
from configParser.h:17,
from configParser.c:9:
signalHandling.h:24:18: error: unknown type name ‘sigset_t’
configParser.c: In function ‘parseConfigFile’:
configParser.c:114:5: warning: implicit declaration of function ‘getline’ [-Wimplicit-function-declaration]
In file included from errorLogger.h:24:0,
from global.h:18,
from connection.h:19,
from connection.c:10:
signalHandling.h:24:18: error: unknown type name ‘sigset_t’
connection.c: In function ‘createConnectionQueue’:
connection.c:189:28: warning: assignment makes integer from pointer without a cast [enabled by default]
In file included from errorLogger.h:24:0,
from database.h:16,
from …Run Code Online (Sandbox Code Playgroud)