Witajcie
Otóż mam problem ze skompilowaniem programu tak żeby uruchomić go na drugim kompie. Gdy komplikuje go to mogę go uruchomić tylko u siebie, a na drugim sprzęcie pisze “Ponowne zainstalowanie aplikacji może naprawić błąd”…
Napisałem sobie taki oto program wiem, wiem podstawy. Ale uczę się dopiero.
#pragma once
#include
namespace My3 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
///
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
///
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
protected:
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::TextBox^ textBox2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->textBox2 = (gcnew System::Windows::Forms::TextBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(37, 150);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"licz!";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(25, 74);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(100, 20);
this->textBox1->TabIndex = 1;
//
// textBox2
//
this->textBox2->Location = System::Drawing::Point(25, 124);
this->textBox2->Name = L"textBox2";
this->textBox2->Size = System::Drawing::Size(100, 20);
this->textBox2->TabIndex = 2;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(25, 55);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(96, 13);
this->label1->TabIndex = 3;
this->label1->Text = L"Krawędź podstawy";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(25, 105);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(110, 13);
this->label2->TabIndex = 4;
this->label2->Text = L"Wysokość ostrosłupa";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(12, 9);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(129, 13);
this->label3->TabIndex = 5;
this->label3->Text = L"Pole i objętość ostrosłupa";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(1, 22);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(150, 13);
this->label4->TabIndex = 6;
this->label4->Text = L"czworokątnego prawidłowego";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(151, 186);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->textBox2);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->button1);
this->Name = L"Form1";
this->Text = L"Program1";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
int kraw;
int wys;
double pole;
double wystr;
double wystr2;
double potega;
double obj;
kraw = Convert::ToInt16 (textBox1->Text);
wys = Convert::ToInt16 (textBox2->Text);
wystr = sqrt((1/2)*(double)kraw * (1/2)*(double)kraw + (double)wys * (double)wys);
(double)wystr2 = sqrt(wystr);
pole = (double)kraw * (double)kraw + (double)wystr2 * (double)kraw * 2;
obj = ((double)kraw * (double)kraw * (double)wys)/3;
MessageBox::Show ("Pole: " + Convert::ToString(pole)+ " j^2. \n" + "Objętość: " + Convert::ToString(obj)+ " j^3. \n", "Pole i objętość: ");
}
};
}
A więc jak go skompilować żeby działało na tym drugim kompie?
Mój kompilator to Visual C++ Express Edition 2008. Mam nadzieje że za bardzo nie zagmatwałem
Z góry dzięki za odpowiedź
Pozdrawiam
Tiger133