Curl

  • Thread starter Thread starter Amiga-Tan
  • Start date Start date
  • Views Views 3,261
  • Replies Replies 5

Amiga-Tan

Uses game consoles as personal computers
Member
Joined
Aug 7, 2019
Messages
204
Reaction score
126
Trophies
0
Location
Albuquerque, New Mexico
XP
573
Country
United States
I cannot for the life of me get curl working on DevKitPro. Can someone give me a rundown or a link to a precompiled folder? i'm tired of changing the makefile and includes to be met with millions of the same error about invalid references.
 
You should just need to:
  1. Run sudo dkp-pacman -S 3ds-curl 3ds-mbedtls ("sudo" and "dkp-" may need to left out depending on OS)
  2. Add -lcurl -lmbedtls -lmbedx509 -lmbedcrypto (in this order!) to the LIBS in your Makefile, probably best to add them at the start of the LIBS line as order does matter, putting them after -lctru or such might cause issues
  3. Add $(PORTLIBS) to the LIBDIRS in your Makefile, order shouldn't matter here but I would put it at the start of the line
 
This finally got rid of the 3ds-cURL errors, but now it seems like it's confused about the other libraries?? What now?

Code:
$ make
linking jermus.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `gzip_init_writer':
content_encoding.c:(.text.gzip_init_writer+0x28): undefined reference to `zlibVersion'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.gzip_init_writer+0x4c): undefined reference to `inflateInit2_'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.gzip_init_writer+0x6c): undefined reference to `inflateInit2_'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `exit_zlib':
content_encoding.c:(.text.exit_zlib+0x50): undefined reference to `inflateEnd'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `deflate_init_writer':
content_encoding.c:(.text.deflate_init_writer+0x30): undefined reference to `inflateInit_'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `inflate_stream':
content_encoding.c:(.text.inflate_stream+0x78): undefined reference to `inflate'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.inflate_stream+0x148): undefined reference to `inflateEnd'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.inflate_stream+0x15c): undefined reference to `inflateInit2_'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/devkitARM/3ds_rules:42: /c/thec/jermus/jermus.elf] Error 1
make: *** [Makefile:172: all] Error 2
 
This finally got rid of the 3ds-cURL errors, but now it seems like it's confused about the other libraries?? What now?

Code:
$ make
linking jermus.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `gzip_init_writer':
content_encoding.c:(.text.gzip_init_writer+0x28): undefined reference to `zlibVersion'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.gzip_init_writer+0x4c): undefined reference to `inflateInit2_'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.gzip_init_writer+0x6c): undefined reference to `inflateInit2_'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `exit_zlib':
content_encoding.c:(.text.exit_zlib+0x50): undefined reference to `inflateEnd'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `deflate_init_writer':
content_encoding.c:(.text.deflate_init_writer+0x30): undefined reference to `inflateInit_'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: C:/devkitPro/portlibs/3ds/lib\libcurl.a(libcurl_la-content_encoding.o): in function `inflate_stream':
content_encoding.c:(.text.inflate_stream+0x78): undefined reference to `inflate'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.inflate_stream+0x148): undefined reference to `inflateEnd'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/9.1.0/../../../../arm-none-eabi/bin/ld.exe: content_encoding.c:(.text.inflate_stream+0x15c): undefined reference to `inflateInit2_'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/devkitARM/3ds_rules:42: /c/thec/jermus/jermus.elf] Error 1
make: *** [Makefile:172: all] Error 2
Hmm, probably need some of -lbz2 -llzma -lz to the right of -lmbedcrypto in LIBS. I'm not sure exactly which of those are necessary, probably -lz since one says zlib, maybe one or both of the others too. Maybe -larchive too (to the left of the rest, right of mbed crypto), but I think that's only used for extracting zips and such, not cURL.

To install those with pacman:
-lbz2 => 3ds-bzip2
-llzma => 3ds-liblzma
-lz => 3ds-zlib
-larchive => 3ds-libarchive

or for all of them just sudo dkp-pacman -S 3ds-bzip2 3ds-liblzma 3ds-zlib 3ds-libarchive.
 
  • Like
Reactions: Takokeshi
What are you trying to compile?
A web browser i'm making, it will wreck the 3ds's in every way besides the way it displays the page itself, you'll be able to download files, view some of them, and view the source of the page itself, only problem is i have no clue how to parse html properly so it'll all be text only, regex'd html for now. it'll be more so intended for advanced users than what Nintendo was going for, and i plan on making it touch-driven. This is all mostly because i'm tired of having to rely on an external device for a lot of the filey, online stuff on my 3ds.

That and i just like making web browsers for weird systems, i made one for the EV3 in SmallBasic, one for Snap!/BYOB, so why not try making another on a system to test my mileage with C? Besides that, i'm doing pretty good so far after figuring out variable typey bullshit and most of the external stuff (cURL:angry:), but i imagine each stage will have it's own wave of difficulty with it since so far i've only started on the bare metal components and finally got html to print out on the 3ds's screen properly.
 

Site & Scene News

Popular threads in this forum