기존에 내가 사용하는 Mingw64 g++ 컴파일러가 64bit 컴파일이다.
이것을 32bit로 해서 확인할 내용이 있어 32bit 컴파일이 필요했다.
이 경우 Linux에서 gcc-multilib 패키지를 사용해서 컴파일 할수 있는건 아는데
Windows가 문제였다.
Mingw64 gcc 컴파일에 Mingw32 도 함께 있는 크로스 컴파일러가 필요하다.
https://stackoverflow.com/questions/67671973/gcc-m32-not-working-on-windows-hosted-agents
gcc -m32 not working on Windows hosted agents
I’ve created a simple Azure DevOps pipeline on hosted agent with vs2017-win2016 image: Prepare C file [PowerShell task]: New-Item "test.c" -ItemType File -Value "int Foo() { return ...
stackoverflow.com
처음에 cmake에서 계속 했는데도 잘 안됐는데.. 따로 터미널로 해보니 잘된다.
해당 바이너리를 보면 32bit 64bit 가 제대로 되어져있음을 확인할 수 있다.
이제 CMakeLists.txt를 잘 써야되는데..
add_compile_options와 CXX_FLAGS가 잘 먹질 않았다...
테스트 할때 명령어로는 되는데.. 그래서 vscode의 구성 build파일을 다 지우고 다시하면 잘 된다...
Difference between add_compile_options and SET(CMAKE_CXX_FLAGS...)
This question is related to Instruct Cmake to use CXX and CXXFLAGS when driving link? In the former question, we are trying to instruct CMake to use CXXFLAGS when it invokes the linker.
stackoverflow.com
https://stackoverflow.com/questions/5805874/the-proper-way-of-forcing-a-32-bit-compile-using-cmake
The proper way of forcing a 32-bit compile using CMake
Sorry that there are many similar questions, but I do find that Googling for CMake queries always yields similar-but-not-the-same scenarios, conflicting CMake commands and so on! I need to force my
stackoverflow.com
'빨간색 에러들' 카테고리의 다른 글
[GCC] vscode cmake debug not working / Windows GCC Install (0) | 2022.04.07 |
---|---|
[Vscode] visual studio connect Host SSH connection Error (0) | 2022.03.26 |
visual studio invalid multibyte character sequence (0) | 2022.02.15 |
[WSL] WSL2: copy from Windows to WSL2 (0) | 2022.01.18 |
[WSL] WSL2 Virtualbox Conflict (2/2) (0) | 2022.01.18 |