Форум программистов, компьютерный форум, киберфорум
C++ Builder
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.52/25: Рейтинг темы: голосов - 25, средняя оценка - 4.52
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
1

Обработка событий для кнопок в RAD Studio 10.3

04.09.2019, 04:59. Показов 4561. Ответов 12

Author24 — интернет-сервис помощи студентам
Доброе утро! Я учусь программировать на RAD Studio 10.3 и GLScene 1.8. Я добавил в проект две камеры, куб, кольцо, два источника освещения и область для отображения всего этого "добра" и задал нужные координаты. Устанавливал GLScene по инструкциям из этого видео:
https://www.youtube.com/watch?v=Ta8uCIgOL24
Идея следующая: есть две кнопки и в зависимости от щелчка надо выбрать, какая фигура будет видна в области отображения. Но проект не запустился и выдал ошибки. Как писать названия камер для свойства Camera объекта GLSceneViewer1 в обработчиках событий - с кавычками или без них? Какую папку и в какой графе я забыл прописать в параметрах среды? Какую "галочку" я не поставил при установки RAD Studio? Можно ли решить проблемы без переустановки RAD Studio и GLScene? Сразу скажу, что RAD Studio и винда "крякнутые".

Unit1.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
#include <vcl.h>
#pragma hdrstop
 
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "GLBaseClasses"
#pragma link "GLCoordinates"
#pragma link "GLCrossPlatform"
#pragma link "GLGeomObjects"
#pragma link "GLObjects"
#pragma link "GLScene"
#pragma link "GLWin32Viewer"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
 
void __fastcall TForm1::Camera1Click(TObject *Sender)
{
GLSceneViewer1->Camera=GLCamera1;
}
 
//---------------------------------------------------------------------------
void __fastcall TForm1::Camera2Click(TObject *Sender)
{
GLSceneViewer1->Camera=GLCamera2;
}
Unit1.h
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
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "GLBaseClasses.hpp"
#include "GLCoordinates.hpp"
#include "GLCrossPlatform.hpp"
#include "GLGeomObjects.hpp"
#include "GLObjects.hpp"
#include "GLScene.hpp"
#include "GLWin32Viewer.hpp"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TGLScene *GLScene1;
    TGLSceneViewer *GLSceneViewer1;
    TGLCube *GLCube1;
    TGLCamera *GLCamera1;
    TGLLightSource *GLLightSource1;
    TGLTorus *GLTorus1;
    TGLCamera *GLCamera2;
    TGLLightSource *GLLightSource2;
    TButton *Camera1;
    TButton *Camera2;
    void __fastcall Camera2Click(TObject *Sender);
    void __fastcall Camera1Click(TObject *Sender);
private:    // User declarations
public:     // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Ошибки:
Checking project dependencies...
Compiling Project2.cbproj (Debug, Win32)
bcc32c command line for "Project2PCH1.h"
c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I
"C:\Users\Владимир\Documents\Embarcadero\Studio\Projects" -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions
-nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-pch -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions
-fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -x c++ -std=c++17 -O0 -fmath-errno -tR -tM
-tU -tW -o .\Win32\Debug\Project2PCH1.pch --auto-dependency-output Project2PCH1.h
bcc32c command line for "Project2.cpp"
c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I
"C:\Users\Владимир\Documents\Embarcadero\Studio\Projects" -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions
-nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions
-fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Project2.cpp -x c++
-std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Project2.obj --auto-dependency-output -MT .\Win32\Debug\Project2.obj -include-pch
.\Win32\Debug\Project2PCH1.pch Project2.cpp
bcc32c command line for "Unit1.cpp"
c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I
"C:\Users\Владимир\Documents\Embarcadero\Studio\Projects" -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions
-nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions
-fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Unit1.cpp -x c++ -std=c++17
-O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Unit1.obj --auto-dependency-output -MT .\Win32\Debug\Unit1.obj -include-pch
.\Win32\Debug\Project2PCH1.pch Unit1.cpp
[bcc32c Error] OpenGLAdapter.hpp(1455): functions that differ only in their return type cannot be overloaded
wingdi.h(6209): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1460): conflicting types for 'wglDescribeLayerPlane'
wingdi.h(6322): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1463): conflicting types for 'wglGetLayerPaletteEntries'
wingdi.h(6326): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1466): conflicting types for 'wglSetLayerPaletteEntries'
wingdi.h(6324): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1469): functions that differ only in their return type cannot be overloaded
wingdi.h(6341): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1470): conflicting types for 'wglUseFontBitmapsA'
wingdi.h(6212): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1471): conflicting types for 'wglUseFontOutlinesA'
wingdi.h(6236): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1472): conflicting types for 'wglUseFontBitmapsW'
wingdi.h(6213): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1473): conflicting types for 'wglUseFontOutlinesW'
wingdi.h(6238): previous declaration is here
Failed
Elapsed time: 00:00:14.3
Миниатюры
Обработка событий для кнопок в RAD Studio 10.3   Обработка событий для кнопок в RAD Studio 10.3  
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
04.09.2019, 04:59
Ответы с готовыми решениями:

Обработка событий для массива кнопок
Здравствуйте. У меня в программе создается массив из N ImageButton. и для каждой кнопки нужно...

Программное создание кнопок и обработка событий для каждой из созданных
Здравствуйте! Понадобилось создать несколько кнопок в зависимости от количества строк в результате...

Можно ли добавить новые стили для кнопок VCL формы или создать свои в RAD Studio 10.1 Berlin?
Распишу по подробнее нужно изменить стиль компонента Button1. У него есть свойство Style в нем есть...

Стиль кнопок Windows 98 RAD Studio XE4
Здравствуйте!! Ребята, подскажите, по такому вопросу. Собирался выпускать проект и для того...

12
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
04.09.2019, 05:48  [ТС] 2
Кавычки в названиях тоже не помогли:

C++
1
2
3
4
5
6
7
8
9
10
void __fastcall TForm1::Camera1Click(TObject *Sender)
{
GLSceneViewer1->Camera="GLCamera1";
}
 
//---------------------------------------------------------------------------
void __fastcall TForm1::Camera2Click(TObject *Sender)
{
GLSceneViewer1->Camera="GLCamera2";
}
Checking project dependencies...
Compiling Project2.cbproj (Debug, Win32)
bcc32c command line for "Unit1.cpp"
c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I
"C:\Users\Владимир\Documents\Embarcadero\Studio\Projects" -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions
-nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions
-fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Unit1.cpp -x c++ -std=c++17
-O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Unit1.obj --auto-dependency-output -MT .\Win32\Debug\Unit1.obj -include-pch
.\Win32\Debug\Project2PCH1.pch Unit1.cpp
[bcc32c Error] OpenGLAdapter.hpp(1455): functions that differ only in their return type cannot be overloaded
wingdi.h(6209): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1460): conflicting types for 'wglDescribeLayerPlane'
wingdi.h(6322): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1463): conflicting types for 'wglGetLayerPaletteEntries'
wingdi.h(6326): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1466): conflicting types for 'wglSetLayerPaletteEntries'
wingdi.h(6324): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1469): functions that differ only in their return type cannot be overloaded
wingdi.h(6341): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1470): conflicting types for 'wglUseFontBitmapsA'
wingdi.h(6212): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1471): conflicting types for 'wglUseFontOutlinesA'
wingdi.h(6236): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1472): conflicting types for 'wglUseFontBitmapsW'
wingdi.h(6213): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1473): conflicting types for 'wglUseFontOutlinesW'
wingdi.h(6238): previous declaration is here
[bcc32c Error] Unit1.cpp(26): cannot initialize a parameter of type 'Glscene::TGLCamera *' with an lvalue of type 'const char [10]'
GLWin32Viewer.hpp(75): passing argument to parameter 'val' here
[bcc32c Error] Unit1.cpp(32): cannot initialize a parameter of type 'Glscene::TGLCamera *' with an lvalue of type 'const char [10]'
GLWin32Viewer.hpp(75): passing argument to parameter 'val' here
Failed
Elapsed time: 00:00:03.2

Неужели я GLScene криво поставил?

Добавлено через 19 минут
Кнопки и обработчики событий я убрал, но даже здесь без ошибок не обошлось. Как исправить без переустановки среды и библиотеки, не знаю.

