我安装了libCurl,我正在尝试直接在Eclipse中从curl网站构建示例'simple.c',但是我收到以下错误:
make all
Building file: ../simple.c
Invoking: Cross GCC Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"simple.d" -MT"simple.d" -o "simple.o" "../simple.c"
Finished building: ../simple.c
Building target: Test_SimpleCurl
Invoking: Cross GCC Linker
gcc -o "Test_SimpleCurl" ./simple.o
Undefined symbols for architecture x86_64:
"_curl_easy_cleanup", referenced from:
_main in simple.o
"_curl_easy_init", referenced from:
_main in simple.o
"_curl_easy_perform", referenced from:
_main in simple.o
"_curl_easy_setopt", referenced from:
_main in simple.o
"_curl_easy_strerror", referenced from:
_main in simple.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Test_SimpleCurl] Error 1
这是Eclipse中一个简单的“新C ++项目>新文件”。 构建时,Eclipse还会在调试文件夹中生成一些文件。 这是'Makefile'的内容
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: Test_SimpleCurl
# Tool invocations
Test_SimpleCurl: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross GCC Linker'
gcc -o "Test_SimpleCurl" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) Test_SimpleCurl
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
我会假设我缺少链接器或编译器标志,但我不知道在这个项目中添加这些标志的位置。
有什么建议吗?感谢