3ds-curl (libcurl) gives me "undefined reference to" errors

Post Reply
enthusiasticGeek
Posts: 2
Joined: Mon Oct 07, 2019 5:20 pm

I installed 3ds-curl, but include won't find it.

Post by enthusiasticGeek » Mon Oct 07, 2019 5:30 pm

I installed 3ds-curl, but when attempting it make my app it says

Code: Select all

fatal error: curl/curl.h: No such file or directory
.
When including it, I have it set to

Code: Select all

#include <curl/curl.h>
, which is what it says to do in the libcurl examples. Is it possible I'm supposed to include it from somewhere else? I am using an Ubuntu x64 machine. I'm a complete beginner to making homebrew applications and devkitPro.

enthusiasticGeek
Posts: 2
Joined: Mon Oct 07, 2019 5:20 pm

3ds-curl (libcurl) gives me "undefined reference to" errors

Post by enthusiasticGeek » Tue Oct 08, 2019 7:57 pm

I posted earlier about how I installed 3ds-curl but make couldn't find it. Since then, I fixed it by adding -I/opt/devkitpro/portlibs/3ds/include/ to the INCLUDE variable within the Makefile. However, now I am getting multiple undefined reference to errors. Here is the complete make output starting with it linking Project.elf:

Code: Select all

linking Project.elf
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: main.o: in function `main':
/home/sam/Downloads/Project/source/main.c:107: undefined reference to `curl_global_init'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:108: undefined reference to `curl_easy_init'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:110: undefined reference to `curl_easy_setopt'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:111: undefined reference to `curl_easy_setopt'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:112: undefined reference to `curl_easy_setopt'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:113: undefined reference to `curl_easy_setopt'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:114: undefined reference to `curl_easy_setopt'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:116: undefined reference to `curl_easy_perform'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:117: undefined reference to `curl_easy_cleanup'
/opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld: /home/sam/Downloads/Project/source/main.c:119: undefined reference to `curl_global_cleanup'
collect2: error: ld returned 1 exit status
/opt/devkitpro/devkitARM/3ds_rules:41: recipe for target '/home/sam/Downloads/Project/Project.elf' failed
make[1]: *** [/home/sam/Downloads/Project/Project.elf] Error 1
Makefile:167: recipe for target 'all' failed
make: *** [all] Error 2
This time, I really am completely stuck!

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: 3ds-curl (libcurl) gives me "undefined reference to" errors

Post by WinterMute » Mon Oct 21, 2019 11:47 pm

Add $(PORTLIBS) to the LIBDIRS variable here https://github.com/devkitPro/3ds-exampl ... kefile#L66

Add

Code: Select all

`curl-config --cflags`
to CFLAGS at https://github.com/devkitPro/3ds-exampl ... kefile#L49
i.e.

Code: Select all

CFLAGS	:=	-g -Wall -O2 -mword-relocations \
			-fomit-frame-pointer -ffunction-sections \
			`curl-config --cflags`
			$(ARCH)
replace

Code: Select all

LIBS	:= -lctru -lm
at https://github.com/devkitPro/3ds-exampl ... kefile#L60 with

Code: Select all

LIBS	:= `curl-config --libs`
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest