In Android NDK, is their a way to use _splitpath function which available in C stdlib.h?
I have include
#include <stdio.h>
#include <stdlib.h>
and when I call the function
char fname[_MAX_FNAME];
char extn[_MAX_FNAME];
_splitpath(filename.c_str(), NULL, NULL, fname, extn);
It give out error that it cannot find _MAX_FNAME. So I do a quick hack by declare it manually. But then it can not find _splitpath function still. The exact error is
: undefined reference to ‘_splitpath’
_splitpath()and_MAX_FNAMEare part of MSVC’s runtime – they aren’t standard, and are not part of GCC’s library or a Linux system call.You might be able to do what you want using
dirname()andbasename().