Wed, 03/06/2024 - 12:49
Forums:
Hello everyone,
I'm currently encountering an issue with my C++ code while using the OCCT (Open CASCADE Technology) library. The error I'm receiving is C2065, indicating that "Poles" is an undeclared identifier. Here's the code snippet that's causing the problem:
#include <iostream>
#include <TColgp_Array2OfPnt.hxx>
int main() {
// Creating a control point matrix
TColgp_Array2OfPnt Poles(1, 2, 1, 3);
// Filling the control point matrix
Poles.SetValue(1, 2, gp_Pnt(1, 2, 3));
return 0;
}
I'm not sure what's causing this issue and would greatly appreciate any assistance in resolving it.
Thanks in advance for your help!
Wed, 03/06/2024 - 12:55
Hi, could you share a compiler or linker log? are you sure that you link TKernel.lib (libTKernel.a) and TKMath
Best regards, Dmitrii.
Wed, 03/06/2024 - 13:07
Thank you for your response. I used cmake to build this code. Here is my cmakelists:
output:
it works when i deleted setvalue function.
Wed, 03/06/2024 - 13:09
there are TKernel and TKMath lib
Wed, 03/06/2024 - 13:17
Thanks, could you share compiler log?
Wed, 03/06/2024 - 13:19
Additionally I recommend to use CMake like this DE_Wrapper-Sample/src/CoreDE/CMakeLists.txt at main · dpasukhi/DE_Wrapper-Sample (github.com)
It will helps to connect debug and release versions.
Best regards, Dmitrii.
Wed, 03/06/2024 - 16:29
Thank you, problem solved even though I haven't figured out why it occurred.
I simply resaved the 'main.cpp' file as UTF-16 and then saved it again as UTF-8.
Interesting!