CodeBlocks main.c has a lock

Hello everyone, I have been trying to learn C with Codeblocks. Everytime I try to create a new project, the main.c file has a lock showing and I am unable to run or write to the simple hello world sample code. Could anyone shed some light

Code:
> ls -l
total 16
drwxr-xr-x  2 mrfree  wheel  512 Sep 17 21:51 Downloads
drwxr-xr-x  2 mrfree  wheel  512 Sep 17 21:51 Pictures
drwxr-xr-x  2 mrfree  wheel  512 Sep 18 01:13 Traffic
drwxr-xr-x  3 mrfree  wheel  512 Sep 18 17:04 scripts
> cd scripts
> ls -l
total 4
drwxr-xr-x  4 mrfree  wheel  512 Sep 18 17:05 contacts
>

I am trying to create a program so I can save random contacts but I can't run or edit anything.

Below is the message for codeblocks when I try to run "hello world" example

Code:
 Compiling: /usr/home/mrfree/scripts/contacts/main.c
Linking console executable: /usr/home/mrfree/scripts/contacts/main
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
Checking for existence: /usr/home/mrfree/scripts/contacts/main
Executing: xterm -T '/usr/home/mrfree/scripts/contacts/main' -e "/usr/home/mrfree/scripts/contacts/main" (in /usr/home/mrfree/scripts/contacts)
Process terminated with status 0 (0 minutes, 0 seconds)
Thanks ~Mr.Free~
 
This looks more like your main() simply does not do anything and simply returns. There is no error reported, so maybe you now need to learn about debugging. Starting with a simple printf or puts should help.
 
Thanks the main() comes standard when ever you open a new project. I gave up on codeblocks and just used nano then cc file.txt and ran as sudo and everything worked. I thought it was a permission problem but the hello world program wouldn't spawn a term either as sudo when tryed in codeblocks...

Thanks for the help Crivens:)
 
Glad I could be of help.

But you might really REALLY want to read up on sudo and what the naming conventions for files are.
 
Back
Top