Skip to main content
Associate
September 26, 2024
Solved

Issue with gtest in Cube IDE

  • September 26, 2024
  • 1 reply
  • 1099 views

I am trying to use google test on a project in the cube IDE. I am using a sample "hello world" project. I have referenced various tutorials and instructions and here are my settings. My google test library is downloaded via msys2 and I am running a PC build with the latest installed cubeIDE, msys2 etc. 

C++ and C compilers. 

benjamin123_1-1727333040046.png

C++ linker:

benjamin123_0-1727333005995.png

However, I am getting the following errors:

benjamin123_0-1727333282641.png

It seems to me that the C++ standard is the cause. But I have change the compiler to use various C++ standards and I still get this error. 

Would appreciate if I can get some help on this. I will provide additional detail if needed. Thank you. 

Best answer by benjamin123

I have solved my problem. It seems that the mingw environment is mapped to C:\msys64\ucrt64 and ucrt64 does not support the gtest library well. So I changed the environment variable to C:\msys64\mingw64 and now it works. 

benjamin123_0-1727336541472.png

 

1 reply

benjamin123AuthorBest answer
Associate
September 26, 2024

I have solved my problem. It seems that the mingw environment is mapped to C:\msys64\ucrt64 and ucrt64 does not support the gtest library well. So I changed the environment variable to C:\msys64\mingw64 and now it works. 

benjamin123_0-1727336541472.png