Forum > Other

GCC won't work properly (a conflict with FreePascal)

(1/2) > >>

Integra:
I needed C, so I've installed MinGW and set the PATH, but gcc doesn't see the included files like stdio.h. I've typed "where gcc" and found out that FreePascal comes with gcc. Apparently my PC is using gcc that comes with it, even though it's not set in the PATH and I don't know how FreePascal's gcc managed to become the default option.

I tried moving MinGW over to FreePascal's directory but that didn't help. "Gcc -v" says:

        #include "..." search starts here:
        End of search list.

And then it adds:

        The following default directories have been omitted from the search path:
        /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/../../../../include/g++-3
        /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/../../../../include
        /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/../../../../i386-mingw32/include
        /gcc-2.95/lib/gcc-lib/i386-mingw32/2.95/include
        /usr/local/i386-mingw32/include
        End of omitted list.
        empty.c:1: No include path in which to find stdio.h

I don't have these default directories anywhere, so it's fine that they're omitted, I guess. But the end result is still that the PATH is ignored.


Can I fix this without uninstalling FreePascal?

tetrastes:

--- Quote from: Integra on August 28, 2024, 08:53:03 pm ---I needed C, so I've installed MinGW and set the PATH, but gcc doesn't see the included files like stdio.h. I've typed "where gcc" and found out that FreePascal comes with gcc. Apparently my PC is using gcc that comes with it, even though it's not set in the PATH and I don't know how FreePascal's gcc managed to become the default option.

--- End quote ---
Are you sure? What PATH is shown by SET command?

marcov:
Usually the problems come from the fact that both come with own versions of tools.

Easiest is to switch paths when you need either toolchain.

Thaddy:
Do you really have gcc 2.95 installed? That is very,very,very old (dating from 1999!). That might also be a problem.
I never experience problems with my GNU compilers and FPC compilers.
My gcc version is 14.1, stable major release is 13.1 you would need at least 12.1.
Both current versions of cygwin and mingw should install at least 12.1

It is so old that if it is true, there is likely your problem.

Integra:
The SET command shows this path: "C:\MinGW\bin". After some googling I've found out that apparently it's best to use this directory, otherwise issues might arise with MinGW.


--- Quote from: Thaddy on August 29, 2024, 12:13:02 pm ---Do you really have gcc 2.95 installed? That is very,very,very old (dating from 1999!). That might also be a problem.
--- End quote ---
I've installed MinGW-w64, the GCC whose version is shown is the one that comes with FreePascal. I guess it's really old.

Strangely, GCC seems to work for me with CodeBlocks! It's the only IDE where it works, because you can directly set the paths to everything in the options. I've tried other IDEs like Geany, VSCode, CodeLite, but with no luck, GCC can't find its own libraries. But really, CodeBlocks isn't great for my purposes, I need to be able to use a regular command prompt.

At stackoverflow they've suggested that my MinGW installation is just faulty. I'm going to install the latest MSYS2 this time and see if that works. I'll write in the thread again if it does.

Navigation

[0] Message Index

[#] Next page

Go to full version