Tutorial Ex1 in Step2 fail to build

hi, everyone, I just started to learn CMake and run into a problem when I tried to build Excercise 1 in tutorial step2. I am running inside the terminal in VS code on ubuntu and got the following message.

cmake --build .
Consolidate compiler generated dependencies of target MathFunctions
[ 60%] Built target MathFunctions
[ 80%] Linking CXX executable Tutorial
/usr/bin/ld: cannot find -lPublic: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/Tutorial.dir/build.make:98: Tutorial] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/Tutorial.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

Any help is appreciated. This is the first time I post here, so I can’t attach the log file or screenshot here. Thank you for reading this!

CMake is case sensitive in this situation. I think you may have written target_link_libraries(Tutorial Public MathFunctions) when you needed to write target_link_libraries(Tutorial PUBLIC MathFunctions). Notice how the “PUBLIC” is in all caps. This is generally the case for flags and named parameters to CMake functions, so pay attention to the casing.

Thanks for the quick response. The build works and it produces the executable. But somehow the include header is flagged inside tutorial.cxx file. Any idea as to what happened? Thanks again!

// TODO 5: Include MathFunctions.h
#include “TutorialConfig.h”
#include “MathFunctions.h”

cannot open source file “MathFunctions.h”
#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (/home/lzpc/Downloads/cmake-3.28.1-tutorial-source/cmakeTutorSource/Step2/tutorial.cxx).
cannot open source file “TutorialConfig.h”

Unfortunately, I don’t think I can provide much more assistance on how your IDE is behaving. If the build works, it should mean everything is configured properly as far as CMake is concerned.

Thanks!