Panzerschrek / HexGPU

A game in a world of hexagonal prisms with all game logic calculated by the GPU
GNU General Public License v3.0
11 stars 1 forks source link

In-source tree build triggers `error: multiple definitions of main() function` #1

Open jopadan opened 1 month ago

jopadan commented 1 month ago

See related links: stackoverflow post

cd HexGPU/src && cmake . --install-prefix=/usr && make
[  6%] Built target ImGui
[ 11%] Built target snappy
[ 12%] Linking CXX executable HexGPU
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/HexGPU.dir/Main.cpp.o: in function `main':
Main.cpp:(.text.main+0x0): multiple definition of `main'; CMakeFiles/HexGPU.dir/CMakeFiles/3.30.2/CompilerIdCXX/CMakeCXXCompilerId.cpp.o:CMakeCXXCompilerId.cpp:(.text.main+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/HexGPU.dir/build.make:2860: HexGPU] Error 1
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/HexGPU.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

using gcc-14.2.1/binutils-2.43 toolchain on linux-6.10.3

Panzerschrek commented 1 month ago

@jopadan , could you provide more info, like build log, cmake settings, etc?