Open jordiboni opened 2 years ago
You're right. I've let catch
header include in the starter project. I'll remove it.
In the meantime, you can either:
add_executable( unit_tests "tests/unit_tests.cpp")
from CMakeLists.txtI committed a fix but unfortunately, I won't have the opportunity to test it myself soon. If you still have any issues, let me know.
Gotcha, it has been fixed removing the line from CMakeLists.txt. Now I'm facing another issue. Should I open a new issue or can we have a look with this one?
Thank you for the quick response!
> Executing task: ninja <
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/jbonastre/Documents/CodinGame/aaaaa/build
[1/1] Linking CXX executable ..\bin\bot.exe
FAILED: ../bin/bot.exe
cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -fuse-ld=lld-link -nostartfiles -nostdlib -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ggdb3 -D_GLIBCXX_ASSERTIONS=1 -fuse-ld=lld -Xlinker /subsystem:console CMakeFiles/bot.dir/src/bot.cpp.obj -o ..\bin\bot.exe -Xlinker /MANIFEST:EMBED -Xlinker /implib:..\lib\bot.lib -Xlinker /pdb:..\bin\bot.pdb -Xlinker /version:0.0 -LC:/Users/jbonastre/Documents/CodinGame/tools/lib -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cmd.exe /C "cd /D C:\Users\jbonastre\Documents\CodinGame\aaaaa\build && python C:/Users/jbonastre/Documents/CodinGame/aaaaa/merge_source_files.py C:/Users/jbonastre/Documents/CodinGame/aaaaa/src/bot.cpp C:\Users\jbonastre\Documents\CodinGame\tools\include C:/Users/jbonastre/Documents/CodinGame/aaaaa/package/bot.cpp""
lld-link: error: <root>: undefined symbol: mainCRTStartup
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I guess we could look at this problem in the same issue.
This error reminds me of what I got when I first tried the clang + lld configuration on Windows. I add to pass extra cmake arguments to make it work. Go to the extension settings and enter -DCMAKE_SYSTEM_NAME="Generic"
into the field Codin Game: Cmake Extra
.
I really wanted to keep using clang on Windows for the nice error/warning messages, but it's still a pain to make it work ^^.
Same error, these are my settings:
For some reasons, I remember that I also specified the C compiler path, however, I think it won't help with your issue. Did you reconfigure the build after you changed the CMake Extra value?
yes, I tried with Debug and Release configs
Ok, I'll try and check the whole process on a new computer
Interesting, I've created a new project and we can move one step forward
It complains about python now, py is the keyword recognized on Win
> Executing task: ninja <
[2/2] Linking CXX executable ..\bin\bot
FAILED: ../bin/bot
cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ggdb3 -D_GLIBCXX_ASSERTIONS=1 -fuse-ld=lld CMakeFiles/bot.dir/src/bot.cpp.obj -o ..\bin\bot -LC:/Users/jbonastre/Documents/CodinGame/tools/lib && cmd.exe /C "cd /D C:\Users\jbonastre\Documents\CodinGame\testProject1\build && python C:/Users/jbonastre/Documents/CodinGame/testProject1/merge_source_files.py C:/Users/jbonastre/Documents/CodinGame/testProject1/src/bot.cpp C:\Users\jbonastre\Documents\CodinGame\tools\include C:/Users/jbonastre/Documents/CodinGame/testProject1/package/bot.cpp""
'python' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Changed CMakelist, it seems to have been finished
> Executing task: ninja <
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/jbonastre/Documents/CodinGame/testProject1/build
[1/1] Linking CXX executable ..\bin\bot
Terminal will be reused by tasks, press any key to close it.
That reminds me of something. I think that went I set up the CMake Extra variable I had to remove the whole build to see the effect of changes: you cannot change toolchain on a CMake build, you have to recreate it from scratch. For the python issue, the most probable reason is it is missing from the path. Did you add the python's binary directory to the path? I had to add C:\Users\atom\AppData\Roaming\Python\Python39\Scripts to mine.
Followed your steps for Windows but getting this error when trying to build your starter project