Makefile问题

头文件路径:Z:\include\curl\curl.h

库路径:Z:\lib\libcurl.so

liunx下面我们项目的根路径:/usr/local/icache/

/* 就是说头文件其实是在  /usr/local/icache/include\curl\curl.h          include和  TCPtest在同一目录下*/

 

代码目录::/usr/local/icache/TCPtest

Makefile:

#(c) CETC 2007
ROOTDIR=.
CC=gcc

ICACHE_ROOT=/usr/local/icache/

LIB_PATH=

LIBS+=-lcurl -lpthread

INC=-I./ -I$(ICACHE_ROOT)/include/
CFLAGS = -g -O2 -DLINUX -Wall -pipe #`pkg-config --cflags --libs glib-2.0 gthread-2.0`

OBJ_CLIENT = $(ROOTDIR)/*.o

default:all

%.o:%.c
	echo compiling $@
	$(CC) $(WFLAGS) $(CFLAGS) $(IFLAGS) -c {1}lt;

all:test

test: $(OBJ_CLIENT)
	$(CC) -o test $(OBJ_CLIENT) $(LIB_PATH) $(LIBS) $(CFLAGS) $(IFLAGS) $(INC) 

PHONY: clean
clean:
	rm *.o -rf
	rm test -f


 

报错:

g++    -c -o *.o TestRss.cpp
TestRss.cpp:3:23: error: curl/curl.h: No such file or directory
TestRss.cpp: In function ‘void* http_get(void*)’:
TestRss.cpp:56: error: ‘CURL’ was not declared in this scope
TestRss.cpp:56: error: ‘curl’ was not declared in this scope
TestRss.cpp:57: error: ‘CURLcode’ was not declared in this scope
TestRss.cpp:57: error: expected `;' before ‘res’
TestRss.cpp:59: error: ‘curl_easy_init’ was not declared in this scope
TestRss.cpp:64: error: ‘CURLOPT_HEADERDATA’ was not declared in this scope
TestRss.cpp:64: error: ‘curl_easy_setopt’ was not declared in this scope
TestRss.cpp:66: error: ‘CURLOPT_HEADERFUNCTION’ was not declared in this scope
TestRss.cpp:69: error: ‘CURLOPT_URL’ was not declared in this scope
TestRss.cpp:76: error: ‘res’ was not declared in this scope
TestRss.cpp:76: error: ‘curl_easy_perform’ was not declared in this scope
TestRss.cpp:80: error: ‘curl_easy_cleanup’ was not declared in this scope
TestRss.cpp: In function ‘int main(int, char**)’:
TestRss.cpp:87: error: ‘CURLcode’ was not declared in this scope
TestRss.cpp:87: error: expected `;' before ‘res’
TestRss.cpp:98: error: ‘res’ was not declared in this scope
TestRss.cpp:98: error: ‘CURL_GLOBAL_ALL’ was not declared in this scope
TestRss.cpp:98: error: ‘curl_global_init’ was not declared in this scope
TestRss.cpp:99: error: ‘CURLE_OK’ was not declared in this scope
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值