I installed libCurl, and I'm trying to build the sample 'simple.c' from the curl website directly in Eclipse, but I get the following errors:
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
This is a simple "new C++ project > new File" in Eclipse. When I build, Eclipse also generates some files in the debug folder. Here's the content of '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
I would assume I'm missing linker or compiler flags, but I don't have any idea on where to add these flags in this project.
Any suggestions? thanks