Форум программистов, компьютерный форум, киберфорум
С++ для начинающих
Войти
Регистрация
Восстановить пароль
 
Рейтинг 4.75/16: Рейтинг темы: голосов - 16, средняя оценка - 4.75
0 / 0 / 0
Регистрация: 18.12.2018
Сообщений: 35
1

Ошибка компиляции flare 1.11

09.04.2020, 01:00. Показов 3136. Ответов 5

Ну в общем решил я попробовать откомпилировать flare game engine
Исходники скачал здесь https://flarerpg.org/index.php/download/

Ссылка по которой скачивались исходники
https://sourceforge.net/projec... z/download

Код распаковал в С:\flare

Зашел в папку с исходниками (команда MSYS2 cd /C/flare)

Компиляцию запустил командой
$ cmake -G "Unix Makefiles" -S . -B . -DCMAKE_INSTALL_PREFIX=G:\msys64\mingw64\x86_64-w64-mingw32

После чего MSYS2 выдал сообщение что библиотека SDL2 не установлена

Пришлось искать и устанавливать в msys2 библиотеку SDL2
Поиск SDL2 искал командой pacman -Ss SDL2 (запуск msys2 через msys2_shell.cmd) после чего msys2 выдал список доступных пакетов:

$ pacman -Ss SDL2
mingw32/mingw-w64-i686-SDL2 2.0.12-1
A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2) (mingw-w64)
mingw32/mingw-w64-i686-SDL2_gfx 1.0.4-1
SDL graphics drawing primitives and other support functions (Version 2) (mingw-w64)
mingw32/mingw-w64-i686-SDL2_image 2.0.5-1
A simple library to load images of various formats as SDL surfaces (Version 2) (mingw-w64)
mingw32/mingw-w64-i686-SDL2_mixer 2.0.4-2
A simple multi-channel audio mixer (Version 2) (mingw-w64)
mingw32/mingw-w64-i686-SDL2_net 2.0.1-1
A small sample cross-platform networking library (Version 2) (mingw-w64)
mingw32/mingw-w64-i686-SDL2_ttf 2.0.15-1
A library that allows you to use TrueType fonts in your SDL applications (Version 2) (mingw-w64)
mingw32/mingw-w64-i686-smpeg2 2.0.0-5
SDL2 MPEG Player Library (mingw-w64)
mingw64/mingw-w64-x86_64-SDL2 2.0.12-1 [установлен]
A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2) (mingw-w64)
mingw64/mingw-w64-x86_64-SDL2_gfx 1.0.4-1
SDL graphics drawing primitives and other support functions (Version 2) (mingw-w64)
mingw64/mingw-w64-x86_64-SDL2_image 2.0.5-1
A simple library to load images of various formats as SDL surfaces (Version 2) (mingw-w64)
mingw64/mingw-w64-x86_64-SDL2_mixer 2.0.4-2
A simple multi-channel audio mixer (Version 2) (mingw-w64)
mingw64/mingw-w64-x86_64-SDL2_net 2.0.1-1
A small sample cross-platform networking library (Version 2) (mingw-w64)
mingw64/mingw-w64-x86_64-SDL2_ttf 2.0.15-1
A library that allows you to use TrueType fonts in your SDL applications (Version 2) (mingw-w64)
mingw64/mingw-w64-x86_64-smpeg2 2.0.0-5
SDL2 MPEG Player Library (mingw-w64)

Пакеты ставил командами:
mingw64/mingw-w64-x86_64-SDL2
mingw64/mingw-w64-x86_64-SDL2_gfx
mingw64/mingw-w64-x86_64-SDL2_image
mingw64/mingw-w64-x86_64-SDL2_mixer
mingw64/mingw-w64-x86_64-SDL2_net
mingw64/mingw-w64-x86_64-SDL2_ttf
mingw64/mingw-w64-x86_64-smpeg2

После установки пакетов обновил MSYS2 (команда обновления pacman -Syuu)

Затем закрыл MSYS2 и запустил компиляцию flare game engine заново:

Команда компиляции
$ cmake -G "Unix Makefiles" -S . -B . -DCMAKE_INSTALL_PREFIX=G:\msys64\mingw64\x86_64-w64-mingw32

После чего ошибка об отсутствии библиотеки SDL2 исчезла:

$ cmake -G "Unix Makefiles" -S . -B . -DCMAKE_INSTALL_PREFIX=G:\msys64\mingw64\x86_64-w64-mingw32
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: E:/mingw64/bin/cc.exe
-- Check for working C compiler: E:/mingw64/bin/cc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/mingw64/bin/c++.exe
-- Check for working CXX compiler: E:/mingw64/bin/c++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found SDL2: mingw32;E:/mingw64/lib/libSDL2main.a;E:/mingw64/lib/libSDL2.dll.a (found version "2.0.12")
-- Found SDL2_image: E:/mingw64/lib/libSDL2_image.dll.a (found version "2.0.5")
-- Found SDL2_mixer: E:/mingw64/lib/libSDL2_mixer.dll.a (found version "2.0.4")
-- Found SDL2_ttf: E:/mingw64/lib/libSDL2_ttf.dll.a (found version "2.0.15")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/flare

Тогда я решил запустить компиляцию flare game engine (команда компиляции mingw32-make)

после чего компилятор MSYS2+mingw64 выдал ошибку компиляции:
C:/flare/src/RenderDevice.cpp: In member function 'void RenderDevice::drawEllipse(int, int, int, int, const Color&, float)':
C:/flare/src/RenderDevice.cpp:381:46: error: 'M_PI' was not declared in this scope
381 | float rad = (step/180) * static_cast<float>(M_PI);
| ^~~~
mingw32-make[2]: *** [CMakeFiles/flare.dir/build.make:1103: CMakeFiles/flare.dir/src/RenderDevice.cpp.obj] Error 1
mingw32-make[2]: Leaving directory 'C:/flare'
mingw32-make[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/flare.dir/all] Error 2
mingw32-make[1]: Leaving directory 'C:/flare'
mingw32-make: *** [Makefile:147: all] Error 2

Вывод компилятора:
$ mingw32-make
mingw32-make[1]: Entering directory 'C:/flare'
mingw32-make[2]: Entering directory 'C:/flare'
Scanning dependencies of target flare
mingw32-make[2]: Leaving directory 'C:/flare'
mingw32-make[2]: Entering directory 'C:/flare'
[ 0%] Building CXX object CMakeFiles/flare.dir/src/BehaviorAlly.cpp.obj
[ 1%] Building CXX object CMakeFiles/flare.dir/src/Entity.cpp.obj
[ 2%] Building CXX object CMakeFiles/flare.dir/src/Animation.cpp.obj
[ 3%] Building CXX object CMakeFiles/flare.dir/src/AnimationManager.cpp.obj
[ 4%] Building CXX object CMakeFiles/flare.dir/src/AnimationSet.cpp.obj
[ 5%] Building CXX object CMakeFiles/flare.dir/src/AStarContainer.cpp.obj
[ 6%] Building CXX object CMakeFiles/flare.dir/src/AStarNode.cpp.obj
[ 7%] Building CXX object CMakeFiles/flare.dir/src/Avatar.cpp.obj
[ 8%] Building CXX object CMakeFiles/flare.dir/src/BehaviorStandard.cpp.obj
[ 8%] Building CXX object CMakeFiles/flare.dir/src/CampaignManager.cpp.obj
[ 9%] Building CXX object CMakeFiles/flare.dir/src/CombatText.cpp.obj
[ 10%] Building CXX object CMakeFiles/flare.dir/src/CursorManager.cpp.obj
[ 11%] Building CXX object CMakeFiles/flare.dir/src/DeviceList.cpp.obj
[ 12%] Building CXX object CMakeFiles/flare.dir/src/EffectManager.cpp.obj
[ 13%] Building CXX object CMakeFiles/flare.dir/src/Enemy.cpp.obj
[ 14%] Building CXX object CMakeFiles/flare.dir/src/EnemyBehavior.cpp.obj
[ 15%] Building CXX object CMakeFiles/flare.dir/src/EnemyGroupManager.cpp.obj
[ 16%] Building CXX object CMakeFiles/flare.dir/src/EnemyManager.cpp.obj
[ 16%] Building CXX object CMakeFiles/flare.dir/src/EngineSettings.cpp.obj
[ 17%] Building CXX object CMakeFiles/flare.dir/src/EventManager.cpp.obj
[ 18%] Building CXX object CMakeFiles/flare.dir/src/FileParser.cpp.obj
[ 19%] Building CXX object CMakeFiles/flare.dir/src/FontEngine.cpp.obj
[ 20%] Building CXX object CMakeFiles/flare.dir/src/GameSlotPreview.cpp.obj
[ 21%] Building CXX object CMakeFiles/flare.dir/src/GameState.cpp.obj
[ 22%] Building CXX object CMakeFiles/flare.dir/src/GameStateConfig.cpp.obj
[ 23%] Building CXX object CMakeFiles/flare.dir/src/GameStateCutscene.cpp.obj
[ 24%] Building CXX object CMakeFiles/flare.dir/src/GameStateTitle.cpp.obj
[ 25%] Building CXX object CMakeFiles/flare.dir/src/GameStateLoad.cpp.obj
[ 25%] Building CXX object CMakeFiles/flare.dir/src/GameStatePlay.cpp.obj
[ 26%] Building CXX object CMakeFiles/flare.dir/src/GameStateNew.cpp.obj
[ 27%] Building CXX object CMakeFiles/flare.dir/src/GameSwitcher.cpp.obj
[ 28%] Building CXX object CMakeFiles/flare.dir/src/GetText.cpp.obj
[ 29%] Building CXX object CMakeFiles/flare.dir/src/Hazard.cpp.obj
[ 30%] Building CXX object CMakeFiles/flare.dir/src/HazardManager.cpp.obj
[ 31%] Building CXX object CMakeFiles/flare.dir/src/IconManager.cpp.obj
[ 32%] Building CXX object CMakeFiles/flare.dir/src/InputState.cpp.obj
[ 33%] Building CXX object CMakeFiles/flare.dir/src/ItemManager.cpp.obj
[ 33%] Building CXX object CMakeFiles/flare.dir/src/ItemStorage.cpp.obj
[ 34%] Building CXX object CMakeFiles/flare.dir/src/Loot.cpp.obj
[ 35%] Building CXX object CMakeFiles/flare.dir/src/LootManager.cpp.obj
[ 36%] Building CXX object CMakeFiles/flare.dir/src/Map.cpp.obj
[ 37%] Building CXX object CMakeFiles/flare.dir/src/MapParallax.cpp.obj
[ 38%] Building CXX object CMakeFiles/flare.dir/src/MapCollision.cpp.obj
[ 39%] Building CXX object CMakeFiles/flare.dir/src/MapRenderer.cpp.obj
[ 40%] Building CXX object CMakeFiles/flare.dir/src/Menu.cpp.obj
[ 41%] Building CXX object CMakeFiles/flare.dir/src/MenuActionBar.cpp.obj
[ 41%] Building CXX object CMakeFiles/flare.dir/src/MenuActiveEffects.cpp.obj
[ 42%] Building CXX object CMakeFiles/flare.dir/src/MenuBook.cpp.obj
[ 43%] Building CXX object CMakeFiles/flare.dir/src/MenuCharacter.cpp.obj
[ 44%] Building CXX object CMakeFiles/flare.dir/src/MenuConfig.cpp.obj
[ 45%] Building CXX object CMakeFiles/flare.dir/src/MenuConfirm.cpp.obj
[ 46%] Building CXX object CMakeFiles/flare.dir/src/MenuDevConsole.cpp.obj
[ 47%] Building CXX object CMakeFiles/flare.dir/src/MenuEnemy.cpp.obj
[ 48%] Building CXX object CMakeFiles/flare.dir/src/MenuExit.cpp.obj
[ 49%] Building CXX object CMakeFiles/flare.dir/src/MenuHUDLog.cpp.obj
[ 50%] Building CXX object CMakeFiles/flare.dir/src/MenuInventory.cpp.obj
[ 50%] Building CXX object CMakeFiles/flare.dir/src/MenuItemStorage.cpp.obj
[ 51%] Building CXX object CMakeFiles/flare.dir/src/MenuLog.cpp.obj
[ 52%] Building CXX object CMakeFiles/flare.dir/src/MenuManager.cpp.obj
[ 53%] Building CXX object CMakeFiles/flare.dir/src/MenuMiniMap.cpp.obj
[ 54%] Building CXX object CMakeFiles/flare.dir/src/MenuNumPicker.cpp.obj
[ 55%] Building CXX object CMakeFiles/flare.dir/src/MenuPowers.cpp.obj
[ 56%] Building CXX object CMakeFiles/flare.dir/src/MenuStash.cpp.obj
[ 57%] Building CXX object CMakeFiles/flare.dir/src/MenuStatBar.cpp.obj
[ 58%] Building CXX object CMakeFiles/flare.dir/src/MenuTalker.cpp.obj
[ 58%] Building CXX object CMakeFiles/flare.dir/src/MenuTouchControls.cpp.obj
[ 59%] Building CXX object CMakeFiles/flare.dir/src/MenuVendor.cpp.obj
[ 60%] Building CXX object CMakeFiles/flare.dir/src/MessageEngine.cpp.obj
[ 61%] Building CXX object CMakeFiles/flare.dir/src/ModManager.cpp.obj
[ 62%] Building CXX object CMakeFiles/flare.dir/src/NPC.cpp.obj
[ 63%] Building CXX object CMakeFiles/flare.dir/src/NPCManager.cpp.obj
[ 64%] Building CXX object CMakeFiles/flare.dir/src/PowerManager.cpp.obj
[ 65%] Building CXX object CMakeFiles/flare.dir/src/QuestLog.cpp.obj
[ 66%] Building CXX object CMakeFiles/flare.dir/src/RenderDevice.cpp.obj
C:/flare/src/RenderDevice.cpp: In member function 'void RenderDevice::drawEllipse(int, int, int, int, const Color&, float)':
C:/flare/src/RenderDevice.cpp:381:46: error: 'M_PI' was not declared in this scope
381 | float rad = (step/180) * static_cast<float>(M_PI);
| ^~~~
mingw32-make[2]: *** [CMakeFiles/flare.dir/build.make:1103: CMakeFiles/flare.dir/src/RenderDevice.cpp.obj] Error 1
mingw32-make[2]: Leaving directory 'C:/flare'
mingw32-make[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/flare.dir/all] Error 2
mingw32-make[1]: Leaving directory 'C:/flare'
mingw32-make: *** [Makefile:147: all] Error 2

