timmu
22nd January 2013, 15:23
I'd like to know if the .pro file for mac should contain something Mac-specific in order to compile command line applications?
I have a simple "Hello world" console application but I'm not seeing "Hello world" on the screen.
This is how I compile:
qmake -project
qmake -spec macx-g++
make
My main.cpp
#include <QCoreApplication>
#include "gw.cpp"
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication application(argc, argv);
gw();
return 0;
}
My gw.cpp
void gw()
{
cout << "Hello world";
}
I have Mac OS X 10.6.8 and Xcode 3.2.6
Added after 10 minutes:
I found out that I didn't know how to run application properly. I had to do
open test.app/Contents/MacOS/test
This is a bit awkward. Is there a more elegant (shorter) way to start applications on command line?
I have a simple "Hello world" console application but I'm not seeing "Hello world" on the screen.
This is how I compile:
qmake -project
qmake -spec macx-g++
make
My main.cpp
#include <QCoreApplication>
#include "gw.cpp"
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication application(argc, argv);
gw();
return 0;
}
My gw.cpp
void gw()
{
cout << "Hello world";
}
I have Mac OS X 10.6.8 and Xcode 3.2.6
Added after 10 minutes:
I found out that I didn't know how to run application properly. I had to do
open test.app/Contents/MacOS/test
This is a bit awkward. Is there a more elegant (shorter) way to start applications on command line?