Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with running Hello World on GCC

Status
Not open for further replies.

Alexander Yin

Junior Member level 2
Joined
May 29, 2007
Messages
21
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Finland
Activity points
1,450
I have installed a complete version of Cygwin. When I tried to run the Hello World program which is provided in An Introduction to GCC. The code which is called hello.c looks like:

#include <stdio.h>

int
main (void)
{
printf ("Hello, world!\n");
return 0;
}

I used the following command:
$ gcc -Wall hello.c -o hello

But after this command is run, nothing happens and there is no hello.out either. When I tried to run the program by:
$ ./hello
An error comes:
bash: ./hello: No such file or directory

How can I solve this problem?

Thank you.


Added after 18 minutes:

I tried to move the hello.c to other directory, but still it does not work. It seems that executable file cannot be created. But I don't know how to solve it.

Added after 35 minutes:

I have reinstalled the Devel package in Cygwin, but of no use.
 

I have tried the same code on code with the same command on Linux, and it works. But still not working on Cygwin. I have re-install the cygwin several times today and nothing happens.
 

It is solved by the technical support of my department.

The problem is that there were two files called "cygwin1.dll" in my system. One was maybe installed by some other softwares but cygwin. When compiling, the cygwin cannot locate which dll to use.

After removing the wrong dll file, the program works correctly.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top