Checking project dependencies...
Compiling Project2.cbproj (Debug, Win32)
bcc32c command line for "Unit1.cpp"
c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I
"C:\Users\Владимир\Documents\Embarcadero\Studio\Projects" -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions
-nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions
-fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Unit1.cpp -x c++ -std=c++17
-O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Unit1.obj --auto-dependency-output -MT .\Win32\Debug\Unit1.obj -include-pch
.\Win32\Debug\Project2PCH1.pch Unit1.cpp
[bcc32c Error] OpenGLAdapter.hpp(1455): functions that differ only in their return type cannot be overloaded
wingdi.h(6209): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1460): conflicting types for 'wglDescribeLayerPlane'
wingdi.h(6322): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1463): conflicting types for 'wglGetLayerPaletteEntries'
wingdi.h(6326): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1466): conflicting types for 'wglSetLayerPaletteEntries'
wingdi.h(6324): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1469): functions that differ only in their return type cannot be overloaded
wingdi.h(6341): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1470): conflicting types for 'wglUseFontBitmapsA'
wingdi.h(6212): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1471): conflicting types for 'wglUseFontOutlinesA'
wingdi.h(6236): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1472): conflicting types for 'wglUseFontBitmapsW'
wingdi.h(6213): previous declaration is here
[bcc32c Error] OpenGLAdapter.hpp(1473): conflicting types for 'wglUseFontOutlinesW'
wingdi.h(6238): previous declaration is here
Failed
Elapsed time: 00:00:03.1
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
04.09.2019, 12:10  [ТС] 3
Короче, у меня нет header-файлов. Я нашёл ссылку:
https://sourceforge.net/p/glscene/code/HEAD/tree/
и там три папки: branches, tags и trunk. В какой из этих папок что качать и в какую папку на домашнем компьютере копировать?
0
1702 / 898 / 207
Регистрация: 25.11.2009
Сообщений: 1,847
04.09.2019, 13:52 4
БузинВладимир, в репозитории все исходники должны лежать в trunk
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
04.09.2019, 15:42  [ТС] 5
trunk - это копия содержимого моего архива, остальное - дремучий лес. Там напрямую не указана папка Header Files. Если бы лежало там, лежало бы и в моём архиве. Я вообще не знаю, как эти хедеры называются по отдельности, какой куда пихать и чего хотят от меня компилятор и инструкция. Вот мануала и сайт, где я качал эту библиотеку:
https://sourceforge.net/projects/glscene/
Вложения
Тип файла: pdf InstallationGLS.pdf (771.2 Кб, 9 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
05.09.2019, 14:33  [ТС] 6
По-моему, понял, в чём дело. Скорее всего, проект нужно положить в папку ...\GLScene\Samples\CPP\Demos или, наоборот, кинуть библиотеки .dll в папку с проектом. Но их имена я не знаю.

Добавлено через 10 минут
Те же самые ошибки, хотя демка с квадратом, берущим позицию последнего щелчка мыши, сработала.

SQL
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
Checking project dependencies...
Compiling Project2.cbproj (Debug, Win32)
bcc32c command line FOR "Project2PCH1.h"
  c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I 
  D:\GLScene\Samples\CPP\Demos\graph\lab1 -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -I "D:омпьютерное 
  моделирование\lab1" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files 
  (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem 
  "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" 
  -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 
  -isystem D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone 
  -fborland-extensions -nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-pch -mrelocation-model static -masm-verbose -ffunction-sections 
  -fexceptions -fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -x c++ -std=c++17 -O0 
  -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Project2PCH1.pch --auto-dependency-output Project2PCH1.h 
bcc32c command line FOR "Unit1.cpp"
  c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I 
  D:\GLScene\Samples\CPP\Demos\graph\lab1 -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -I "D:омпьютерное 
  моделирование\lab1" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files 
  (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem 
  "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" 
  -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 
  -isystem D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone 
  -fborland-extensions -nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections 
  -fexceptions -fcxx-exceptions -fseh -mdisable-fp-elim -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Unit1.cpp -x 
  c++ -std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Unit1.obj --auto-dependency-output -MT .\Win32\Debug\Unit1.obj -include-pch 
  .\Win32\Debug\Project2PCH1.pch Unit1.cpp 
[bcc32c Error] OpenGLAdapter.hpp(1455): functions that differ ONLY IN their RETURN TYPE cannot be overloaded
  wingdi.h(6209): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1460): conflicting types FOR 'wglDescribeLayerPlane'
  wingdi.h(6322): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1463): conflicting types FOR 'wglGetLayerPaletteEntries'
  wingdi.h(6326): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1466): conflicting types FOR 'wglSetLayerPaletteEntries'
  wingdi.h(6324): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1469): functions that differ ONLY IN their RETURN TYPE cannot be overloaded
  wingdi.h(6341): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1470): conflicting types FOR 'wglUseFontBitmapsA'
  wingdi.h(6212): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1471): conflicting types FOR 'wglUseFontOutlinesA'
  wingdi.h(6236): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1472): conflicting types FOR 'wglUseFontBitmapsW'
  wingdi.h(6213): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1473): conflicting types FOR 'wglUseFontOutlinesW'
  wingdi.h(6238): previous declaration IS here
Failed
Elapsed TIME: 00:00:14.6
Добавлено через 6 минут
Демка с игровым меню тоже сработала.

Добавлено через 16 минут
Переписал шапку из демки с игровым меню - тоже не помогло.
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
05.09.2019, 14:48  [ТС] 7
Вот мой проект! Может посмотрите, что случилось?
Вложения
Тип файла: zip lab1.zip (17.63 Мб, 0 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
05.09.2019, 14:55  [ТС] 8
А вот тот, что с отредактированной "шапкой":
Unit1.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
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "GLBaseClasses"
#pragma link "GLCoordinates"
#pragma link "GLCrossPlatform"
#pragma link "GLGeomObjects"
#pragma link "GLObjects"
#pragma link "GLScene"
#pragma link "GLWin32Viewer"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
Unit1.h
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
//---------------------------------------------------------------------------
 
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Windows.hpp>
#include <Messages.hpp>
#include <SysUtils.hpp>
#include <Graphics.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <System.Classes.hpp>
#include <Dialogs.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Imaging.jpeg.hpp>
 
#include "GLScene.hpp"
#include "GLObjects.hpp"
#include "GLWin32Viewer.hpp"
#include "GLGeomObjects.hpp"
#include "GLBitmapFont.hpp"
#include "GLWindowsFont.hpp"
#include "GLGameMenu.hpp"
#include "GLCadencer.hpp"
#include "GLTexture.hpp"
#include "GLKeyboard.hpp"
#include "GLCrossPlatform.hpp"
#include "GLMaterial.hpp"
#include "GLCoordinates.hpp"
#include "GLBaseClasses.hpp"
#include "GLUtils.hpp"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TGLScene *GLScene1;
    TGLSceneViewer *GLSceneViewer1;
    TGLCube *GLCube1;
    TGLCamera *GLCamera1;
    TGLLightSource *GLLightSource1;
    TGLTorus *GLTorus1;
    TGLCamera *GLCamera2;
    TGLLightSource *GLLightSource2;
    void __fastcall Camera2Click(TObject *Sender);
    void __fastcall Camera1Click(TObject *Sender);
private:    // User declarations
public:     // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Вложения
Тип файла: zip lab1.zip (17.64 Мб, 0 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
05.09.2019, 17:32  [ТС] 9
Кажется, я понял в чём проблема. Я запускал демки из архива, скачанного из официального сата. Они работают. А потом, предварительно поместив проект в папку с демками, создал его с нуля по инструкции из лабы и запустил только куб без кольца и второй камеры. Получается, моя среда разработки или библиотека не поддерживает этот куб. Сможете кинуть ссылку с патчами фигур базовой и расширенной геометрии для glscene 1.8 и rad studio 10.3?
И ещё, я не понял, где находятся четыре спорных файла .bpk, описанных в первом пункте инструкции к моей лабе, - в самом архиве или на просторах интернета? Поиск по проводнику ничего не дал - писал "*.bpk", и проводник меня вывел в Интернет. Если они в папке с распакованным архивом, дайте пути к нужным мне BPK и DLL.

Unit.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "Lab1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "GLBaseClasses"
#pragma link "GLCoordinates"
#pragma link "GLCrossPlatform"
#pragma link "GLObjects"
#pragma link "GLScene"
#pragma link "GLWin32Viewer"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
Unit.h
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
//---------------------------------------------------------------------------
 
#ifndef Lab1H
#define Lab1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "GLBaseClasses.hpp"
#include "GLCoordinates.hpp"
#include "GLCrossPlatform.hpp"
#include "GLObjects.hpp"
#include "GLScene.hpp"
#include "GLWin32Viewer.hpp"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TGLScene *GLScene1;
    TGLSceneViewer *GLSceneViewer1;
    TGLCube *GLCube1;
    TGLCamera *GLCamera1;
    TGLLightSource *GLLightSource1;
private:    // User declarations
public:     // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Миниатюры
Обработка событий для кнопок в RAD Studio 10.3   Обработка событий для кнопок в RAD Studio 10.3   Обработка событий для кнопок в RAD Studio 10.3  

Обработка событий для кнопок в RAD Studio 10.3   Обработка событий для кнопок в RAD Studio 10.3  
Вложения
Тип файла: zip TextLab1.zip (170.5 Кб, 0 просмотров)
Тип файла: zip lab1.zip (17.63 Мб, 0 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
05.09.2019, 17:38  [ТС] 10
Вот весь список моих ошибок:
SQL
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
Checking project dependencies...
Compiling Project1.cbproj (Debug, Win32)
bcc32c command line FOR "Project1PCH1.h"
  c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I 
  D:\GLScene\Samples\CPP\Demos\interface\GameMenu\lab1 -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem "c:\program 
  files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem "c:\program 
  files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk" -isystem 
  "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" 
  -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem D:\GLScene\include\win32 -isystem 
  C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions -nobuiltininc -nostdsysteminc -triple 
  i686-pc-windows-omf -emit-pch -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions -fcxx-exceptions -fseh -mdisable-fp-elim 
  -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -x c++ -std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Project1PCH1.pch 
  --auto-dependency-output Project1PCH1.h 
bcc32c command line FOR "Lab1.cpp"
  c:\program files (x86)\embarcadero\studio\20.0\bin\bcc32c.exe -cc1 -D _DEBUG -D USEPACKAGES -output-dir .\Win32\Debug -I 
  D:\GLScene\Samples\CPP\Demos\interface\GameMenu\lab1 -I "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" -isystem "c:\program 
  files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\dinkumware64" -isystem "c:\program 
  files (x86)\embarcadero\studio\20.0\include\windows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\sdk" -isystem 
  "c:\program files (x86)\embarcadero\studio\20.0\include\windows\rtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\windows\vcl" 
  -isystem C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -isystem D:\GLScene\include\win32 -isystem 
  C:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -debug-info-kind=standalone -fborland-extensions -nobuiltininc -nostdsysteminc -triple 
  i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions -fcxx-exceptions -fseh -mdisable-fp-elim 
  -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Lab1.cpp -x c++ -std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o 
  .\Win32\Debug\Lab1.obj --auto-dependency-output -MT .\Win32\Debug\Lab1.obj -include-pch .\Win32\Debug\Project1PCH1.pch Lab1.cpp 
[bcc32c Error] OpenGLAdapter.hpp(1455): functions that differ ONLY IN their RETURN TYPE cannot be overloaded
  wingdi.h(6209): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1460): conflicting types FOR 'wglDescribeLayerPlane'
  wingdi.h(6322): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1463): conflicting types FOR 'wglGetLayerPaletteEntries'
  wingdi.h(6326): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1466): conflicting types FOR 'wglSetLayerPaletteEntries'
  wingdi.h(6324): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1469): functions that differ ONLY IN their RETURN TYPE cannot be overloaded
  wingdi.h(6341): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1470): conflicting types FOR 'wglUseFontBitmapsA'
  wingdi.h(6212): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1471): conflicting types FOR 'wglUseFontOutlinesA'
  wingdi.h(6236): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1472): conflicting types FOR 'wglUseFontBitmapsW'
  wingdi.h(6213): previous declaration IS here
