Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/138.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 发布构建导致简单protobuf代码失败_C++_Release_Protocol Buffers - Fatal编程技术网

C++ 发布构建导致简单protobuf代码失败

C++ 发布构建导致简单protobuf代码失败,c++,release,protocol-buffers,C++,Release,Protocol Buffers,我有以下单元测试代码,它基本上通过序列化和反序列化复制对象: FloatMat mat2; assert(mat2.ParseFromString(mat.SerializeAsString())); cout << mat.vec_size() << "\n"; cout << mat2.vec_size() <&

我有以下单元测试代码,它基本上通过序列化和反序列化复制对象:

FloatMat mat2;                                  
assert(mat2.ParseFromString(mat.SerializeAsString()));      

cout << mat.vec_size() << "\n";                             
cout << mat2.vec_size() << "\n";                            
但当使用cmake发布模式构建时,它提供:

2
0

我不太熟悉发布模式下的建筑,请帮助!谢谢

既然您在assert宏中填充了mat2,而assert宏只在调试版本中进行评估

那么您确定在构建版本时也重新生成并重新生成了protobuf代码吗?
2
0