HarmonyOS SDK Developer Beta1 algorithm报错?

In file included from D:/xxxxxxxx/math/include/math.h:9:
In file included from D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/algorithm:1774:
In file included from D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__algorithm/nth_element.h:15:
D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__algorithm/sort.h:396:5: error: unknown type name '__destruct_n'
__destruct_n __d(0);
^
D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__algorithm/sort.h:397:28: error: use of undeclared identifier '__destruct_n'
unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
^
D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__algorithm/sort.h:397:41: error: expected expression
unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
^
D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__algorithm/sort.h:415:5: error: use of undeclared identifier '__h'; did you mean '__d'?
__h.release();
^
D:/Program/Huawei/SDK_Next/HarmonyOS-NEXT-DB1/base/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__algorithm/sort.h:396:18: note: '__d' declared here
__destruct_n __d(0);

\_\_algorithm文件夹下stable\_partition.h sort.h inplace\_merge.h多个文件下有undeclared identifier

阅读 622
1 个回答

有个算法头文件,是Math.h,M大写的,但是编译器去找sdk的 math.h了。

把include路径指向Math.h的上层,用带路径的头文件引用解决问题。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进