PDA

View Full Version : xcode/c++ HELP plz :-(




ellevy12
May 5, 2007, 07:26 AM
hello. i am new to the mac and was doing c++ h.w. under dev cpp in the windows.

now i am trying to figure out xcode and it's really bad :-(

i had this project i was doing under dev cpp and i created a new , empty project in xcode, and dragged all the cpp and header files to the mac.

i tried to build and run it , but it won't work.

i sew that i need to build/make some target, but i dont know what it is and what should i make. i need somthing that runs to the command line like in windows, for a simple c++ course i am taking.

please help !

Elad.



kpua
May 5, 2007, 09:12 AM
Don't choose "Empty Project"
in the New Project setup. Choose "C++ Tool"

peterjhill
May 5, 2007, 09:13 AM
Xcode
file menu
new project
command line utility
c++ tool

start there
i'm not an SDE, so that is about as far as I can take you.

Peter

krisvdc
May 5, 2007, 03:23 PM
Add your files by : Project -> Add to project.

And try not to overwrite the main.cpp, you beter copy paste your other main.cpp in it.

Don't forget to disable the Build -> Allow zeroLink, when i started out with xcode, that caused some freaky results.

Regards,

Kris

ellevy12
May 5, 2007, 04:01 PM
what does the zero link means ??

thanx for the advice guys, it helped, tough i am wondering what the targets means.


do you know of other programs such as Xcode (and more like the nice easy dev c++) for programing c++ under mac os x ?

krisvdc
May 5, 2007, 04:19 PM
zerolink : http://developer.apple.com/documentation/developertools/conceptual/xcodeuserguide20/contents/resources/en.lproj/bs_linking/chapter_34_section_9.html You don't really need to know what it is. It just ****ed up my c apps.

I also code with vim and Makefile on other *nix-es. That's nice and easy ;)

Targets :

I made a new "Command Line utility" -> "C++ tool" with the name qdsf
I change the "active build configuration" to "release", and "build and go"

If I click on the qdsf executable in the project and "reveal in finder" i found a path like /User/kris/qdsf/build/Release/qdsf
I cd to that in terminal and :

pearl:~/qdsf/build/Release kris$ ./qdsf
Hello, World!

All done :)

ellevy12
May 5, 2007, 04:34 PM
OK
and what does building config means?
in dev c++ i only clicked on build and relexed.
what is the diffrence beatwean release and the other?

thanX guys
Elad

peterjhill
May 7, 2007, 10:48 AM
(again, not a developer)

I super highly recommend that you check out textmate. I have been using it August 2005. It is a very powerful text editor. I like it much better than bbedit.

http://www.macromates.com/

It might not replace the editor in xcode, but I know a number of former vi and emacs users that are using textmate.

aaronbrethorst
May 7, 2007, 12:51 PM
(again, not a developer)

I super highly recommend that you check out textmate. I have been using it August 2005. It is a very powerful text editor. I like it much better than bbedit.

http://www.macromates.com/

It might not replace the editor in xcode, but I know a number of former vi and emacs users that are using textmate.

I'll echo Peter's comments. TextMate is fantastic, and you may be much better off with it than an IDE. I love IDEs, don't get me wrong (especially having worked on one for the past three years), but they can get in the way when you're just learning how to program.

Good luck!
Aaron

AussieSusan
May 7, 2007, 05:47 PM
As you are finding out, Xcode is NOT Visual Studio.

While not a solution to your immediate problems, I strongly suggest that you get one of the books available on developing under Xcode. These (typically) take you through the various steps and describe the purpose of the sources 'folders', targets, executables etc..

Once you get the hang of the various concepts built into Xcode, then you will be able to do a lot with it, but my experience is that it has a fairly steep learning (or familiarity) curve. It can do everything I want it to, but i needed to learn how to talk to it in the way it was expecting.

Taking a bit of time now will same you heaps of frustration later on.

Susan

lorductape
May 7, 2007, 07:46 PM
or you could do what i did and get crossover mac and run devC++, arguably the best free compiler there is.

Mr.Texor
May 7, 2007, 07:55 PM
here's some info about a build config (http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_05_build_configs/chapter_33_section_2.html#//apple_ref/doc/uid/TP40002692-SW1)