OneLoneCoder / olcUTIL_Geometry2D

A Single-Header 2D Geometry Analysis Library
Other
284 stars 51 forks source link

Please note, REQUIRE C++20, or we have alot of work to do to get rid of all of this.. #8

Open Moros1138 opened 11 months ago

Moros1138 commented 11 months ago
[main] Building folder: olcUTIL_Geometry2D 
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/build --config Debug --target all --
[build] [1/2  50% :: 1.072] Building CXX object CMakeFiles/TEST_Geometry2D.dir/TEST_Geometry2D.cpp.o
[build] FAILED: CMakeFiles/TEST_Geometry2D.dir/TEST_Geometry2D.cpp.o 
[build] /usr/bin/clang++ -DUSE_OPENAL -I/home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D -I/home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party -g -std=c++17 -ggdb3 -Og -MD -MT CMakeFiles/TEST_Geometry2D.dir/TEST_Geometry2D.cpp.o -MF CMakeFiles/TEST_Geometry2D.dir/TEST_Geometry2D.cpp.o.d -o CMakeFiles/TEST_Geometry2D.dir/TEST_Geometry2D.cpp.o -c /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/TEST_Geometry2D.cpp
[build] In file included from /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/TEST_Geometry2D.cpp:4:
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/olcUTIL_Geometry2D.h:210:32: error: constexpr function's return type 'std::string' (aka 'basic_string<char>') is not a literal type
[build]                 inline constexpr std::string str() const
[build]                                              ^
[build] /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/basic_string.tcc:963:25: note: 'basic_string<char>' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
[build]   extern template class basic_string<char>;
[build]                         ^
[build] In file included from /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/TEST_Geometry2D.cpp:5:
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:1950:14: error: 'pge' is a protected member of 'olc::PGEX'
[build]                 olc::PGEX::pge = this;
[build]                            ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:1340:27: note: declared protected here
[build]                 static PixelGameEngine* pge;
[build]                                         ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2380:44: error: 'this' cannot be implicitly captured in this context
[build]                         if (v.x < 0) i |= SEG_L; else if (v.x > vScreenSize.x) i |= SEG_R;
[build]                                                                 ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2377:45: note: explicitly capture 'this'
[build]                 auto Segment = [&vScreenSize = vScreenSize](const olc::vi2d& v)
[build]                                                           ^
[build]                                                           this
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2381:44: error: 'this' cannot be implicitly captured in this context
[build]                         if (v.y < 0) i |= SEG_B; else if (v.y > vScreenSize.y) i |= SEG_T;
[build]                                                                 ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2377:45: note: explicitly capture 'this'
[build]                 auto Segment = [&vScreenSize = vScreenSize](const olc::vi2d& v)
[build]                                                           ^
[build]                                                           this
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:3782:38: error: 'OnBeforeUserCreate' is a protected member of 'olc::PGEX'
[build]                 for (auto& ext : vExtensions) ext->OnBeforeUserCreate();
[build]                                                    ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:1334:16: note: declared protected here
[build]                 virtual void OnBeforeUserCreate();
[build]                              ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:3784:38: error: 'OnAfterUserCreate' is a protected member of 'olc::PGEX'
[build]                 for (auto& ext : vExtensions) ext->OnAfterUserCreate();
[build]                                                    ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:1335:16: note: declared protected here
[build]                 virtual void OnAfterUserCreate();
[build]                              ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:3881:62: error: 'OnBeforeUserUpdate' is a protected member of 'olc::PGEX'
[build]                 for (auto& ext : vExtensions) bExtensionBlockFrame |= ext->OnBeforeUserUpdate(fElapsedTime);
[build]                                                                            ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:1336:16: note: declared protected here
[build]                 virtual bool OnBeforeUserUpdate(float &fElapsedTime);
[build]                              ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:3887:38: error: 'OnAfterUserUpdate' is a protected member of 'olc::PGEX'
[build]                 for (auto& ext : vExtensions) ext->OnAfterUserUpdate(fElapsedTime);
[build]                                                    ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:1337:16: note: declared protected here
[build]                 virtual void OnAfterUserUpdate(float fElapsedTime);
[build]                              ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:4363:8: warning: 'SetDecalMode' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
[build]                 void SetDecalMode(const olc::DecalMode& mode)
[build]                      ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:922:19: note: overridden virtual function is here
[build]                 virtual void       SetDecalMode(const olc::DecalMode& mode) = 0;
[build]                                    ^
[build] In file included from /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/TEST_Geometry2D.cpp:8:
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:768:11: error: cannot initialize object parameter of type 'olc::QuickGUI::Button' with an expression of type 'olc::QuickGUI::ImageButton'
[build]                 Button::Draw(pge);
[build]                         ^~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:774:11: error: cannot initialize object parameter of type 'olc::QuickGUI::Button' with an expression of type 'olc::QuickGUI::ImageButton'
[build]                 Button::DrawDecal(pge);
[build]                         ^~~~~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:792:16: error: cannot initialize object parameter of type 'olc::QuickGUI::Button' with an expression of type 'olc::QuickGUI::ImageCheckBox'
[build]                 ImageButton::Update(pge);
[build]                              ^~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:798:16: error: cannot initialize object parameter of type 'olc::QuickGUI::ImageButton' with an expression of type 'olc::QuickGUI::ImageCheckBox'
[build]                 ImageButton::Draw(pge);
[build]                              ^~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:809:16: error: cannot initialize object parameter of type 'olc::QuickGUI::ImageButton' with an expression of type 'olc::QuickGUI::ImageCheckBox'
[build]                 ImageButton::DrawDecal(pge);
[build]                              ^~~~~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:839:11: error: cannot initialize object parameter of type 'olc::QuickGUI::Button' with an expression of type 'olc::QuickGUI::CheckBox'
[build]                 Button::Update(pge);
[build]                         ^~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:849:11: error: cannot initialize object parameter of type 'olc::QuickGUI::Button' with an expression of type 'olc::QuickGUI::CheckBox'
[build]                 Button::Draw(pge);
[build]                         ^~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:860:11: error: cannot initialize object parameter of type 'olc::QuickGUI::Button' with an expression of type 'olc::QuickGUI::CheckBox'
[build]                 Button::DrawDecal(pge);
[build]                         ^~~~~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:942:20: error: no viable conversion from 'v_2d<float>' to 'const v_2d<int32_t>'
[build]                         pge->FillCircle(vSliderPos, int32_t(m_manager.fGrabRad), m_manager.colDisable);
[build]                                         ^~~~~~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/olcUTIL_Geometry2D.h:100:20: note: candidate constructor not viable: no known conversion from 'olc::vf2d' (aka 'v_2d<float>') to 'const v_2d<int> &' for 1st argument
[build]                 inline constexpr v_2d(const v_2d& v) = default;
[build]                                  ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2307:52: note: passing argument to parameter 'pos' here
[build]         void PixelGameEngine::FillCircle(const olc::vi2d& pos, int32_t radius, Pixel p)
[build]                                                           ^
[build] In file included from /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/TEST_Geometry2D.cpp:8:
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:946:20: error: no viable conversion from 'v_2d<float>' to 'const v_2d<int32_t>'
[build]                         pge->FillCircle(vSliderPos, int32_t(m_manager.fGrabRad), olc::PixelLerp(m_manager.colNormal, m_manager.colHover, m_fTransition));
[build]                                         ^~~~~~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/olcUTIL_Geometry2D.h:100:20: note: candidate constructor not viable: no known conversion from 'olc::vf2d' (aka 'v_2d<float>') to 'const v_2d<int> &' for 1st argument
[build]                 inline constexpr v_2d(const v_2d& v) = default;
[build]                                  ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2307:52: note: passing argument to parameter 'pos' here
[build]         void PixelGameEngine::FillCircle(const olc::vi2d& pos, int32_t radius, Pixel p)
[build]                                                           ^
[build] In file included from /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/TEST_Geometry2D.cpp:8:
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPGEX_QuickGUI.h:949:20: error: no viable conversion from 'v_2d<float>' to 'const v_2d<int32_t>'
[build]                         pge->FillCircle(vSliderPos, int32_t(m_manager.fGrabRad), m_manager.colClick);
[build]                                         ^~~~~~~~~~
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/olcUTIL_Geometry2D.h:100:20: note: candidate constructor not viable: no known conversion from 'olc::vf2d' (aka 'v_2d<float>') to 'const v_2d<int> &' for 1st argument
[build]                 inline constexpr v_2d(const v_2d& v) = default;
[build]                                  ^
[build] /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/third_party/olcPixelGameEngine.h:2307:52: note: passing argument to parameter 'pos' here
[build]         void PixelGameEngine::FillCircle(const olc::vi2d& pos, int32_t radius, Pixel p)
[build]                                                           ^
[build] fatal error: too many errors emitted, stopping now [-ferror-limit=]
[build] 1 warning and 20 errors generated.
[build] ninja: build stopped: subcommand failed.
[proc] The command: /usr/bin/cmake --build /home/jon/Projects/OneLoneCoder/olcUTIL_Geometry2D/build --config Debug --target all -- exited with code: 1
[driver] Build completed: 00:00:01.133
[build] Build finished with exit code 1
ColinH commented 8 months ago

On a related note, it would be helpful if the readme clearly stated which version of C++ was targeted.

OneLoneCoder commented 8 months ago

Agreed, the readme in general is no longer fit for purpose, and we're gonna start needing some example code usage at some point too.