How to use Portlibs in MacOSX
Posted: Wed Apr 15, 2020 7:04 am
I'm having trouble using devkitpro's portlibs, curl in particular. I have run dkp-pacman -S switch-curl and made sure it's installed. However, when I try to build it with -lcurl in the Makefile, I get linker errors like this.
/opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-mbedtls.o): in function `Curl_mbedtls_version':
mbedtls.c:(.text.Curl_mbedtls_version+0x14): undefined reference to `mbedtls_version_get_number'
It compiles just fine if I don't use any functions from libcurl. The code I am trying to run that gives me an error is this:
curl_global_init(CURL_GLOBAL_SSL);
The header looks like this:
#include <string>
#include <switch.h>
#include <curl/curl.h>
I am using C++, could that be the issue?
/opt/devkitpro/portlibs/switch/lib/libcurl.a(libcurl_la-mbedtls.o): in function `Curl_mbedtls_version':
mbedtls.c:(.text.Curl_mbedtls_version+0x14): undefined reference to `mbedtls_version_get_number'
It compiles just fine if I don't use any functions from libcurl. The code I am trying to run that gives me an error is this:
curl_global_init(CURL_GLOBAL_SSL);
The header looks like this:
#include <string>
#include <switch.h>
#include <curl/curl.h>
I am using C++, could that be the issue?