sniperHW / distri.lua

distributed lua framework
151 stars 71 forks source link

distri.lua/deps/http-parser Makefile CC?=gcc AR?=ar #2

Closed cmzx3444 closed 9 years ago

cmzx3444 commented 9 years ago

CC?=gcc AR?=ar 编译错误

sniperHW commented 9 years ago

编译环境和编译错误帖出来看看

cmzx3444 commented 9 years ago

distri.lua/deps/myprocps Makefile

all: cc -D_GNU_SOURCE $(INCLUDE) -MM -MG proc/alloc.c proc/devname.c proc/escape.c proc/ksym.c proc/pwcache.c proc/readproc.c proc/sig.c proc/slab.c proc/sysinfo.c proc/version.c proc/whattime.c > proc/.depend cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/alloc.c -o proc/alloc.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/devname.c -o proc/devname.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/escape.c -o proc/escape.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/ksym.c -o proc/ksym.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/pwcache.c -o proc/pwcache.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/readproc.c -o proc/readproc.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/sig.c -o proc/sig.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/slab.c -o proc/slab.o cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/sysinfo.c -o proc/sysinfo.o cc -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) -DVERSION=\"3\" -DSUBVERSION=\"2\" -DMINORVERSION=\"8\" -c -o proc/version.o proc/version.c cc -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) -c -o top.o top.c cc -c -D_GNU_SOURCE $(INCLUDE) $(CFLAGS) proc/whattime.c -o proc/whattime.o
ar -rc libproc.a proc/*.o top.o cc -g -o testtop testtop.c libproc.a 不应该是$(cc)吗,

cmzx3444 commented 9 years ago

我的环境是centos6.5 gcc 4.9.2

cmzx3444 commented 9 years ago

你那能编译成功? Makefile中 CC?=gcc AR?=ar 这两个变量加?是什么意思,去掉问号http-parser能编译成功

cmzx3444 commented 9 years ago

myprocps 编译出错 top.c: 在函数‘rc_read_old’中: top.c:1268:35: 错误:‘P_PID’未声明(在此函数内第一次使用) rc->win[0].sortindx = P_PID; 你那是什么环境?ubuntu吗?

sniperHW commented 9 years ago

你的环境下除了GCC还有别的C编译器吧。加?是不确定用GCC,你去掉就指定用GCC了

sniperHW commented 9 years ago

我的环境是ubuntu

sniperHW commented 9 years ago

你加个define将p_pid的值定义成pp_pid

sniperHW commented 9 years ago

加个 #ifndef P_PID

define P_PID PP_PID

endif

cmzx3444 commented 9 years ago

可以编译成功了,太感谢了lua-cjson-2.1.0 的makefile

Solaris

CC = gcc

这个也要去掉注释。 为什么下ubuntu就可以?