b335 CodeBlocks main.c has a lock - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > Userland Programming & Scripting

Userland Programming & Scripting C, Shell, Perl, Sed & Awk

Reply
 
Thread Tools Display Modes
  #1  
Old September 18th, 2012, 22:12
mrfree mrfree is offline
Junior Member
 
Join Date: Jul 2012
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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~
Reply With Quote
  #2  
Old September 19th, 2012, 08:49
Crivens Crivens is offline
Member
 
Join Date: Oct 2010
Posts: 549
Thanks: 72
Thanked 111 Times in 78 Posts
Default

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
Reply With Quote
  #3  
Old September 19th, 2012, 17:09
mrfree mrfree is offline
Junior Member
 
Join Date: Jul 2012
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4  
Old September 19th, 2012, 19:58
Crivens Crivens is offline
Member
 
Join Date: Oct 2010
Posts: 549
Thanks: 72
Thanked 111 Times in 78 Posts
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT +1. The time now is 06:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0