Reputation: 161
I'm so sorry but my English isn't good enough!!
I write a c++ console application program in visual studio 2012 and now i want to run this on another computer without source file and just with exe file I try to copy .exe file in another computer (windows 7) and run it on that computer but it didn't work!! what should i do to run this program in another computer ? can i make a setup file for my console application ?
Thanks....
Here is some of my code:
#include <iostream>
#include <conio.h>
#include <string>
#include <fstream>
#include <vector>
#include "Person.h"
#include <Windows.h>
using namespace std;
int main()
{
ifstream iFile("phonebook.txt", ios::in);
ofstream oFile("phonebook.txt", ios::out);
vector<Person *> phoneBook;
string n, f, t, m; //baraye inke 0 avale shomare ha ham hesab shavad adadhaye voroodi ra ham az jense string tarif mikonim
int i,choose,choose2;
bool flag=true;
while(flag)
{
system("cls");
cout<<"1. Insert Contact\n2. Show Contacts\n3. Exit\n";
cin>>choose;
switch(choose)
{
case 1:
system("cls");
cout << "\t\t\t***Insert New Contact***\n";
cout<<"\n\nName: ";
cin >> n ;
cout<<"\nFamily: ";
cin>> f ;
cout<<"\nHome Number: ";
cin>> t ;
cout<<"\nMobile Number: ";
cin>> m;
phoneBook.push_back(new Person(n, f, t, m));
for (i = 0; i < phoneBook.size(); i++)
{
oFile << phoneBook[i]->getName() << ' ' << phoneBook[i]->getFamily() << ' ' << phoneBook[i]->getTell() << ' ' << phoneBook[i]->getMobile() << endl;
}
break;
//....
Upvotes: 0
Views: 708
Reputation: 356
The target machine will require the VC++ redistributables, or require the executable be packaged with VC++ dependency libraries that can be found here.
Upvotes: 3