xfangfang / borealis

Hardware accelerated, Nintendo Switch inspired UI library for PC, Android, iOS, PSV, PS4 and Nintendo Switch
Apache License 2.0
31 stars 21 forks source link

curl issue where put -lcurl #80

Closed caem1420 closed 6 months ago

caem1420 commented 6 months ago

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.

xfangfang commented 6 months ago

https://github.com/xfangfang/borealis/blob/c69613838c294aea44ace86976202ee9fc753de5/CMakeLists.txt#L43-L46

You can add the following lines to CMakeLists:

find_package(CURL REQUIRED)
list(APPEND APP_PLATFORM_LIB CURL::libcurl)
xfangfang commented 6 months ago

refer to this project: https://github.com/PoloNX/SimpleModDownloader/blob/master/CMakeLists.txt

caem1420 commented 6 months ago

https://github.com/xfangfang/borealis/blob/c69613838c294aea44ace86976202ee9fc753de5/CMakeLists.txt#L43-L46

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'
xfangfang commented 6 months ago
find_package(ZLIB REQUIRED)
list(APPEND APP_PLATFORM_LIB ZLIB::ZLIB)
caem1420 commented 6 months ago
find_package(ZLIB REQUIRED)
list(APPEND APP_PLATFORM_LIB ZLIB::ZLIB)

Thanks it worked, sorry for the inconvenience i'm kinda noob in this