Добавлено через 26 минут
В интерне нашел что для исправления ошибки необходимо объявить константу M_PI в ручную:
const double M_PI = 3.14;

И еще хочу добавить что в стандартной библиотеке math.h константа M_PI объявлена, но компилятор MSYS2+mingw64 ее почему то не видит и из за этого возникает ошибка

если добавить константу в исходники в ручную:

const double M_PI = 3.14;

то ошибка компиляции исчезает и компиляция flare game engine идет без ошибок:

$ mingw32-make
mingw32-make[1]: Entering directory 'C:/flare'
mingw32-make[2]: Entering directory 'C:/flare'
Scanning dependencies of target flare
mingw32-make[2]: Leaving directory 'C:/flare'
mingw32-make[2]: Entering directory 'C:/flare'
[ 0%] Building CXX object CMakeFiles/flare.dir/src/BehaviorAlly.cpp.obj
[ 1%] Building CXX object CMakeFiles/flare.dir/src/Entity.cpp.obj
[ 2%] Building CXX object CMakeFiles/flare.dir/src/Animation.cpp.obj
[ 3%] Building CXX object CMakeFiles/flare.dir/src/AnimationManager.cpp.obj
[ 4%] Building CXX object CMakeFiles/flare.dir/src/AnimationSet.cpp.obj
[ 5%] Building CXX object CMakeFiles/flare.dir/src/AStarContainer.cpp.obj
[ 6%] Building CXX object CMakeFiles/flare.dir/src/AStarNode.cpp.obj
[ 7%] Building CXX object CMakeFiles/flare.dir/src/Avatar.cpp.obj
[ 8%] Building CXX object CMakeFiles/flare.dir/src/BehaviorStandard.cpp.obj
[ 8%] Building CXX object CMakeFiles/flare.dir/src/CampaignManager.cpp.obj
[ 9%] Building CXX object CMakeFiles/flare.dir/src/CombatText.cpp.obj
[ 10%] Building CXX object CMakeFiles/flare.dir/src/CursorManager.cpp.obj
[ 11%] Building CXX object CMakeFiles/flare.dir/src/DeviceList.cpp.obj
[ 12%] Building CXX object CMakeFiles/flare.dir/src/EffectManager.cpp.obj
[ 13%] Building CXX object CMakeFiles/flare.dir/src/Enemy.cpp.obj
[ 14%] Building CXX object CMakeFiles/flare.dir/src/EnemyBehavior.cpp.obj
[ 15%] Building CXX object CMakeFiles/flare.dir/src/EnemyGroupManager.cpp.obj
[ 16%] Building CXX object CMakeFiles/flare.dir/src/EnemyManager.cpp.obj
[ 16%] Building CXX object CMakeFiles/flare.dir/src/EngineSettings.cpp.obj
[ 17%] Building CXX object CMakeFiles/flare.dir/src/EventManager.cpp.obj
[ 18%] Building CXX object CMakeFiles/flare.dir/src/FileParser.cpp.obj
[ 19%] Building CXX object CMakeFiles/flare.dir/src/FontEngine.cpp.obj
[ 20%] Building CXX object CMakeFiles/flare.dir/src/GameSlotPreview.cpp.obj
[ 21%] Building CXX object CMakeFiles/flare.dir/src/GameState.cpp.obj
[ 22%] Building CXX object CMakeFiles/flare.dir/src/GameStateConfig.cpp.obj
[ 23%] Building CXX object CMakeFiles/flare.dir/src/GameStateCutscene.cpp.obj
[ 24%] Building CXX object CMakeFiles/flare.dir/src/GameStateTitle.cpp.obj
[ 25%] Building CXX object CMakeFiles/flare.dir/src/GameStateLoad.cpp.obj
[ 25%] Building CXX object CMakeFiles/flare.dir/src/GameStatePlay.cpp.obj
[ 26%] Building CXX object CMakeFiles/flare.dir/src/GameStateNew.cpp.obj
[ 27%] Building CXX object CMakeFiles/flare.dir/src/GameSwitcher.cpp.obj
[ 28%] Building CXX object CMakeFiles/flare.dir/src/GetText.cpp.obj
[ 29%] Building CXX object CMakeFiles/flare.dir/src/Hazard.cpp.obj
[ 30%] Building CXX object CMakeFiles/flare.dir/src/HazardManager.cpp.obj
[ 31%] Building CXX object CMakeFiles/flare.dir/src/IconManager.cpp.obj
[ 32%] Building CXX object CMakeFiles/flare.dir/src/InputState.cpp.obj
[ 33%] Building CXX object CMakeFiles/flare.dir/src/ItemManager.cpp.obj
[ 33%] Building CXX object CMakeFiles/flare.dir/src/ItemStorage.cpp.obj
[ 34%] Building CXX object CMakeFiles/flare.dir/src/Loot.cpp.obj
[ 35%] Building CXX object CMakeFiles/flare.dir/src/LootManager.cpp.obj
[ 36%] Building CXX object CMakeFiles/flare.dir/src/Map.cpp.obj
[ 37%] Building CXX object CMakeFiles/flare.dir/src/MapParallax.cpp.obj
[ 38%] Building CXX object CMakeFiles/flare.dir/src/MapCollision.cpp.obj
[ 39%] Building CXX object CMakeFiles/flare.dir/src/MapRenderer.cpp.obj
[ 40%] Building CXX object CMakeFiles/flare.dir/src/Menu.cpp.obj
[ 41%] Building CXX object CMakeFiles/flare.dir/src/MenuActionBar.cpp.obj
[ 41%] Building CXX object CMakeFiles/flare.dir/src/MenuActiveEffects.cpp.obj
[ 42%] Building CXX object CMakeFiles/flare.dir/src/MenuBook.cpp.obj
[ 43%] Building CXX object CMakeFiles/flare.dir/src/MenuCharacter.cpp.obj
[ 44%] Building CXX object CMakeFiles/flare.dir/src/MenuConfig.cpp.obj
[ 45%] Building CXX object CMakeFiles/flare.dir/src/MenuConfirm.cpp.obj
[ 46%] Building CXX object CMakeFiles/flare.dir/src/MenuDevConsole.cpp.obj
[ 47%] Building CXX object CMakeFiles/flare.dir/src/MenuEnemy.cpp.obj
[ 48%] Building CXX object CMakeFiles/flare.dir/src/MenuExit.cpp.obj
[ 49%] Building CXX object CMakeFiles/flare.dir/src/MenuHUDLog.cpp.obj
[ 50%] Building CXX object CMakeFiles/flare.dir/src/MenuInventory.cpp.obj
[ 50%] Building CXX object CMakeFiles/flare.dir/src/MenuItemStorage.cpp.obj
[ 51%] Building CXX object CMakeFiles/flare.dir/src/MenuLog.cpp.obj
[ 52%] Building CXX object CMakeFiles/flare.dir/src/MenuManager.cpp.obj
[ 53%] Building CXX object CMakeFiles/flare.dir/src/MenuMiniMap.cpp.obj
[ 54%] Building CXX object CMakeFiles/flare.dir/src/MenuNumPicker.cpp.obj
[ 55%] Building CXX object CMakeFiles/flare.dir/src/MenuPowers.cpp.obj
[ 56%] Building CXX object CMakeFiles/flare.dir/src/MenuStash.cpp.obj
[ 57%] Building CXX object CMakeFiles/flare.dir/src/MenuStatBar.cpp.obj
[ 58%] Building CXX object CMakeFiles/flare.dir/src/MenuTalker.cpp.obj
[ 58%] Building CXX object CMakeFiles/flare.dir/src/MenuTouchControls.cpp.obj
[ 59%] Building CXX object CMakeFiles/flare.dir/src/MenuVendor.cpp.obj
[ 60%] Building CXX object CMakeFiles/flare.dir/src/MessageEngine.cpp.obj
[ 61%] Building CXX object CMakeFiles/flare.dir/src/ModManager.cpp.obj
[ 62%] Building CXX object CMakeFiles/flare.dir/src/NPC.cpp.obj
[ 63%] Building CXX object CMakeFiles/flare.dir/src/NPCManager.cpp.obj
[ 64%] Building CXX object CMakeFiles/flare.dir/src/PowerManager.cpp.obj
[ 65%] Building CXX object CMakeFiles/flare.dir/src/QuestLog.cpp.obj
[ 66%] Building CXX object CMakeFiles/flare.dir/src/RenderDevice.cpp.obj
[ 66%] Building CXX object CMakeFiles/flare.dir/src/SaveLoad.cpp.obj
[ 67%] Building CXX object CMakeFiles/flare.dir/src/SDLInputState.cpp.obj
[ 68%] Building CXX object CMakeFiles/flare.dir/src/SDLSoftwareRenderDevice.cpp.obj
[ 69%] Building CXX object CMakeFiles/flare.dir/src/SDLSoundManager.cpp.obj
[ 70%] Building CXX object CMakeFiles/flare.dir/src/SDLHardwareRenderDevice.cpp.obj
[ 71%] Building CXX object CMakeFiles/flare.dir/src/SDLFontEngine.cpp.obj
[ 72%] Building CXX object CMakeFiles/flare.dir/src/Settings.cpp.obj
[ 73%] Building CXX object CMakeFiles/flare.dir/src/SharedGameResources.cpp.obj
[ 74%] Building CXX object CMakeFiles/flare.dir/src/SharedResources.cpp.obj
[ 75%] Building CXX object CMakeFiles/flare.dir/src/SoundManager.cpp.obj
[ 75%] Building CXX object CMakeFiles/flare.dir/src/StatBlock.cpp.obj
[ 76%] Building CXX object CMakeFiles/flare.dir/src/Stats.cpp.obj
[ 77%] Building CXX object CMakeFiles/flare.dir/src/Subtitles.cpp.obj
[ 78%] Building CXX object CMakeFiles/flare.dir/src/TileSet.cpp.obj
[ 79%] Building CXX object CMakeFiles/flare.dir/src/TooltipData.cpp.obj
[ 80%] Building CXX object CMakeFiles/flare.dir/src/TooltipManager.cpp.obj
[ 81%] Building CXX object CMakeFiles/flare.dir/src/Utils.cpp.obj
[ 82%] Building CXX object CMakeFiles/flare.dir/src/UtilsDebug.cpp.obj
[ 83%] Building CXX object CMakeFiles/flare.dir/src/UtilsFileSystem.cpp.obj
[ 83%] Building CXX object CMakeFiles/flare.dir/src/UtilsParsing.cpp.obj
[ 84%] Building CXX object CMakeFiles/flare.dir/src/Version.cpp.obj
[ 85%] Building CXX object CMakeFiles/flare.dir/src/Widget.cpp.obj
[ 86%] Building CXX object CMakeFiles/flare.dir/src/WidgetCheckBox.cpp.obj
[ 87%] Building CXX object CMakeFiles/flare.dir/src/WidgetButton.cpp.obj
[ 88%] Building CXX object CMakeFiles/flare.dir/src/WidgetHorizontalList.cpp.obj
[ 89%] Building CXX object CMakeFiles/flare.dir/src/WidgetInput.cpp.obj
[ 90%] Building CXX object CMakeFiles/flare.dir/src/WidgetLabel.cpp.obj
[ 91%] Building CXX object CMakeFiles/flare.dir/src/WidgetListBox.cpp.obj
[ 91%] Building CXX object CMakeFiles/flare.dir/src/WidgetLog.cpp.obj
[ 92%] Building CXX object CMakeFiles/flare.dir/src/WidgetScrollBar.cpp.obj
[ 93%] Building CXX object CMakeFiles/flare.dir/src/WidgetScrollBox.cpp.obj
[ 94%] Building CXX object CMakeFiles/flare.dir/src/WidgetSlider.cpp.obj
[ 95%] Building CXX object CMakeFiles/flare.dir/src/WidgetSlot.cpp.obj
[ 96%] Building CXX object CMakeFiles/flare.dir/src/WidgetTabControl.cpp.obj
[ 97%] Building CXX object CMakeFiles/flare.dir/src/WidgetTooltip.cpp.obj
[ 98%] Building CXX object CMakeFiles/flare.dir/src/main.cpp.obj
[ 99%] Building RC object CMakeFiles/flare.dir/src/Flare.rc.obj
[100%] Linking CXX executable flare.exe
mingw32-make[2]: Leaving directory 'C:/flare'
[100%] Built target flare
mingw32-make[1]: Leaving directory 'C:/flare'
0

