User Name
Password
AppleNova Forums » Programmer's Nook »

Help with Hello World


Register Members List Calendar Search FAQ Posting Guidelines
Help with Hello World
Thread Tools
Messiahtosh
Apple Historian
 
Join Date: May 2004
 
2006-01-17, 21:14

This question is for anyone that's used Qt (a C++ API) on Mac OS X. I'm trying
to run a simple "hello world program" from the book we're using. The code is

(../hello/hello.cpp):

#include <qapplication.h>
#include <qlabel.h>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!", 0);
app.setMainWidget(label);
label->show();
return app.exec();
}

To run the program the book tells me to run the following commands:

qmake -project
qmake hello.pro
make
open hello.app

Everything works fine until the "open" command spits out the following:

2006-01-17 17:10:07.176 open[4505] LSOpenFromURLSpec() returned -10827 for
application (null) urls
file://localhost/Developer/qt-mac-free-3.2.1/hello/hello.app/.

I have no idea what this means. I checked the code and did everything verbatim
from the book. If someone could help me I would greatly appreciate it.
Thanks!
  quote
bassplayinMacFiend
Banging the Bottom End
 
Join Date: Jun 2004
 
2006-01-18, 08:28

Try using open -a hello.app

The "-a" switch is what I use to launch GUI apps from the command line. This is for Xcode generated apps though, I'm not sure if it'll work the same for Qt apps.
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-01-18, 08:33

Sounds like a corrupt bundle to me. What does Info.plist look like?
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2006-01-18, 11:09

i havent done much with Qt, on OSX or otherwise, but I suspect that make is not generating hello.app, but instead just an executable: hello. try: ./hello from that directory. if that doesn't work, can you report back with a listing of the directory contents? also, and again this may be my ignorance of Qt, but you may need to create a window to add the Qt label to (this is quite unrelated to your error though).
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

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


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova