简体   繁体   中英

How do I link an NDK static library (.a) with android CMake?

I wanna link the libgomp.a, but I had no success so far. :( I've already tried find_library ( gomp-lib gomp ), but it doesn't find. I don't know what else to do.

What is happening is that even though "#include " works, it doesn't find its function links when I try to use them. So I thought I had to link the static library some way. Android finds libxxx.so libraries just fine with find_library ( variable_name xxx). But not the (.a) ones.

people! I just found out the problem. In my gradle build I, on the cmake {} area, was using cFlags and cppFlags at the same time, and I just set the -fopenmp flag in the cFlags variable. The problem was solved when I also set the -fopenmp flag in the cppFlags. After this, I just erased the cFlags variable and started working only with the cppFlags.

At the end, I concluded that those static libraries (.a) are linked by to our NDK apps by default when, for example, I 'need' because of a flag, as I didn't need to do any linking on the cmake by myself.

Thank you all, I hoped this helps you all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM