Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined symbol: curl_easy_escape,链接错误已解决 #13

Closed
peigongdh opened this issue Jan 2, 2018 · 1 comment
Closed

undefined symbol: curl_easy_escape,链接错误已解决 #13

peigongdh opened this issue Jan 2, 2018 · 1 comment

Comments

@peigongdh
Copy link

遇到了这个issues中同样的问题,加入链接-lcurl后仍然报错

#8
undefined symbol: curl_easy_escape

已解决,在这里补充一下,链接的时候要把-lcurl加在后面,像这样:
cc -g -O2 -Wall -Iskynet/3rd/lua -fPIC --shared -Iserver/lualib-src/webclient server/lualib-src/webclient.c -o server/luaclib/webclient.so -lcurl
如果是这样把链接库选项加在中间则会报错:
cc -g -O2 -Wall -Iskynet/3rd/lua -fPIC --shared -Iserver/lualib-src/webclient -lcurl server/lualib-src/webclient.c -o server/luaclib/webclient.so

附一个参考makefile:

include platform.mk

LUA_CLIB_PATH ?= server/luaclib

LUA_CLIB = webclient

CFLAGS = -g -O2 -Wall -I$(LUA_INC) $(MYCFLAGS)

# lua
LUA_STATICLIB := skynet/3rd/lua/liblua.a
LUA_LIB ?= $(LUA_STATICLIB)
LUA_INC ?= skynet/3rd/lua

all : \
    $(foreach v, $(LUA_CLIB), $(LUA_CLIB_PATH)/$(v).so)

$(LUA_CLIB_PATH)/webclient.so : server/lualib-src/webclient.c | $(LUA_CLIB_PATH)
	$(CC) $(CFLAGS) $(SHARED) -Iserver/lualib-src/webclient $^ -o $@ -lcurl

可关闭该issues或保留作为参考

@dpull
Copy link
Owner

dpull commented Jan 3, 2018

谢谢 看样我要补一个makefile才好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants