Open1

C++のビルドツールの種類

vxcallvxcall

忘れちゃうのでメモ。
MinGWはgccを内側で使っている。

  • MSVC (Microsoft Visual C++): MSVC is the C++ compiler provided by Microsoft as part of the Visual Studio suite. It is a popular choice for Windows development, offering advanced features and integration with Microsoft's development tools and libraries.

  • GCC (GNU Compiler Collection): GCC is a widely used open-source compiler collection that supports various programming languages, including C++ (g++). It is available on multiple platforms and is known for its robustness, optimizations, and standards compliance. Many developers use GCC on Linux and other Unix-like systems.

  • MinGW (Minimalist GNU for Windows): MinGW provides a port of the GNU Compiler Collection (GCC) for Windows, allowing you to compile and build C++ programs on the Windows platform. It includes the GCC compiler and various utilities to create Windows executables. MinGW uses the GCC toolchain and is a popular choice for developing C++ applications on Windows.

リンカーオプション

cmakeでMSVCにリンカーオプションを渡す

target_link_options(${PROJECT_NAME} PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/ENTRY:CustomDriverEntry>)

MSVCにリンカーオプションを渡す場合

/ENTRY:CustomEntryPoint

g++にリンカーオプションを渡す場合

-Wl,--entry="CustomEntryPoint"
#or
-Wl,-e="CustomEntryPoint"