Sunday, August 2, 2009

Visual c++ run?

how can I run my visual c++ program(which written under win xp)


under linux?

Visual c++ run?
Visual C++ Tutorial %26amp; Basic Concepts


Computer Science and Programming


Dr. Jennifer Kay (with handouts by Rose Boiano and Jennifer Kay)





Background


You will be writing programs, and then compiling and running them. To compile a program (think of compilation as turning C++ code into a different language that your PC can run), it must be a part of a Visual C++ "project".


Think of it this way. A program is a lot like a piece of paper with words on it, and a project is a lot like a big wooden desk. When you create a new Visual C++ Project, you are building a new desk to work on. This desk has a special area where it holds the papers that are most important to you, but there is also lots of space to hold other papers.





Every time you write a new program, you get out a blank piece of paper and write on it. You can also, of course, take an old program (a piece of paper you've already written on) and run it, or modify it and then run it.





When you want to compile and run your program, you have to tell the computer to remove any other papers from the special space on the desk, and put your program in the special space. Then you have to tell it to put your new program in the special space. Finally, you tell it to compile and run what's in the special space.





This document gives you an outline of how to do different common tasks, and has links to the following files:





Creating a New Visual C++ 6.0 Project: Think of this as building a new desk. You should only have to do this once for the entire semester. (Under certain circumstances Visual C++ will mess up your desk and you'll have to build a new one, if things don't seem to be working, this may be the problem. BUT, it's fairly uncommon, probably happens to 5-10% of students over the course of the semester, so don't worry about it too much.)


NEW! Opening a workspace you created earlier: If you built a desk previously, this lets you retrieve that desk rather than building a whole new one each time.


Creating a New Program in an Existing Visual C++ Project: Think of this as getting a brand new sheet of blank paper and putting it on the special space in your desk.


Compiling and Running your Visual C++ 6.0 Project: This is the final step in using your setup. You are telling the computer to compile and then run what's in the special space on your desk.


Removing a program from your project: Think of this as removing something from the special space on your desk that you don't need to use for now. It doesn't mean that you're erasing everything that's on that piece of paper, but you are moving it away from the special space on your desk.


Opening an existing program in your Visual C++ 6.0 Workspace: You use this when you started writing on a piece of paper earlier, maybe even made it into a working program, but at some point you took it off of the special space on your desk. This technique will enable you to put that old piece of paper back on the special space on your desk.








Before you start to use Visual C++ for the first time





Set up your Computer Science %26amp; Programming Folder:


Make a folder on your H drive called CSP


Inside of that folder, make another folder called lab1


(Each week, you'll make a new folder -- lab2, lab3, and so on)





The first time you use Visual C++


Follow the directions in the Creating a New Visual C++ 6.0 Project handout to make a new project.


Follow the directions in the Creating a New Program in an Existing Visual C++ Project handout to write a new program.


Follow the directions in the Compiling and Running your Visual C++ 6.0 Project handout to compile and run your program.


Using Visual C++ again to write a new program


NEW Opening up your workspace again (necessary only when you just start up Visual C++).


Remove your old program from the project as described in the Removing a program from your project handout.


Follow the directions in the Creating a New Program in an Existing Visual C++ Project handout to write a new program.


Follow the directions in the Compiling and Running your Visual C++ 6.0 Project handout to compile and run your program.


Using Visual C++ to look at / run a program you've already written


NEW Opening up your workspace again (necessary only when you start up Visual C++).


Remove your old program from the project as described in the Removing a program from your project handout.


Follow the directions in the Opening an existing program in your Visual C++ 6.0 Workspace handout to open your program


Follow the directions in the Compiling and Running your Visual C++ 6.0 Project handout to compile and run your program.
Reply:I dont think you can as far as i know i dont think visual c++ will work on linux when written in xp if it was done in a borland complier it might be possible otherwise you might be out of luck also they might have software for it i dont use visc++ myself but i know borland reg C++ works on linux so. . .
Reply:check whether gcc compiler is installed in ur version.


if so, u may use g++ command to compile ur c++ program.


u may read gcc manual for further details.
Reply:well considering you probably need the dotnet framework installed....it might not work... but you can try downloading a program for linux that makes exe files run in linux... i think the program is called wine something..... google it, that should work, it also allows many windows installations to work in linux ;)
Reply:Visual C++ Tutorial %26amp; Basic Concepts


Computer Science and Programming


Dr. Jennifer Kay (with handouts by Rose Boiano and Jennifer Kay)





Background


You will be writing programs, and then compiling and running them. To compile a program (think of compilation as turning C++ code into a different language that your PC can run), it must be a part of a Visual C++ "project".


Think of it this way. A program is a lot like a piece of paper with words on it, and a project is a lot like a big wooden desk. When you create a new Visual C++ Project, you are building a new desk to work on. This desk has a special area where it holds the papers that are most important to you, but there is also lots of space to hold other papers.





Every time you write a new program, you get out a blank piece of paper and write on it. You can also, of course, take an old program (a piece of paper you've already written on) and run it, or modify it and then run it.





When you want to compile and run your program, you have to tell the computer to remove any other papers from the special space on the desk, and put your program in the special space. Then you have to tell it to put your new program in the special space. Finally, you tell it to compile and run what's in the special space.





This document gives you an outline of how to do different common tasks, and has links to the following files:





Creating a New Visual C++ 6.0 Project: Think of this as building a new desk. You should only have to do this once for the entire semester. (Under certain circumstances Visual C++ will mess up your desk and you'll have to build a new one, if things don't seem to be working, this may be the problem. BUT, it's fairly uncommon, probably happens to 5-10% of students over the course of the semester, so don't worry about it too much.)


NEW! Opening a workspace you created earlier: If you built a desk previously, this lets you retrieve that desk rather than building a whole new one each time.


Creating a New Program in an Existing Visual C++ Project: Think of this as getting a brand new sheet of blank paper and putting it on the special space in your desk.


Compiling and Running your Visual C++ 6.0 Project: This is the final step in using your setup. You are telling the computer to compile and then run what's in the special space on your desk.


Removing a program from your project: Think of this as removing something from the special space on your desk that you don't need to use for now. It doesn't mean that you're erasing everything that's on that piece of paper, but you are moving it away from the special space on your desk.


Opening an existing program in your Visual C++ 6.0 Workspace: You use this when you started writing on a piece of paper earlier, maybe even made it into a working program, but at some point you took it off of the special space on your desk. This technique will enable you to put that old piece of paper back on the special space on your desk.








Before you start to use Visual C++ for the first time





Set up your Computer Science %26amp; Programming Folder:


Make a folder on your H drive called CSP


Inside of that folder, make another folder called lab1


(Each week, you'll make a new folder -- lab2, lab3, and so on)





The first time you use Visual C++


Follow the directions in the Creating a New Visual C++ 6.0 Project handout to make a new project.


Follow the directions in the Creating a New Program in an Existing Visual C++ Project handout to write a new program.


Follow the directions in the Compiling and Running your Visual C++ 6.0 Project handout to compile and run your program.


Using Visual C++ again to write a new program


NEW Opening up your workspace again (necessary only when you just start up Visual C++).


Remove your old program from the project as described in the Removing a program from your project handout.


Follow the directions in the Creating a New Program in an Existing Visual C++ Project handout to write a new program.


Follow the directions in the Compiling and Running your Visual C++ 6.0 Project handout to compile and run your program.


Using Visual C++ to look at / run a program you've already written


NEW Opening up your workspace again (necessary only when you start up Visual C++).


Remove your old program from the project as described in the Removing a program from your project handout.


Follow the directions in the Opening an existing program in your Visual C++ 6.0 Workspace handout to open your program


Follow the directions in the Compiling and Running your Visual C++ 6.0 Project handout to compile and run your program.


No comments:

Post a Comment