sharkdp / dbg-macro

A dbg(…) macro for C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

it does't android ndk

lzhiyong opened this issue · comments

I use dbg.h to print JNI log, but there are very many errors, can you let it support Android NDK?
my code:

#ifdef __ANDROID__
#include <android/log.h>
#endif
   output << std::endl;
    std::cerr << output.str();
    
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO,  "dbg",  "%s\n", output.str().c_str());
#endif

    return std::forward<T>(value);

The code doesn't mention the dbg.h header or any dbg(…) macro calls?!

Also, these error messages do not seem to originate from dbg.h. At least, as far as I can tell from your screenshot.

The code doesn't mention the dbg.h header or any dbg(…) macro calls?!

Also, these error messages do not seem to originate from dbg.h. At least, as far as I can tell from your screenshot.

dbg.h is included in main.cpp, just contains the header file.
dbg(...) method has not been called, there are many errors in compiling.
I compiled it through ndk-build, but if I use NDK's aarch64-linux-android toolchain can be compiled successfully.
aarch64-linux-android-clang++ main.cpp -o main is OK

I don't know ndk-build, so I'm not sure how I can help here. Does it come with C++11 and STL support?

I don't know ndk-build, so I'm not sure how I can help here. Does it come with C++11 and STL support?

Google Android NDK uses llvm+clang, the clang version is ckang-9, supports c++17, although the problem is not solved, but still thank you for your reply, I will close the issue!