0 / 0 / 0
Регистрация: 03.02.2015
Сообщений: 2

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

29.04.2015, 12:40. Показов 1293. Ответов 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
Ответ Создать тему
Опции темы

Новые блоги и статьи
Символьное дифференцирование
igorrr37 13.02.2026
/ * Логарифм записывается как: (x-2)log(x^2+2) - означает логарифм (x^2+2) по основанию (x-2). Унарный минус обозначается как ! в-строка - входное арифметическое выражение в инфиксной(обычной). . .
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу, и светлой Луне. В мире покоя нет и люди не могут жить в тишине. А жить им немного лет.
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила» «Время-Деньги» «Деньги -Пуля»
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL3_image
8Observer8 10.02.2026
Содержание блога Библиотека SDL3_image содержит инструменты для расширенной работы с изображениями. Пошагово создадим проект для загрузки изображения формата PNG с альфа-каналом (с прозрачным. . .
Установка Qt-версии Lazarus IDE в Debian Trixie Xfce
volvo 10.02.2026
В общем, достали меня глюки IDE Лазаруса, собранной с использованием набора виджетов Gtk2 (конкретно: если набирать текст в редакторе и вызвать подсказку через Ctrl+Space, то после закрытия окошка. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru