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

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

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

Студворк — интернет-сервис помощи студентам
Доброе утро! Я учусь программировать на 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\wi ndows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\di nkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\wi ndows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\St udio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\St udio\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\wi ndows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\di nkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\wi ndows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\St udio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\St udio\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\wi ndows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\di nkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\wi ndows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\St udio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\St udio\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
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
04.09.2019, 04:59
Ответы с готовыми решениями:

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

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

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

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

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\wi ndows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\di nkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\wi ndows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\St udio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\St udio\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\wi ndows\vcl" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\di nkumware64" -isystem
"c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\crtl" -isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\sdk"
-isystem "c:\program files (x86)\embarcadero\studio\20.0\include\wi ndows\rtl" -isystem "c:\program files
(x86)\embarcadero\studio\20.0\include\wi ndows\vcl" -isystem C:\Users\Public\Documents\Embarcadero\St udio\20.0\hpp\Win32 -isystem
D:\GLScene\include\win32 -isystem C:\Users\Public\Documents\Embarcadero\St udio\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
Сообщений: 208
04.09.2019, 12:10  [ТС]
Короче, у меня нет header-файлов. Я нашёл ссылку:
https://sourceforge.net/p/glscene/code/HEAD/tree/
и там три папки: branches, tags и trunk. В какой из этих папок что качать и в какую папку на домашнем компьютере копировать?
0
 Аватар для Lelik-pahan
1703 / 899 / 207
Регистрация: 25.11.2009
Сообщений: 1,848
04.09.2019, 13:52
БузинВладимир, в репозитории все исходники должны лежать в trunk
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 208
04.09.2019, 15:42  [ТС]
trunk - это копия содержимого моего архива, остальное - дремучий лес. Там напрямую не указана папка Header Files. Если бы лежало там, лежало бы и в моём архиве. Я вообще не знаю, как эти хедеры называются по отдельности, какой куда пихать и чего хотят от меня компилятор и инструкция. Вот мануала и сайт, где я качал эту библиотеку:
https://sourceforge.net/projects/glscene/
Вложения
Тип файла: pdf InstallationGLS.pdf (771.2 Кб, 9 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 208
05.09.2019, 14:33  [ТС]
По-моему, понял, в чём дело. Скорее всего, проект нужно положить в папку ...\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
Сообщений: 208
05.09.2019, 14:48  [ТС]
Вот мой проект! Может посмотрите, что случилось?
Вложения
Тип файла: zip lab1.zip (17.63 Мб, 4 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 208
05.09.2019, 14:55  [ТС]
А вот тот, что с отредактированной "шапкой":
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 Мб, 4 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 208
05.09.2019, 17:32  [ТС]
Кажется, я понял в чём проблема. Я запускал демки из архива, скачанного из официального сата. Они работают. А потом, предварительно поместив проект в папку с демками, создал его с нуля по инструкции из лабы и запустил только куб без кольца и второй камеры. Получается, моя среда разработки или библиотека не поддерживает этот куб. Сможете кинуть ссылку с патчами фигур базовой и расширенной геометрии для 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 Кб, 4 просмотров)
Тип файла: zip lab1.zip (17.63 Мб, 4 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 208
05.09.2019, 17:38  [ТС]
Вот весь список моих ошибок:
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
Сообщений: 208
05.09.2019, 17:41  [ТС]
Вот архив, вдруг в предыдущем пустой проект.
Вложения
Тип файла: zip lab1.zip (17.63 Мб, 9 просмотров)
0
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 208
06.09.2019, 06:41  [ТС]
Ура! На "дельфях" всё запустилось! Но как разыменовывать указатели для обработчиков событий - через точку или через стрелочку?
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
Сообщений: 208
27.09.2019, 05:41  [ТС]
Препод на днях сказал, откуда эта ошибка с кубом. В настройках проекта в C++ Builder во вкладке Compiler надо поставить галочку "Использовать классический компилятор".
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
27.09.2019, 05:41
Помогаю со студенческими работами здесь

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

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

Обработка событий кнопок Button
Доброго времени суток!!! Во время создания формы создаются 10 кнопок таки образом: for(int i = 1; i &lt;= 11; i++) { TButton *a...

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

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


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

Или воспользуйтесь поиском по форуму:
13
Ответ Создать тему
Новые блоги и статьи
PhpStorm 2025.3: WSL Terminal всегда стартует в ~
and_y87 14.12.2025
PhpStorm 2025. 3: WSL Terminal всегда стартует в ~ (home), игнорируя директорию проекта Симптом: После обновления до PhpStorm 2025. 3 встроенный терминал WSL открывается в домашней директории. . .
Access
VikBal 11.12.2025
Помогите пожалуйста !! Как объединить 2 одинаковые БД Access с разными данными.
Новый ноутбук
volvo 07.12.2025
Всем привет. По скидке в "черную пятницу" взял себе новый ноутбук Lenovo ThinkBook 16 G7 на Амазоне: Ryzen 5 7533HS 64 Gb DDR5 1Tb NVMe 16" Full HD Display Win11 Pro
Музыка, написанная Искусственным Интеллектом
volvo 04.12.2025
Всем привет. Некоторое время назад меня заинтересовало, что уже умеет ИИ в плане написания музыки для песен, и, собственно, исполнения этих самых песен. Стихов у нас много, уже вышли 4 книги, еще 3. . .
От async/await к виртуальным потокам в Python
IndentationError 23.11.2025
Армин Ронахер поставил под сомнение async/ await. Создатель Flask заявляет: цветные функции - провал, виртуальные потоки - решение. Не threading-динозавры, а новое поколение лёгких потоков. Откат?. . .
Поиск "дружественных имён" СОМ портов
Argus19 22.11.2025
Поиск "дружественных имён" СОМ портов На странице: https:/ / norseev. ru/ 2018/ 01/ 04/ comportlist_windows/ нашёл схожую тему. Там приведён код на С++, который показывает только имена СОМ портов, типа,. . .
Сколько Государство потратило денег на меня, обеспечивая инсулином.
Programma_Boinc 20.11.2025
Сколько Государство потратило денег на меня, обеспечивая инсулином. Вот решила сделать интересный приблизительный подсчет, сколько государство потратило на меня денег на покупку инсулинов. . . .
Ломающие изменения в C#.NStar Alpha
Etyuhibosecyu 20.11.2025
Уже можно не только тестировать, но и пользоваться C#. NStar - писать оконные приложения, содержащие надписи, кнопки, текстовые поля и даже изображения, например, моя игра "Три в ряд" написана на этом. . .
Мысли в слух
kumehtar 18.11.2025
Кстати, совсем недавно имел разговор на тему медитаций с людьми. И обнаружил, что они вообще не понимают что такое медитация и зачем она нужна. Самые базовые вещи. Для них это - когда просто люди. . .
Создание Single Page Application на фреймах
krapotkin 16.11.2025
Статья исключительно для начинающих. Подходы оригинальностью не блещут. В век Веб все очень привыкли к дизайну Single-Page-Application . Быстренько разберем подход "на фреймах". Мы делаем одну. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2025, CyberForum.ru