New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Hello World app takes 45s to start from the terminal, gcc, gdb and dtrace problems


Post Reply New Thread Subscribe

 
Thread Tools
Ethan asdf

 
Member Since: Feb 11, 2009
Posts: 3
Ethan asdf is on a distinguished road

Ethan asdf is offline
Hi,

If I compile a program like

#include <stdio.h>

int main(int argc, char** argv)
{
printf("Hello World\n");
return 0;
}
on the terminal (simply using 'gcc helloworld.c') and then run it from Terminal, it takes about 45 seconds where the entire terminal app is locked up and the spinning pinwheel is shown before the program executes.

What on earth could be going on? If I try
sudo dtruss ~/ea/c/a.out
Password:
dtrace: failed to execute /Users/ea/c/a.out: file is set-id or unreadable [Note: the '-c' option requires a full pathname to the file]
The file is a+rx (what does set-id mean?).

Finally, if i try gdb ./a.out:
gdb ./a.out
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"..../a.out: No such file or directory.

(gdb) run
Starting program:
No executable file specified.
Use the "file" or "exec-file" command.
(gdb) start
I'm totally confused. This stuff should all just work. What could be happening? FWIW, This is using
gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5490~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5490)
gdb -v
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".
Mac OS X 10.5.5, Xcode 3.1.2
QUOTE Thanks
deer dance

 
deer dance's Avatar
 
Member Since: Jan 23, 2009
Location: Indiana
Posts: 162
deer dance has a little shameless behaviour in the past
Mac Specs: Soon to own

deer dance is offline
Remove the int argc, blah blah... Stuff, should be instantanious.


Proud Python Programmer/HTML Expert
Believer in Mac OS 7
QUOTE Thanks
Ethan asdf

 
Member Since: Feb 11, 2009
Posts: 3
Ethan asdf is on a distinguished road

Ethan asdf is offline
Quote:
Originally Posted by deer dance View Post
Remove the int argc, blah blah... Stuff, should be instantaneous.
Thanks for the idea, but no dice. These problems are on my work computer. I tried the same thing on my macbook pro w/o any problem. Reinstalling xcode didn't help.
QUOTE Thanks
deer dance

 
deer dance's Avatar
 
Member Since: Jan 23, 2009
Location: Indiana
Posts: 162
deer dance has a little shameless behaviour in the past
Mac Specs: Soon to own

deer dance is offline
What are your work computer's specs? Small processor = slow compiler


Proud Python Programmer/HTML Expert
Believer in Mac OS 7
QUOTE Thanks
Ethan asdf

 
Member Since: Feb 11, 2009
Posts: 3
Ethan asdf is on a distinguished road

Ethan asdf is offline
Quote:
Originally Posted by deer dance View Post
What are your work computer's specs? Small processor = slow compiler
Brand new 2 x 2.8 GHz Quad-Core Intel Xeon

I wish it was that easy :-)
QUOTE Thanks
deer dance

 
deer dance's Avatar
 
Member Since: Jan 23, 2009
Location: Indiana
Posts: 162
deer dance has a little shameless behaviour in the past
Mac Specs: Soon to own

deer dance is offline
What compiler are you using?

If it's the Dev C++ Compiler, then I'm stumped

If not, Download Dev C++


Proud Python Programmer/HTML Expert
Believer in Mac OS 7
QUOTE Thanks

Post Reply New Thread Subscribe


« Use Applescript to run a terminal command | Trying a simple OpenGL program »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 08:02 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?