MS Visual C++ to XCode

K

k01

Guest
Hi, I am very new to C++ and am trying to use code written in MS Visual C++ in XCode. I have the help of experienced C++ programmers, but most use PCs and one codes on Linux machines. Unfortunately, the combined knowledge doesn't quite solve the problem of running Visual C++ programs in XCode. I'd really appreciate any advice on how to go from one to the other! thanks
 
OP
E

echo12

Guest
Does XCode work?

k01 said:
Hi, I am very new to C++ and am trying to use code written in MS Visual C++ in XCode. I have the help of experienced C++ programmers, but most use PCs and one codes on Linux machines. Unfortunately, the combined knowledge doesn't quite solve the problem of running Visual C++ programs in XCode. I'd really appreciate any advice on how to go from one to the other! thanks

I just posted a question in Mac Software about Visual Studio. I just started my first programming class in college and they use Visual Studio to compile C++. I have my own PowerBook and would like to write on it but my code has to compile in Visual Studio for credit. Can I do this with XCode?
 
OP
J

josgraha

Guest
The short answer for questions about porting code between XCode and Visual Studio is "yes" with a *huge* disclaimer and that is your code is 100% portable between platforms. Also XCode and Visual studio both have their own build scripts so you will have a bunch of extra files like the project files and build scripts. I used to do stuff like that with Project Builder and Visual Studio. I would just check the project into cvs or copy the project directory over to each machine, then open up the project file for that platform. Your code will have to be 100% portable ANSI C or C++ and this also assumes you are not binding to some "linux" type library such as flex or bison which you will have to get compiled on each platform.
I posted a reply discussing what tools are available for OSX and why I think their development tools are nice. Have fun

http://www.mac-forums.com/forums/showthread.php?t=8756
 
OP
Y

yeailovetosurf

Guest
gcc help

gort said:
Just use gcc.

Hey I use to compile my programs in the terminal using the g++ command until my laptop got stolen and now that I have a new one for some reason its not working it keeps telling im missing the header file iostream. Can you help?
 
Joined
May 12, 2004
Messages
81
Reaction score
0
Points
6
Location
Atlanta, GA
Your Mac's Specs
15" MacBook Pro, 2.16Ghz, 1GB ram
echo12 said:
I just posted a question in Mac Software about Visual Studio. I just started my first programming class in college and they use Visual Studio to compile C++. I have my own PowerBook and would like to write on it but my code has to compile in Visual Studio for credit. Can I do this with XCode?

Hey I am in the same situation. were you able to figure out how to do it? I want to know what is the equivalent for a WIN32 Console application in XCode as obviously, my professor uses Windoze...does anybody know?
 
Joined
Dec 30, 2002
Messages
2,118
Reaction score
23
Points
38
Location
Sunny So Cal
Your Mac's Specs
G5•2x1.8•1.5•320•8x+/-
i used XCode for my C programming class. makes an .out file that you can execute in the terminal. by default it makes the file name a.out

to make a WIN executable, i used Dev C++ at school or work.
 
Joined
May 12, 2004
Messages
81
Reaction score
0
Points
6
Location
Atlanta, GA
Your Mac's Specs
15" MacBook Pro, 2.16Ghz, 1GB ram
MacAddikt said:
i used XCode for my C programming class. makes an .out file that you can execute in the terminal. by default it makes the file name a.out

to make a WIN executable, i used Dev C++ at school or work.

thanks for the reply. the problem is that I need to submit my assignments as a .cpp file. I tried using the simple code we used on visual C++ 6.0. Does xcode have the same libraries as Visual C++? for example, this is the code i used in Visual:

#include <iostream.h>

int main()
{
cout << "Welcome to CIS 3260.";

return 0;

}

but it doesn't work with xcode. should it? thanks
 
Joined
Dec 30, 2002
Messages
2,118
Reaction score
23
Points
38
Location
Sunny So Cal
Your Mac's Specs
G5•2x1.8•1.5•320•8x+/-
not sure if gcc comes with the iostream.h, i remember it didnt like conio.h. but i found the iostream header file in my Dev C files here at work if you need it.
 
Joined
Dec 28, 2003
Messages
911
Reaction score
13
Points
18
Location
Long Island, NY
Your Mac's Specs
15" MacBook Pro & 23" ACD
It needs the using namespace std;
below the #include lines'

ex.
#include <vector>
using namespace std;
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top