[bcc32c Error] OpenGLAdapter.hpp(1473): conflicting types FOR 'wglUseFontOutlinesW'
  wingdi.h(6238): previous declaration IS here
Failed
Elapsed TIME: 00:00:13.7
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
05.09.2019, 17:41  [ТС] 11
Вот архив, вдруг в предыдущем пустой проект.
Вложения
Тип файла: zip lab1.zip (17.63 Мб, 5 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
06.09.2019, 06:41  [ТС] 12
Ура! На "дельфях" всё запустилось! Но как разыменовывать указатели для обработчиков событий - через точку или через стрелочку?
C++
1
2
3
GLSceneViewer1->Camera="GLCamera1";
Button1->Visiable=false;
Button2->Visiable=true;
Как переписать эти три команды для обработчика событий из C++ на Delphi?
Миниатюры
Обработка событий для кнопок в RAD Studio 10.3  
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
27.09.2019, 05:41  [ТС] 13
Препод на днях сказал, откуда эта ошибка с кубом. В настройках проекта в C++ Builder во вкладке Compiler надо поставить галочку "Использовать классический компилятор".
0
27.09.2019, 05:41
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
27.09.2019, 05:41
Помогаю со студенческими работами здесь

Обработка событий нажатия кнопок
задан блок &lt;div class=&quot;Block&quot;&gt; &lt;/div&gt; Как мне обработать событие по клику на него мышкой?...

Обработка событий кнопок Button
Доброго времени суток!!! Во время создания формы создаются 10 кнопок таки образом: for(int i =...

Модуль для Rad Studio типа VAssist для Visual Studio
Здравствуйте. Подскажите, какую программку установить для подсветки синтаксиса и всплывающих...

Обработка событий (events) в Visual Studio
У меня есть два события, они выполняют одинаковые действия, можно ли как то сделать вызов одного...


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

Или воспользуйтесь поиском по форуму:
13
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru