Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ncook06

macrumors regular
Original poster
Feb 11, 2006
184
0
Tampa, FL
I have had immense amounts of trouble editing and compiling c++ in Xcode. I have version 2.4.1 installed. I'm sure it's just something stupid that I'm doing.

Can someone please go over a step-by-step process of starting a .cpp file in Xcode? I'm using both the standard library and a .h graphics library that one of my professors wrote.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I'm using both the standard library and a .h graphics library that one of my professors wrote.

The problem could be from the this "graphics library" from your professor. Most likely it's Windows code in there that won't compile on the Mac.
 

toddburch

macrumors 6502a
Dec 4, 2006
748
0
Katy, Texas
I always start with File>New Project, then scroll down to Command Line utility > C++ Tool.

Then, paste your code into the main.cpp file.

Todd
 

ncook06

macrumors regular
Original poster
Feb 11, 2006
184
0
Tampa, FL
The problem could be from the this "graphics library" from your professor. Most likely it's Windows code in there that won't compile on the Mac.

He wrote it to compile in unix on his server, so I doubt it would be a problem. But what do I know? :) That's why I'm asking. I'm just wondering if I need to open it somewhere specific in Xcode.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
He wrote it to compile in unix on his server, so I doubt it would be a problem. But what do I know? :) That's why I'm asking. I'm just wondering if I need to open it somewhere specific in Xcode.

If that's the case, it probably is standard code then, unless he's using a GUI kit like GTK+, Qt, or similar (which I doubt).

Are you getting any errors? If so, it would help to post them. If not, it may be easier to start over with toddburch's directions.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.