Nim compiler fails with "Requested command not found: gcc.exe" - gcc

I tried to launch first program in nim. I downloaded Windows installer from the official site and did the installation with all possible components. But when I try to run the program I get the message:
"unhandled exception: Requested command not found: 'gcc.exe -c -w -IC:nimlib -o
c:nimworknimcacheaa.o c:nimworknimcacheaa.c'. OS error: [OSError] >
Process terminated with exit code 1"
is it possible to fix this situation?

From Nim's website:
Note: The Nim compiler requires a C compiler to compile software. On Windows we recommend that you use Mingw-w64. GCC is recommended on Linux and Clang on Mac.
Make sure to add the gcc binaries to your PATH.

download nim lag and exract the file and paste it in your directory lib

Related

What is the meaning of 'ld: library not found for -lm'

I'm a beginner at Fortran code. I install gfortran from the homebrew to my apple silicon mac. The path show in the terminal when I type which fortran is /opt/homebrew/bin/gfortran
I try to use bash shell to run a 'hello world' fortran file on the Desktop (.f90 file). I typed the following command in the terminal. gfortran prog01_01.f90. But it does not work. The error says: ld: library not found for -lm and collect2: error: ld returned 1 exit status. I have no idea how to deal with this problem.
Can anyone please help me this out?
This means that the compiler cannot find the basic mathematical library libm. It should normally be included in your GLIBC or other standard C library installation and be available in the appropriate library directories and I would expect that your package manager would complain that something is missing.
Anyway, you simply have to fix your software installation, we cannot tell you more without details about your system and your software packages. You can try to install GLIBC if you did not install it yet.

Spin: gcc-6: unrecognized command line option

I want to use SPIN model checker on Windows 10 (64bit) and I have followed the instructions on the spin website:
I installed MinGW and gcc, updated path, and checked in the command prompt it shows version 6.3.0
I installed ActiveTCL updated path, updated path with iSpin too, I can get iSpin to open
when I try to compile pre-included example file leader.pml I get this error:
spin: preprocessing failed gcc -std=gnu99 -Wformat-overflow=0 -E -x c "leader.pml" > "pan.pre"
gcc: error: unrecognized command line option '-Wformat-overflow=0'; did you mean '-Wstrict-overflow='?
I don't understand the error, does someone know what is missing?
The error says exactly what the problem is: -Wformat-overflow=0 is not a recognized command line option.
Not that you are using MinGW GCC 6.3.0, which is very old.
Consider using MinGW-w64 which is much more recent. Currently GCC 11.2.0 is the latest version. You can find a standalone build at https://winlibs.com/
So please try with a newer GCC. If it still does't work run gcc --help -v to see all command line options.

I installed Nim without any problem, but it gives me this error, what should I do?

I install Nim Lang but it not works. I get this errors, how can i fix? (I have completed the setup.)
Error: invocation of external compiler program failed. Sistem belirtilen dosayayi bulamiyor.
Additional info: "Requested command not found: \'gcc.exe -c -w -fmax-errors=3 -mno-ms-bitfields -I\"C:\\Program Files\\Nim Language\\lib\" -IC:\\Users\\SyTax\\Desktop -o C:\\Users\\Sytax\Desktop -o C:\\Users\\SyTax\\nimcache\\name_d\\stdlib_io.nim.c.o C:\\Users\\SyTax\\nimcache\\name_d\\stdlib_io.nim.c\'. OS error:" 2
Error;
enter image description here
Probably you only installed the first package from Nim's windows installation page. Note that there are other dependencies mentioned on that page. You may also need:
MingW compiler dependency, installed with finish.exe.
DLLs available on your system, like PCRE or OpenSSL, also available for download.
Alternatively you could try installing Nim using Scoop, which seems to be able to install both Nim and the required compiler.
The Nim compiler creates C code, so to compile your code to binary and run, you should install a C compiler. The default is GCC. In linux and mac, it comes with the system, so I am assuming you are using windows.
I am not a Windos user, but AFAIK you neet to install mingw amd gcc
http://www.codebind.com/cprogramming/install-mingw-windows-10-gcc/
http://mingw.org/

exec: “gcc”: executable file not found in %PATH% when trying go build

I am running go on a relatively restricted system under Windows 10.
In my go program, there is some CGO code so I must have a GCC compiler to use it.
For some reason, here, it is impossible to install typical systems such as Cygwin or MSYS, which would make the task easier.
Nonetheless, I managed to install the Ubuntu subsystem.
This is great, it means that after the following command:
doskey gcc=Ubuntu run gcc
when I try to execute gcc on Windows I obtain:
C:\PathToFolder\>gcc
gcc: fatal error: no input files
compilation terminated.
However, when I try to then, compile my Go code, I have:
C:\PathToFolder\>go run Main.go
# _/C_/PathToFolder/Package/File
exec: "gcc": executable file not found in %PATH%
Is there any way to force Windows to use my own gcc command through the Ubuntu subsystem?
Thanks in advance,

Error while trying trying to run make command

I am trying to install a program and when I run make or make -f Makefile (following the installation instructions) I get the following output:
g77 -O5 -Wall -c prep_output.f -o prep_output.o
dyld: Symbol not found: ___keymgr_global
Referenced from: /usr/local/bin/g77
Expected in: /usr/lib/libSystem.B.dylib
make: *** [prep_output.o] Abort trap: 6
I am working on a macOS Mojave 10.14.6. Following some other proposed solutions in similar problems, I've already installed Command line tools in my Xcode but that didn't do the trick. Any suggestions please??
Thanks in advance
EDIT:
I got rid of g77 and installed a compatible version of gcc (gcc8) through MacPorts. After running the make command I get the following:
g77 -O5 -Wall -c prep_output.f -o prep_output.o
make: g77: No such file or directory
make: *** [prep_output.o] Error 1
So I guess the program still needs the g77 setup? This is the program btw ([http://www.cfht.hawaii.edu/~arnouts/LEPHARE/install.html]). Is there a way to rely to the gfortran compiler for building the program?
Thanks in advance
P.S. I noticed that when I install g77 I get the following error:
x usr/local/: Can't set user=0/group=0 for usr/local`
`tar: Error exit delayed from previous errors.
However it still installs g77..
The error message indicates that your installation of g77 is broken. This has nothing to do with make or the particular project you're trying to build, except inasmuch as the project is trying to use g77 in the first place. That is a bit surprising, actually, since g77 has been obsolete for years (gfortran is the current GNU Fortran compiler), but I'm uncertain what exactly to expect from XCode in this area.
On the other hand, since the full path to the binary is /usr/local/bin/g77, I'm further inclined to think that you're not using XCode for this at all. Possibly you've dumped a g77 built on some other system into your /usr/local/bin, and it's not compatible with your Mojave system.
Your best bet is probably to
Get rid of your broken g77 installation.
Install Fink or MacPorts, or a similar project.
Install the Fink / MacPorts / whatever package for gfortran (maybe gcc-gfortran or similar in some of those) to get a working Fortran compiler.
Rely on that compiler to build your project.

Resources