Open yangyushi opened 1 year ago
People will get duplicate symbol error during linking.
I get the following error when trying to build TCC with gcc 12. The very easy fix is to use gcc-9 or clang.
gcc-9
clang
... duplicate symbol '_min_cutAA2' in: CMakeFiles/tcc.dir/bonds.c.o CMakeFiles/tcc.dir/voronoi_bonds.c.o ld: 11271 duplicate symbols for architecture x86_64 collect2: error: ld returned 1 exit status make[2]: *** [src/tcc] Error 1 make[1]: *** [src/CMakeFiles/tcc.dir/all] Error 2 make: *** [all] Error 2
I think it is related to the change of default linker flag since gcc 10.
We can remove this error by define the global variables better. I will try to make a pull request about this.
Using
cmake .. -DCMAKE_C_FLAGS=-fcommon
to generate Makefile is also one way to get around this issue~
Makefile
People will get duplicate symbol error during linking.
I get the following error when trying to build TCC with gcc 12. The very easy fix is to use
gcc-9
orclang
.I think it is related to the change of default linker flag since gcc 10.
We can remove this error by define the global variables better. I will try to make a pull request about this.