PDA

View Full Version : make for Mac



timmu
22nd January 2013, 16: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?

wysota
23rd January 2013, 20:45
I think this is not a correct forum to ask this question :) You should ask on some Mac forum.

Uncle Google claims you should be able to do:
open test.app