Помощь в написании контрольных, курсовых и дипломных работ здесь.

Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
09.04.2020, 01:00
Ответы с готовыми решениями:

Anamorphic lens flare гугл не помог
Где найти алгоритм этой божественной вещи?

нетбук Asus EEe PC Flare Series - питание
Доброго времени суток! Нетбуку 3 года. Батареи где-то на час - полтора хватало. Позавчера...

Ошибка при компиляции. Где ошибка? (Работа с классом)
Уважаемые форумчане! При компиляции проекта возникает ошибка &quot; undefined reference to...

Ошибка компиляции. Ошибка - frxpngimage.dcu
Ошибка при компиляции приложения. Само приложение делал на учебе , закинул всю папку на флешку с...

5
0 / 0 / 0
Регистрация: 18.12.2018
Сообщений: 35
09.04.2020, 01:00  [ТС] 2
В интерне нашел что для исправления ошибки необходимо объявить константу M_PI в ручную:
const double M_PI = 3.14;

И еще хочу добавить что в стандартной библиотеке math.h константа M_PI объявлена, но компилятор MSYS2+mingw64 ее почему то не видит и из за этого возникает ошибка

если добавить константу в исходники в ручную:

const double M_PI = 3.14;

то ошибка компиляции исчезает и компиляция flare game engine идет без ошибок:

$ mingw32-make
mingw32-make[1]: Entering directory 'C:/flare'
mingw32-make[2]: Entering directory 'C:/flare'
Scanning dependencies of target flare
mingw32-make[2]: Leaving directory 'C:/flare'
mingw32-make[2]: Entering directory 'C:/flare'
[ 0%] Building CXX object CMakeFiles/flare.dir/src/BehaviorAlly.cpp.obj
[ 1%] Building CXX object CMakeFiles/flare.dir/src/Entity.cpp.obj
[ 2%] Building CXX object CMakeFiles/flare.dir/src/Animation.cpp.obj
[ 3%] Building CXX object CMakeFiles/flare.dir/src/AnimationManager.cpp.obj
[ 4%] Building CXX object CMakeFiles/flare.dir/src/AnimationSet.cpp.obj
[ 5%] Building CXX object CMakeFiles/flare.dir/src/AStarContainer.cpp.obj
[ 6%] Building CXX object CMakeFiles/flare.dir/src/AStarNode.cpp.obj
[ 7%] Building CXX object CMakeFiles/flare.dir/src/Avatar.cpp.obj
[ 8%] Building CXX object CMakeFiles/flare.dir/src/BehaviorStandard.cpp.obj
[ 8%] Building CXX object CMakeFiles/flare.dir/src/CampaignManager.cpp.obj
[ 9%] Building CXX object CMakeFiles/flare.dir/src/CombatText.cpp.obj
[ 10%] Building CXX object CMakeFiles/flare.dir/src/CursorManager.cpp.obj
[ 11%] Building CXX object CMakeFiles/flare.dir/src/DeviceList.cpp.obj
[ 12%] Building CXX object CMakeFiles/flare.dir/src/EffectManager.cpp.obj
[ 13%] Building CXX object CMakeFiles/flare.dir/src/Enemy.cpp.obj
[ 14%] Building CXX object CMakeFiles/flare.dir/src/EnemyBehavior.cpp.obj
[ 15%] Building CXX object CMakeFiles/flare.dir/src/EnemyGroupManager.cpp.obj
[ 16%] Building CXX object CMakeFiles/flare.dir/src/EnemyManager.cpp.obj
[ 16%] Building CXX object CMakeFiles/flare.dir/src/EngineSettings.cpp.obj
[ 17%] Building CXX object CMakeFiles/flare.dir/src/EventManager.cpp.obj
[ 18%] Building CXX object CMakeFiles/flare.dir/src/FileParser.cpp.obj
[ 19%] Building CXX object CMakeFiles/flare.dir/src/FontEngine.cpp.obj
[ 20%] Building CXX object CMakeFiles/flare.dir/src/GameSlotPreview.cpp.obj
[ 21%] Building CXX object CMakeFiles/flare.dir/src/GameState.cpp.obj
[ 22%] Building CXX object CMakeFiles/flare.dir/src/GameStateConfig.cpp.obj
[ 23%] Building CXX object CMakeFiles/flare.dir/src/GameStateCutscene.cpp.obj
[ 24%] Building CXX object CMakeFiles/flare.dir/src/GameStateTitle.cpp.obj
[ 25%] Building CXX object CMakeFiles/flare.dir/src/GameStateLoad.cpp.obj
[ 25%] Building CXX object CMakeFiles/flare.dir/src/GameStatePlay.cpp.obj
[ 26%] Building CXX object CMakeFiles/flare.dir/src/GameStateNew.cpp.obj
[ 27%] Building CXX object CMakeFiles/flare.dir/src/GameSwitcher.cpp.obj
[ 28%] Building CXX object CMakeFiles/flare.dir/src/GetText.cpp.obj
[ 29%] Building CXX object CMakeFiles/flare.dir/src/Hazard.cpp.obj
[ 30%] Building CXX object CMakeFiles/flare.dir/src/HazardManager.cpp.obj
[ 31%] Building CXX object CMakeFiles/flare.dir/src/IconManager.cpp.obj
[ 32%] Building CXX object CMakeFiles/flare.dir/src/InputState.cpp.obj
[ 33%] Building CXX object CMakeFiles/flare.dir/src/ItemManager.cpp.obj
[ 33%] Building CXX object CMakeFiles/flare.dir/src/ItemStorage.cpp.obj
[ 34%] Building CXX object CMakeFiles/flare.dir/src/Loot.cpp.obj
[ 35%] Building CXX object CMakeFiles/flare.dir/src/LootManager.cpp.obj
[ 36%] Building CXX object CMakeFiles/flare.dir/src/Map.cpp.obj
[ 37%] Building CXX object CMakeFiles/flare.dir/src/MapParallax.cpp.obj
[ 38%] Building CXX object CMakeFiles/flare.dir/src/MapCollision.cpp.obj
[ 39%] Building CXX object CMakeFiles/flare.dir/src/MapRenderer.cpp.obj
[ 40%] Building CXX object CMakeFiles/flare.dir/src/Menu.cpp.obj
[ 41%] Building CXX object CMakeFiles/flare.dir/src/MenuActionBar.cpp.obj
[ 41%] Building CXX object CMakeFiles/flare.dir/src/MenuActiveEffects.cpp.obj
[ 42%] Building CXX object CMakeFiles/flare.dir/src/MenuBook.cpp.obj
[ 43%] Building CXX object CMakeFiles/flare.dir/src/MenuCharacter.cpp.obj
[ 44%] Building CXX object CMakeFiles/flare.dir/src/MenuConfig.cpp.obj
[ 45%] Building CXX object CMakeFiles/flare.dir/src/MenuConfirm.cpp.obj
[ 46%] Building CXX object CMakeFiles/flare.dir/src/MenuDevConsole.cpp.obj
[ 47%] Building CXX object CMakeFiles/flare.dir/src/MenuEnemy.cpp.obj
[ 48%] Building CXX object CMakeFiles/flare.dir/src/MenuExit.cpp.obj
[ 49%] Building CXX object CMakeFiles/flare.dir/src/MenuHUDLog.cpp.obj
[ 50%] Building CXX object CMakeFiles/flare.dir/src/MenuInventory.cpp.obj
[ 50%] Building CXX object CMakeFiles/flare.dir/src/MenuItemStorage.cpp.obj
[ 51%] Building CXX object CMakeFiles/flare.dir/src/MenuLog.cpp.obj
[ 52%] Building CXX object CMakeFiles/flare.dir/src/MenuManager.cpp.obj
[ 53%] Building CXX object CMakeFiles/flare.dir/src/MenuMiniMap.cpp.obj
[ 54%] Building CXX object CMakeFiles/flare.dir/src/MenuNumPicker.cpp.obj
[ 55%] Building CXX object CMakeFiles/flare.dir/src/MenuPowers.cpp.obj
[ 56%] Building CXX object CMakeFiles/flare.dir/src/MenuStash.cpp.obj
[ 57%] Building CXX object CMakeFiles/flare.dir/src/MenuStatBar.cpp.obj
[ 58%] Building CXX object CMakeFiles/flare.dir/src/MenuTalker.cpp.obj
[ 58%] Building CXX object CMakeFiles/flare.dir/src/MenuTouchControls.cpp.obj
[ 59%] Building CXX object CMakeFiles/flare.dir/src/MenuVendor.cpp.obj
[ 60%] Building CXX object CMakeFiles/flare.dir/src/MessageEngine.cpp.obj
[ 61%] Building CXX object CMakeFiles/flare.dir/src/ModManager.cpp.obj
[ 62%] Building CXX object CMakeFiles/flare.dir/src/NPC.cpp.obj
[ 63%] Building CXX object CMakeFiles/flare.dir/src/NPCManager.cpp.obj
[ 64%] Building CXX object CMakeFiles/flare.dir/src/PowerManager.cpp.obj
[ 65%] Building CXX object CMakeFiles/flare.dir/src/QuestLog.cpp.obj
[ 66%] Building CXX object CMakeFiles/flare.dir/src/RenderDevice.cpp.obj
[ 66%] Building CXX object CMakeFiles/flare.dir/src/SaveLoad.cpp.obj
[ 67%] Building CXX object CMakeFiles/flare.dir/src/SDLInputState.cpp.obj
[ 68%] Building CXX object CMakeFiles/flare.dir/src/SDLSoftwareRenderDevice.cpp.obj
[ 69%] Building CXX object CMakeFiles/flare.dir/src/SDLSoundManager.cpp.obj
[ 70%] Building CXX object CMakeFiles/flare.dir/src/SDLHardwareRenderDevice.cpp.obj
[ 71%] Building CXX object CMakeFiles/flare.dir/src/SDLFontEngine.cpp.obj
[ 72%] Building CXX object CMakeFiles/flare.dir/src/Settings.cpp.obj
[ 73%] Building CXX object CMakeFiles/flare.dir/src/SharedGameResources.cpp.obj
[ 74%] Building CXX object CMakeFiles/flare.dir/src/SharedResources.cpp.obj
[ 75%] Building CXX object CMakeFiles/flare.dir/src/SoundManager.cpp.obj
[ 75%] Building CXX object CMakeFiles/flare.dir/src/StatBlock.cpp.obj
[ 76%] Building CXX object CMakeFiles/flare.dir/src/Stats.cpp.obj
[ 77%] Building CXX object CMakeFiles/flare.dir/src/Subtitles.cpp.obj
[ 78%] Building CXX object CMakeFiles/flare.dir/src/TileSet.cpp.obj
[ 79%] Building CXX object CMakeFiles/flare.dir/src/TooltipData.cpp.obj
[ 80%] Building CXX object CMakeFiles/flare.dir/src/TooltipManager.cpp.obj
[ 81%] Building CXX object CMakeFiles/flare.dir/src/Utils.cpp.obj
[ 82%] Building CXX object CMakeFiles/flare.dir/src/UtilsDebug.cpp.obj
[ 83%] Building CXX object CMakeFiles/flare.dir/src/UtilsFileSystem.cpp.obj
[ 83%] Building CXX object CMakeFiles/flare.dir/src/UtilsParsing.cpp.obj
[ 84%] Building CXX object CMakeFiles/flare.dir/src/Version.cpp.obj
[ 85%] Building CXX object CMakeFiles/flare.dir/src/Widget.cpp.obj
[ 86%] Building CXX object CMakeFiles/flare.dir/src/WidgetCheckBox.cpp.obj
[ 87%] Building CXX object CMakeFiles/flare.dir/src/WidgetButton.cpp.obj
[ 88%] Building CXX object CMakeFiles/flare.dir/src/WidgetHorizontalList.cpp.obj
[ 89%] Building CXX object CMakeFiles/flare.dir/src/WidgetInput.cpp.obj
[ 90%] Building CXX object CMakeFiles/flare.dir/src/WidgetLabel.cpp.obj
[ 91%] Building CXX object CMakeFiles/flare.dir/src/WidgetListBox.cpp.obj
[ 91%] Building CXX object CMakeFiles/flare.dir/src/WidgetLog.cpp.obj
[ 92%] Building CXX object CMakeFiles/flare.dir/src/WidgetScrollBar.cpp.obj
[ 93%] Building CXX object CMakeFiles/flare.dir/src/WidgetScrollBox.cpp.obj
[ 94%] Building CXX object CMakeFiles/flare.dir/src/WidgetSlider.cpp.obj
[ 95%] Building CXX object CMakeFiles/flare.dir/src/WidgetSlot.cpp.obj
[ 96%] Building CXX object CMakeFiles/flare.dir/src/WidgetTabControl.cpp.obj
[ 97%] Building CXX object CMakeFiles/flare.dir/src/WidgetTooltip.cpp.obj
[ 98%] Building CXX object CMakeFiles/flare.dir/src/main.cpp.obj
[ 99%] Building RC object CMakeFiles/flare.dir/src/Flare.rc.obj
[100%] Linking CXX executable flare.exe
mingw32-make[2]: Leaving directory 'C:/flare'
[100%] Built target flare
mingw32-make[1]: Leaving directory 'C:/flare'
0
15122 / 8120 / 1961
Регистрация: 30.01.2014
Сообщений: 13,804
09.04.2020, 01:13 3
Лучший ответ Сообщение было отмечено sergejj180 как решение

Решение

Цитата Сообщение от sergejj180 Посмотреть сообщение
компилятор MSYS2+mingw64 ее почему то не видит
Эта константа доступна только режиме "GNU".
http://man7.org/linux/man-page... ros.7.html
1
0 / 0 / 0
Регистрация: 18.12.2018
Сообщений: 35
09.04.2020, 01:20  [ТС] 4
Лучше скажи как исправить ошибку чтобы она больше не возникала
0
15122 / 8120 / 1961
Регистрация: 30.01.2014
Сообщений: 13,804
09.04.2020, 01:29 5
Лучший ответ Сообщение было отмечено sergejj180 как решение

Решение

sergejj180, так я и сказал же, нужно перевести компиляцию в режим GNU. По ссылке есть примеры.
Можно добавить
C++
1
#define _GNU_SOURCE
Выше все include`ов в файле, где возникает ошибка.

Или ключом компиляции в cmake переключить компилятор на диалект GNU, например -std=gnu++11 (для с++11).
1
0 / 0 / 0
Регистрация: 18.12.2018
Сообщений: 35
09.04.2020, 01:34  [ТС] 6
Теперь компилируется без ошибок
0
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
09.04.2020, 01:34

При компиляции ошибка. Ошибка c++ C2678
Ошибка c++ C2678 #include &lt;windows.h&gt; #include &lt;string&gt; #include &lt;iostream&gt; #include &lt;conio.h&gt;...

Ошибка компиляции
#include &lt;iostream&gt; class X { public: static int a; }; void main() {

Ошибка компиляции
Доброго времени суток. при компиляции главный unit выдаёт вот такую ошибку: UntMain.pas(91):...

Ошибка компиляции
Привет всем проблема бесит неимоверно. Пишутся лабораторные работы на паскале. Сдаются удаленно,...

Ошибка компиляции
Добрый вечер, подскажите плз. Код не запускается, ошибка tform1 is missing or incorrect. В делфи не...

Ошибка компиляции
Задание: Треугольник Паскаля Дано целое число N. Требуется найти и вывести N верхних строк...


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

Или воспользуйтесь поиском по форуму:
6
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.