gpt4 book ai didi

c++ - 表达式无法准备在目标中运行

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:52:12 25 4
gpt4 key购买 nike

所以我在 C++ 中有一个 vector 数组。以下问题的解决方案是什么?

(lldb) print KVVolData
(std::__1::vector<std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >, std::__1::allocator<std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > > > >) $0 = size=229 {
[0] = size=183 {
[0] = size=10 {
[0] = 0.00000000000000000000000000000000000000000000001105491104531593
[1] = 0.000000000000000000000000000000000000000000000000000000000000000000540669918656838
[2] = 0.00000000000000000000000000000000000000000000000000000000000000000000000000012154950748317273
[3] = 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038562736527236472
[4] = 0.000000000000000000000000000000000000000000000000000000000000037878508340191531
[5] = 0.0000000000000000000000000000000000000000000000000000000024014993980098232
[6] = 0.00000000000000000000000000000000000000000072414226491662559
[7] = 0.000000000000000000000000000000004079177389466422
[8] = 0.00000000000000000000000000000000000000000000000000018972946169202669
[9] = 0.0000000000000000000000000000000000000000000000000001792070883744225
}

当我需要从这个数组中提取值时

print KVVolData[0][0][3]
error: call to a function 'std::__1::vector<std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >, std::__1::allocator<std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > > > >::operator[](unsigned long)' ('_ZNSt3__16vectorINS0_INS0_IdNS_9allocatorIdEEEENS1_IS3_EEEENS1_IS5_EEEixEm') that is not present in the target
error: The expression could not be prepared to run in the target
(lldb)

最佳答案

也许将 -D_LIBCPP_INLINE_VISIBILITY=\"\"添加到您的 CXXFLAGS 中,应该可以解决问题。

关于c++ - 表达式无法准备在目标中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26458961/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com