Форум программистов, компьютерный форум, киберфорум
C++/CLI Windows Forms
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.67/6: Рейтинг темы: голосов - 6, средняя оценка - 4.67
0 / 0 / 0
Регистрация: 03.02.2015
Сообщений: 2

Не компилируется проект

29.04.2015, 12:40. Показов 1289. Ответов 3
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Привет всем, помогите мне!
Вот у меня 2 файла
MyApp.cpp
Кликните здесь для просмотра всего текста
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// MyApp.cpp : main project file.
 
#include "stdafx.h"
#include "Form1.h"
 
    using namespace MyApp;
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
 
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
    panel1->BackColor=Color::Red;
    panel2->BackColor=Color::LightGray;
    panel3->BackColor=Color::LightGray;
    textBox2->Visible=false;
    label2->Visible=false;
    label3->Visible=false;
    insertText(RichTextBox1);
    //----------------------------------------------//
    richTextBox1->AppendText("Жесткости ударов равны:\n");
    richTextBox1->AppendText("\n");
    richTextBox1->AppendText("c1="+Convert::ToString(c1)+"\n");
    richTextBox1->AppendText("c2="+Convert::ToString(c2)+"\n");
    richTextBox1->AppendText("c="+Convert::ToString(c)+"\n");
    richTextBox1->AppendText("\n");
    richTextBox1->AppendText("-----------------------------");
    richTextBox1->AppendText("\n");
    richTextBox1->AppendText("\n");
 
    double c;
    double R=Convert::ToDouble(textBox1->Text);
    double b=Convert::ToDouble(textBox2->Text);
    double E1=Convert::ToDouble(textBox3->Text);
    double L1=Convert::ToDouble(textBox4->Text);
    double L2=Convert::ToDouble(textBox5->Text);
    //-----------------------------------------------//
    double S=0;
    if (panel1->BackColor==Color::Red)
        S=3.14159265*R*R;
    if (panel2->BackColor==Color::Red)
        S=R*b;
    if (panel3->BackColor==Color::Red)
        S=R*b;
    //-----------------------------------------------//
    double c1=E1*S/L1;
    double c2=E1*S/L2;
 
 
private:System::Void выходToolStripMenuItem_Click(System::Object^ sender,
            System::EventArgs^ e)
        {
            Application::Exit();
        };
    // Enabling Windows XP visual effects before any controls are created
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false); 
    //-----------------------------------------------//
    
    
    // Create the main window and run it
    Application::Run(gcnew Form1());
    return 0;
}


Form1.h в архиве

Выдает ошибку компиляции
Кликните здесь для просмотра всего текста
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
------ Build started: Project: MyApp, Configuration: Debug Win32 ------
Compiling...
MyApp.cpp
.\MyApp.cpp(17) : error C2065: 'panel1' : undeclared identifier
.\MyApp.cpp(17) : error C2227: left of '->BackColor' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(18) : error C2065: 'panel2' : undeclared identifier
.\MyApp.cpp(18) : error C2227: left of '->BackColor' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(19) : error C2065: 'panel3' : undeclared identifier
.\MyApp.cpp(19) : error C2227: left of '->BackColor' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(20) : error C2065: 'textBox2' : undeclared identifier
.\MyApp.cpp(20) : error C2227: left of '->Visible' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(21) : error C2065: 'label2' : undeclared identifier
.\MyApp.cpp(21) : error C2227: left of '->Visible' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(22) : error C2065: 'label3' : undeclared identifier
.\MyApp.cpp(22) : error C2227: left of '->Visible' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(23) : error C2065: 'RichTextBox1' : undeclared identifier
.\MyApp.cpp(23) : error C3861: 'insertText': identifier not found
.\MyApp.cpp(25) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(25) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0416' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0435' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0441' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0442' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u043A' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u043E' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0441' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0442' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0438' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0443' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0434' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0430' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0440' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u043E' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0432' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0440' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0430' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u0432' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u043D' cannot be represented in the current code page (1252)
.\MyApp.cpp(25) : warning C4566: character represented by universal-character-name '\u044B' cannot be represented in the current code page (1252)
.\MyApp.cpp(26) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(26) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(27) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(27) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(27) : error C2065: 'c1' : undeclared identifier
.\MyApp.cpp(28) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(28) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(28) : error C2065: 'c2' : undeclared identifier
.\MyApp.cpp(29) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(29) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(29) : error C2065: 'c' : undeclared identifier
.\MyApp.cpp(30) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(30) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(31) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(31) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(32) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(32) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(33) : error C2065: 'richTextBox1' : undeclared identifier
.\MyApp.cpp(33) : error C2227: left of '->AppendText' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(36) : error C2065: 'textBox1' : undeclared identifier
.\MyApp.cpp(36) : error C2227: left of '->Text' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(37) : error C2065: 'textBox2' : undeclared identifier
.\MyApp.cpp(37) : error C2227: left of '->Text' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(38) : error C2065: 'textBox3' : undeclared identifier
.\MyApp.cpp(38) : error C2227: left of '->Text' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(39) : error C2065: 'textBox4' : undeclared identifier
.\MyApp.cpp(39) : error C2227: left of '->Text' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(40) : error C2065: 'textBox5' : undeclared identifier
.\MyApp.cpp(40) : error C2227: left of '->Text' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(43) : error C2065: 'panel1' : undeclared identifier
.\MyApp.cpp(43) : error C2227: left of '->BackColor' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(45) : error C2065: 'panel2' : undeclared identifier
.\MyApp.cpp(45) : error C2227: left of '->BackColor' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(47) : error C2065: 'panel3' : undeclared identifier
.\MyApp.cpp(47) : error C2227: left of '->BackColor' must point to class/struct/union/generic type
        type is ''unknown-type''
.\MyApp.cpp(54) : error C2143: syntax error : missing ';' before 'private'
.\MyApp.cpp(56) : error C2143: syntax error : missing ';' before '{'
Build log was saved at "file://c:\VisualStudio\MyApp\MyApp\Debug\BuildLog.htm"
MyApp - 53 error(s), 20 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Вот как оно выглядит
Миниатюры
Не компилируется проект  
Вложения
Тип файла: zip Form.zip (3.3 Кб, 1 просмотров)
0
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
29.04.2015, 12:40
Ответы с готовыми решениями:

Не компилируется пустой проект
Доброго времени суток! Создал проект (windows forms), собрал пустой проект, при запуске не чего не происходит. Что делать в данном случае?

Не компилируется проект
Помогите пожалуйста исправить ошибки в проекте #include &lt;windows.h&gt; #include &lt;mmsystem.h&gt; #include &lt;vcl.h&gt; ...

Не компилируется проект
Рабочая программа, была написана в Qt 5.1 ОС Windows XP. Недавно была произведена смена ОС на Windows7 x64 и соответственно поставлен новый...

3
Администратор
Эксперт .NET
 Аватар для tezaurismosis
9673 / 4825 / 763
Регистрация: 17.04.2012
Сообщений: 9,664
Записей в блоге: 14
29.04.2015, 21:44
В MyApp.cpp какая-то каша. Всё с 17 по 58 строки должно лежать в Form1.h
Перед всеми строками ставьте L
C++
1
richTextBox1->AppendText(L"Жесткости ударов равны:\n");
0
0 / 0 / 0
Регистрация: 03.02.2015
Сообщений: 2
29.04.2015, 23:47  [ТС]
Исправил, но это ничего не поменяло.
0
Администратор
Эксперт .NET
 Аватар для tezaurismosis
9673 / 4825 / 763
Регистрация: 17.04.2012
Сообщений: 9,664
Записей в блоге: 14
30.04.2015, 18:51
29A, смотря как исправили. Приложите исправленный проект, только не на файлопомойке, а загрузите на форум.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
30.04.2015, 18:51
Помогаю со студенческими работами здесь

Проект не компилируется
#include &lt;cstdlib&gt; #include &lt;iostream&gt; #include &lt;vector&gt; using namespace std; int main(int argc, char *argv) { const...

Не компилируется проект
Посмотрите пожалуста, я наверное неумею его доделать. Обьясните пожалуста, что ему еще надо. Проекту. Как его все же построить.

Не компилируется проект
В чем проблема?Помогите пожалуйста.Пишет ошибку.Пишу потоки.Вот код потока.type MyThread = class(TThread) private //?????????...

Не компилируется проект
Проект не компилируется с ошибками &quot;файл не найден&quot;. Возможно проблема с компилятором или комплектами.

Не компилируется проект
Вот сам проект (я в этом деле новенький поэтому запхал полностью все файлы) Выдает ошибку что не знает объект SecondForm. Компилер builder...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
4
Ответ Создать тему
Новые блоги и статьи
http://iceja.net/ математические сервисы
iceja 20.01.2026
Обновила свой сайт http:/ / iceja. net/ , приделала Fast Fourier Transform экстраполяцию сигналов. Однако предсказывает далеко не каждый сигнал (см ограничения http:/ / iceja. net/ fourier/ docs ). Также. . .
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма). На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
Расчёт переходных процессов в цепи постоянного тока
igorrr37 16.01.2026
/ * Дана цепь постоянного тока с R, L, C, k(ключ), U, E, J. Программа составляет систему уравнений по 1 и 2 законам Кирхгофа, решает её и находит переходные токи и напряжения на элементах схемы. . . .
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым. Но восстановить их можно так. Для этого понадобится консольная утилита. . .
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
WordPad для Windows 11
Jel 10.01.2026
WordPad для Windows 11 — это приложение, которое восстанавливает классический текстовый редактор WordPad в операционной системе Windows 11. После того как Microsoft исключила WordPad из. . .
Classic Notepad for Windows 11
Jel 10.01.2026
Old Classic Notepad for Windows 11 Приложение для Windows 11, позволяющее пользователям вернуть классическую версию текстового редактора «Блокнот» из Windows 10. Программа предоставляет более. . .
Почему дизайн решает?
Neotwalker 09.01.2026
В современном мире, где конкуренция за внимание потребителя достигла пика, дизайн становится мощным инструментом для успеха бренда. Это не просто красивый внешний вид продукта или сайта — это. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru