New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

MS Visual C++ to XCode


Post Reply New Thread Subscribe

 
Thread Tools
k01
Guest
 
Posts: n/a

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
QUOTE Thanks
gort

 
Member Since: Jul 25, 2004
Location: Gaithersburg, MD
Posts: 389
gort is on a distinguished road
Mac Specs: Mac Pro 2.6ghz Quad Xeon, 23" Cinema

gort is offline
Just use gcc.
QUOTE Thanks
echo12
Guest
 
Posts: n/a

Quote:
Originally Posted by k01
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?
QUOTE Thanks
josgraha
Guest
 
Posts: n/a

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

pc -> mac | visual studio c++ .net -> ?
QUOTE Thanks
yeailovetosurf
Guest
 
Posts: n/a

Quote:
Originally Posted by gort
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?
QUOTE Thanks
iaminvincible

 
iaminvincible's Avatar
 
Member Since: May 12, 2004
Location: Atlanta, GA
Posts: 81
iaminvincible is on a distinguished road
Mac Specs: 15" MacBook Pro, 2.16Ghz, 1GB ram

iaminvincible is offline
Quote:
Originally Posted by echo12
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?

An apple a day keeps the doctor away...
QUOTE Thanks
MacAddikt

 
MacAddikt's Avatar
 
Member Since: Dec 30, 2002
Location: Sunny So Cal
Posts: 2,118
MacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of light
Mac Specs: G52x1.81.53208x+/-

MacAddikt is offline
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.

QUOTE Thanks
iaminvincible

 
iaminvincible's Avatar
 
Member Since: May 12, 2004
Location: Atlanta, GA
Posts: 81
iaminvincible is on a distinguished road
Mac Specs: 15" MacBook Pro, 2.16Ghz, 1GB ram

iaminvincible is offline
Quote:
Originally Posted by MacAddikt
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

An apple a day keeps the doctor away...
QUOTE Thanks
MacAddikt

 
MacAddikt's Avatar
 
Member Since: Dec 30, 2002
Location: Sunny So Cal
Posts: 2,118
MacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of lightMacAddikt is a glorious beacon of light
Mac Specs: G52x1.81.53208x+/-

MacAddikt is offline
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.

QUOTE Thanks
ApplejustWorks

 
Member Since: Dec 28, 2003
Location: Long Island, NY
Posts: 911
ApplejustWorks is on a distinguished road
Mac Specs: 15" MacBook Pro & 23" ACD

ApplejustWorks is offline
It needs the using namespace std;
below the #include lines'

ex.
#include <vector>
using namespace std;
QUOTE Thanks

Post Reply New Thread Subscribe


« WND C++ in Virtual PC | newbie question »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Question about exceptions in C++ via Xcode cipher OS X - Development and Darwin 2 06-25-2004 11:02 AM
Xcode doesn't run application correctly dr_springfield OS X - Development and Darwin 5 04-07-2004 12:22 AM
Easiest Compiled Language in Xcode? Jetroza OS X - Development and Darwin 3 01-02-2004 03:42 AM
New Xcode plug-in helps developers reuse code Murlyn OS X - Development and Darwin 0 11-10-2003 01:16 PM
Xcode developer tools updated Murlyn OS X - Development and Darwin 0 11-04-2003 06:09 PM

All times are GMT -4. The time now is 10:41 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?