b335
![]() |
|
|
|
|
|||||||
| Userland Programming & Scripting C, Shell, Perl, Sed & Awk |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 > 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) |
|
#2
|
|||
|
|||
|
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.
__________________
Optimists believe we live in the best world possible. Pessimists agree to this. Two little lights, blinking out in a sky full of stars - we will never forget you. I miss you so much |
|
#3
|
|||
|
|||
|
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
|
|
#4
|
|||
|
|||
|
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.
__________________
Optimists believe we live in the best world possible. Pessimists agree to this. Two little lights, blinking out in a sky full of stars - we will never forget you. I miss you so much |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can Emacs do everything C++ that Codeblocks can do? | neilms | Userland Programming & Scripting | 22 | July 15th, 2012 06:04 |
| postfix: /usr/local/etc/postfix/main.cf vs. /usr/local/libexec/postfix/main.cf? | stefanlasiewski | Web & Network Services | 1 | June 1st, 2012 04:21 |
| [Solved] problem with codeblocks and wxwidgets 2.8 | Johnny2Bad | Userland Programming & Scripting | 1 | June 9th, 2011 08:55 |
| gdb without main() | killwin | Userland Programming & Scripting | 0 | June 1st, 2010 15:02 |
| [Solved] Logging Into The Main Desktop | serdal22 | Installing & Upgrading | 8 | April 19th, 2010 12:50 |