I have tried searching for a solution, but I haven’t been able to find a solution that prevents the error form occurring while using the code that should build fine. This specifically pertains to Exercise 1 of Step 2 in the Cmake Tutorial. I downloaded the code being used in the tutorial from Github. I also am using cmake 3.26.1 installed on a computer running Windows 11.
With all the details, I did all the steps for Exercise 1 in Step 2 and get the error where {PATH} is the root directory that the “CMake-master”:
{PATH}\CMake-master\Help\guide\tutorial\Step2\tutorial.cxx(27,30): error
C3861: ‘mysqrt’: identifier not found [{PATH}\CMake-master\Help\guide\t
utorial\Step2\Step2_build\Tutorial.vcxproj]
After this, I reverted back to the original. I then proceeded to make one update at a time doing a copy and paste of the command from the page to make sure the issue is not being caused by a typo on my part. After each step, I would perform the “cmake --build .” command. They all created the build find until I after making the update for TODO 6, the last one. That is where it executes the library procedure mysqrt. It seems like it is not finding the library. It seems like mysqrt is not in scope. I have programming experience, but not with C++. The reason I’m trying to learn cmake is so I can compile some open source software on a Windows computer rather than Linux and it needs a library, which make this part of the tutorial important. Any help would be appreciated.