0

I am having trouble while using the codeblocks-16.01mingw-setup.exe - installed in a file whose path does not contain spaces - when trying to compile at a comand prompt. A beginner's guide recommended using the following line in command prompt:

gcc cards.c -o cards

for the source file named cards.c (on my desktop). This gives the error

'gcc' is not recognised as an internal or external command, operable program or batch file.

When trying to figure this out, I have found out that you can drag and drop files in your command prompt and it specifies their path. Doing this with the gcc.exe taken from F:\Programare\Codeblocks\MinGW\bin\gcc.exe and adding the c source file as C:\Users\dream\Desktop\cards.c gives the error

as.exe - System error: The program can't start because libintl-8.dll is missing from your computer. Try reinstalling the program to fix this problem.

I've reinstated my Codeblocks to no avail. I've also tried matching the paths of the compiler with the source file, bringing the source code where the compiler was, again to no avail.

Please help me understand the issue. I must say that the file named libintl-8.dll is right there where gcc.exe is, trying to add it in the command prompt gives some syntax error.

user694733
  • 13,861
  • 1
  • 40
  • 62
Hemispherr
  • 150
  • 8

2 Answers2

1

gcc is trying to find that dll file in the working directory, so you need to cd into that directory cd /d F:\Programare\Codeblocks\MinGW\bin.

Dynamic-Link Library Search Order (Windows)

  1. The directory specified by lpFileName.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
Zero King
  • 61
  • 4
1

You have to add F:\Programare\Codeblocks\MinGW\bin\ to your users or systems PATH environment variable.

Once you have done this you can simply type

gcc cards.c -o cards
GSIO01
  • 491
  • 7
  • 12