![]() I didn't include the C++ file test.h in CMakeLists.txt. But my problem is I need to add vector to my existing project, and my existing project can't resolve the symbol vector. ![]() Then I created a new module library mylibrary for this project, and in there I added a cpp folder and test.h and it also resolved the symbol vector( mylibrary module's adle had been correctly added CMake stuff by me). This time Android Studio resolved symbol vector correctly. I added code #include in line 3 in this file. ![]() After I clicked the finish button, Android Studio automatically created the file native-lib.cpp for me. In the last step, I kept the default Toolchain Default for C++ Standard option. In step 1 of the new project wizard, I checked include C++ Support. I created a new project in Android Studio. ![]() What's the key difference between my project and teapots that makes the latter one able to resolve vector and std but mine not? What did I do wrong? Why does project teapots not have this problem? Īndroid Studio did resolve vector and std symbol for this project. I imported project teapots which contains #include. I don't have code completion on some variables, like array in test.h. It can be compiled successfully and installed on my phone. I move the mouse over it and it says Can't resolve container 'std'. When I move the mouse over it, it will popup a window which says Cannot find 'vector'. In file ~/project/library/src/main/cpp/test.h, vector in #include is red. Std::vector array // std is red, says "can't resolve container std" ~/project/library/src/main/cpp/test.h: #include // vector is red, says "cannot find vector" ~/project/adle include ':app', ':library' I also tried '-DANDROID_STL=gnustl_shared', result is same
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |