0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
|||||||||||
1 | |||||||||||
Обработка событий для кнопок в RAD Studio 10.304.09.2019, 04:59. Показов 4561. Ответов 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
0
|
04.09.2019, 04:59 | |
Ответы с готовыми решениями:
12
Обработка событий для массива кнопок Программное создание кнопок и обработка событий для каждой из созданных Можно ли добавить новые стили для кнопок VCL формы или создать свои в RAD Studio 10.1 Berlin? Стиль кнопок Windows 98 RAD Studio XE4 |
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
||||||
04.09.2019, 05:48 [ТС] | 2 | |||||
Кавычки в названиях тоже не помогли:
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/
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
||||||
05.09.2019, 14:33 [ТС] | 6 | |||||
По-моему, понял, в чём дело. Скорее всего, проект нужно положить в папку ...\GLScene\Samples\CPP\Demos или, наоборот, кинуть библиотеки .dll в папку с проектом. Но их имена я не знаю.
Добавлено через 10 минут Те же самые ошибки, хотя демка с квадратом, берущим позицию последнего щелчка мыши, сработала.
Демка с игровым меню тоже сработала. Добавлено через 16 минут Переписал шапку из демки с игровым меню - тоже не помогло.
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
|
05.09.2019, 14:48 [ТС] | 7 |
Вот мой проект! Может посмотрите, что случилось?
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
|||||||||||
05.09.2019, 14:55 [ТС] | 8 | ||||||||||
А вот тот, что с отредактированной "шапкой":
Unit1.cpp
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
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
||||||
05.09.2019, 17:38 [ТС] | 10 | |||||
Вот весь список моих ошибок:
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
|
05.09.2019, 17:41 [ТС] | 11 |
Вот архив, вдруг в предыдущем пустой проект.
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
||||||
06.09.2019, 06:41 [ТС] | 12 | |||||
Ура! На "дельфях" всё запустилось! Но как разыменовывать указатели для обработчиков событий - через точку или через стрелочку?
0
|
0 / 0 / 4
Регистрация: 21.08.2017
Сообщений: 205
|
|
27.09.2019, 05:41 [ТС] | 13 |
Препод на днях сказал, откуда эта ошибка с кубом. В настройках проекта в C++ Builder во вкладке Compiler надо поставить галочку "Использовать классический компилятор".
0
|
27.09.2019, 05:41 | |
27.09.2019, 05:41 | |
Помогаю со студенческими работами здесь
13
Обработка событий нажатия кнопок Обработка событий кнопок Button Модуль для Rad Studio типа VAssist для Visual Studio Обработка событий (events) в Visual Studio Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |