Closed sonoro1234 closed 4 years ago
Generally there are many build systems that can drive GCC (and TDM-GCC), so maybe it needs to go in the CMake README? But here's another way to solve it: https://github.com/jmeubank/tdm-gcc-installer/blob/master/CMakeLists.txt#L10-L12:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -std=gnu++11 -m32")
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -F pe-i386")
But this requires to modify CMakeLists.txt which is not possible in my usecase!!
Hi @sonoro1234 , I closed this issue because TDM-GCC appears to be operating as designed and in line with expectations set by the GCC and MinGW-w64 projects around the use of flags to govern 32-bit and 64-bit output. You also hit a 32/64-bit incompatibility that needs to be fixed by invoking the resource compiler, windres, with the right flags. CMake probably provides appropriate invocations for your use case.
Since TDM-GCC is currently a one-man show, please commit to doing research and experimentation to solve issues like this. :)
(Just for future reference and without intention to bother you at all)
I setted the above flags in a toolchain file (dropping -fno-rtti because boost complain about it ) as:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -m32")
set(CMAKE_RC_FLAGS "--target=pe-i386 --output-format=coff ${CMAKE_RC_FLAGS}")
but the problem still persists
The cause seems to be that CMAKE_RC_COMPILE_OBJECT
is set in CMakeLists.txt as;
SET(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
skipping <FLAGS>
.
But, what is worse, if I add <FLAGS>
there are other flags from add_definitions
that get mixed with RC_FLAGS
so that windres complains and refuses to compile. It seems a cmake bug!!! https://gitlab.kitware.com/cmake/cmake/-/issues/12998
Solved changing CMAKE_RC_COMPILE_OBJECT in repository to be compiled to:
SET(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> ${CMAKE_RC_FLAGS} -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
Hi,
Trying to compile with TDM-GCC-32 gave me error about not being able to find dsound.h so I tried with TDM-GCC-64: (which has dsound.h)
I found this mail thread regarding CMake settings for TDM -m32 or -m64 flags: https://cmake.org/pipermail/cmake/2017-December/066798.html
I used it in command line cmake invocation as:
I think it would be useful adding it to readme
Althought perhaps something is missing: Compiling SuperCollider for 32 bits stopped after