sw icon indicating copy to clipboard operation
sw copied to clipboard

how to set mingw or tdm-gcc as the compiler of sw

Open rodingbao opened this issue 1 year ago • 9 comments

how to set mingw or tdm-gcc as the compiler of sw, sw always reminder " Exception in file D:/dev/cppan2/client2/src/sw/driver/compiler/detect.cpp:1417, function addSettingsAndSetPrograms: No suitable compilers found. Please, install one first."

rodingbao avatar Oct 24 '24 07:10 rodingbao

Hi,

  1. Please run with --trace flag and post the output.
  2. Try to run sw in mingw shell (also post output if any error). Try --compiler gcc flags
  3. Try to add g++ compiler from mingw to PATH.

egorpugin avatar Oct 24 '24 14:10 egorpugin

  1. Please run with --trace flag and post the output.
  2. Try to run sw in mingw shell (also post output if any error). Try --compiler gcc flags

### do you mean command "sw build -compiler=gcc "

image
  1. Try to add g++ compiler from mingw to PATH.

### the path of g++ compiler was already included in Windows environment variables PATH

image

rodingbao avatar Oct 26 '24 10:10 rodingbao

  1. Please run with --trace flag and post the output.

egorpugin avatar Oct 26 '24 13:10 egorpugin

  1. Please run with --trace flag and post the output.

E:\Coding\sw\leptonic>sw build -compiler=gcc -trace
Starting sw...
version:
sw.client.sw version 1.0.0
git revision c6b731a48ee4660a922b0f9c140c8e24edac234a
assembled on
30.05.2024 19:29:15 UTC
31.05.2024 03:29:15 �й���׼ʱ��
command line:
sw build -compiler=gcc -trace
Checking remote version
Couldn't download db version file: Exception in file D:/dev/primitives/src/http/src/http.cpp:301, function download_file: url = https://raw.githubusercontent.com/SoftwareNetwork/database/master//db.version, curl error: Couldn't connect to server
Host configuration: {"os":{"arch":"x86_64","kernel":"com.Microsoft.Windows.NT"}}
Registering driver: org.sw.sw.driver.cpp-0.4.1
using sw frontend for input "E:/Coding/sw/leptonic\\sw.cpp"
build id 0000027155D82BF0 performing void __cdecl sw::SwBuild::loadInputs(void)
New host configuration: {"os":{"arch":"x86_64","kernel":"com.Microsoft.Windows.NT"},"sw_config":"true"}
Detected target: org.gnu.binutils.ar-2.36.1: null
Detected program: C:\TDM-GCC-64\bin\ar.exe
Detected target: org.gnu.gcc-10.3.0: null
Detected program: C:\TDM-GCC-64\bin\gcc.exe
Detected target: org.gnu.gpp-10.3.0: null
Detected program: C:\TDM-GCC-64\bin\g++.exe
Detecting msvc 14 and older
getWindowsKitRootFromReg::TryOpen error: 系统找不到指定的文件。
getWindowsKitRootFromReg::TryOpen error: 系统找不到指定的文件。
getWindowsKitRootFromReg::TryOpen error: 系统找不到指定的文件。
getWindowsKitRootFromReg::TryOpen error: 系统找不到指定的文件。
getWindowsKitRootFromReg::TryOpen error: 系统找不到指定的文件。
getWindowsKitRootFromReg::TryOpen error: 系统找不到指定的文件。
listWindows10KitsFromReg::TryOpen error: 系统找不到指定的文件。
listWindows10KitsFromReg::TryOpen error: 系统找不到指定的文件。
listWindows10KitsFromReg::TryOpen error: 系统找不到指定的文件。
New host configuration: {"os":{"arch":"x86_64","kernel":"com.Microsoft.Windows.NT"}}
Exception in file D:/dev/cppan2/client2/src/sw/driver/compiler/detect.cpp:1417, function addSettingsAndSetPrograms: No suitable compilers found.
Please, install one first.

rodingbao avatar Oct 26 '24 15:10 rodingbao

Thank you.

So, gcc is visible, but there is some other issue. Need to check it.

Detected target: org.gnu.binutils.ar-2.36.1: null
Detected program: C:\TDM-GCC-64\bin\ar.exe
Detected target: org.gnu.gcc-10.3.0: null
Detected program: C:\TDM-GCC-64\bin\gcc.exe
Detected target: org.gnu.gpp-10.3.0: null
Detected program: C:\TDM-GCC-64\bin\g++.exe

egorpugin avatar Oct 26 '24 15:10 egorpugin

So, gcc is visible, but there is some other issue. Need to check it.

### it seems that raw.githubusercontent.com was not existed.

image

rodingbao avatar Oct 27 '24 00:10 rodingbao

It seems it is blocked in your country.

egorpugin avatar Oct 27 '24 00:10 egorpugin

  1. Currently sw requires VS2022 or build tools for its own work. Known limitation. Please install it.
  2. Please try attached binary, I've updated some code bits for gcc to work. (Rename to sw.exe and replaces yours.)
  3. Sw packages will probably have many errors when built with gcc on windows. You can still report those issue right in this issue.

sw.client.sw-1.0.0.exe.zip

egorpugin avatar Oct 27 '24 00:10 egorpugin

thanks,I will try

rodingbao avatar Oct 27 '24 01:10 rodingbao