Blackened Justice
4th March 2012, 12:02
Hey everyone,
I'm trying to learn a bit of Objective C, and figured that I could just use a regular qmake project and Qt Creator as an IDE. I didn't find much documentation regarding this, so I just fooled around a bit, trying to see if I could make it work. Well, I can't ;) Here's my current .pro file:
LIBS += -lobjc
OBJECTIVE_HEADERS += Hello.h
OBJECTIVE_SOURCES += Hello.m \
main.m
When I try to compile it, I get the following output:
g++ -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -Wl,-O1 -o objc -L/usr/lib -lobjc -lQtGui -lQtCore -lpthread
/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [objc] Error 1
If I compile it manually, with "gcc -lobjc Hello.m main.m -o Hello" everything goes smoothly, so it's clearly a problem of my understanding of qmake ;)
Cheers
I'm trying to learn a bit of Objective C, and figured that I could just use a regular qmake project and Qt Creator as an IDE. I didn't find much documentation regarding this, so I just fooled around a bit, trying to see if I could make it work. Well, I can't ;) Here's my current .pro file:
LIBS += -lobjc
OBJECTIVE_HEADERS += Hello.h
OBJECTIVE_SOURCES += Hello.m \
main.m
When I try to compile it, I get the following output:
g++ -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -Wl,-O1 -o objc -L/usr/lib -lobjc -lQtGui -lQtCore -lpthread
/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [objc] Error 1
If I compile it manually, with "gcc -lobjc Hello.m main.m -o Hello" everything goes smoothly, so it's clearly a problem of my understanding of qmake ;)
Cheers