Closed caem1420 closed 6 months ago
You can add the following lines to CMakeLists:
find_package(CURL REQUIRED)
list(APPEND APP_PLATFORM_LIB CURL::libcurl)
refer to this project: https://github.com/PoloNX/SimpleModDownloader/blob/master/CMakeLists.txt
You can add the following lines to CMakeLists:
find_package(CURL REQUIRED) list(APPEND APP_PLATFORM_LIB CURL::libcurl)
I've tried but its throwing this error
[ 96%] Linking CXX executable testAppCarlos.elf
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `deflate_init_writer':
content_encoding.c:(.text.deflate_init_writer+0x40): undefined reference to `inflateInit_'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `gzip_close_writer':
content_encoding.c:(.text.gzip_close_writer+0x54): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `deflate_close_writer':
content_encoding.c:(.text.deflate_close_writer+0x54): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `exit_zlib':
content_encoding.c:(.text.exit_zlib+0x68): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `gzip_init_writer':
content_encoding.c:(.text.gzip_init_writer+0x38): undefined reference to `zlibVersion'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.gzip_init_writer+0x60): undefined reference to `inflateInit2_'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.gzip_init_writer+0x94): undefined reference to `inflateInit2_'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `inflate_stream':
content_encoding.c:(.text.inflate_stream+0x80): undefined reference to `inflate'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.inflate_stream+0x22c): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.inflate_stream+0x244): undefined reference to `inflateInit2_'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.inflate_stream+0x2ac): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.inflate_stream+0x2d4): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: content_encoding.c:(.text.inflate_stream+0x33c): undefined reference to `inflateEnd'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/13.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-content_encoding.o): in function `gzip_unencode_write':
content_encoding.c:(.text.gzip_unencode_write+0x2d4): undefined reference to `inflateEnd'
find_package(ZLIB REQUIRED)
list(APPEND APP_PLATFORM_LIB ZLIB::ZLIB)
find_package(ZLIB REQUIRED) list(APPEND APP_PLATFORM_LIB ZLIB::ZLIB)
Thanks it worked, sorry for the inconvenience i'm kinda noob in this
Hi, im trying to add curl to the app that im making but i cannot find where to link the library, its supose to go before -lnx but i cant find that either.