I have a similar or possibly the same problem as some others that I have seen, but I'm not sure. I use a mingw copy of gcc directly from the Windows command line for files in my personal directory, and I edited PATH to include C: \ MinGW \ bin
Following:
gcc -o print print.c
I do not need the output file, or I thought so. I opened the file browser and sat there while gcc ran, and saw that the file appeared, and shortly after completion gcc disappeared. I am not getting errors.
Just run
gcc print.c
gives nothing, but
mingw32-gcc print.c
Here is my PATH (cleared to better fit my screen):
C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86; C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static; C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files\Broadcom\Broadcom802.11;C:\Program Files\Broadcom\Broadcom 802.11\Driver; C:\Program Files (x86)\QuickTime\QTSystem\;C:\MinGW\bin
This happens with several source files, but here is the source of the one I'm working on if you think this might be a problem:
#include <stdio.h> int main(void) { for (;;) { int i; i = 0; int num; printf("Please enter a number:\n"); scanf("%d", &num); printf("\n"); if (num <= 0) { return 0; } while (i <= num) { printf("%d\n", i); i++; } } }
Yes, I know that itβs really simple, Iβm just starting to learn C.
Any ideas?
I download Code :: Blocks right now and update if I find out that it works correctly there.
Edit: Requested exit ahead
Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++ ,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld -- with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable- libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/ mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T Thread model: win32 gcc version 4.8.1 (GCC) COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro' c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1.exe -quiet -v -iprefix c:\mingw\b in\../lib/gcc/mingw32/4.8.1/ print.c -quiet -dumpbase print.c -mtune=generic -ma rch=pentiumpro -auxbase print -version -o C:\Users\kyle\AppData\Local\Temp\ccBlz Ym1.s GNU C (GCC) version 4.8.1 (mingw32) compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu de" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../.. /../../include" ignoring duplicate directory "/mingw/include" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu de-fixed" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../.. /../../mingw32/include" ignoring duplicate directory "/mingw/include"
Edit: I get the same problem in Code :: Blocks.