You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Makefile to build the examples in this repository on GNU Linux. It has been tested on Ubuntu 18.04. Running make will create temporary cpp file that are modified versions of the the original cpp files. Main differences are using olcConsoleGameEngineSDL.h instead of olcConsoleGameEngine.h and substituting the VK_SHIFT and VK_CONTROL flags.
You don't need to accept the pull request, I just wanted to let you know about it.
These are the programs that build and run at the moment:
OneLoneCoder_Asteroids
OneLoneCoder_Balls1
OneLoneCoder_ComandLineFPS_2
OneLoneCoder_Frogger
OneLoneCoder_GameOfLife
OneLoneCoder_Matrix
OneLoneCoder_Mazes
OneLoneCoder_OverEngineered
OneLoneCoder_PathFinding_AStar
OneLoneCoder_PerlinNoise
OneLoneCoder_PlatformGame1
OneLoneCoder_Pseudo3DPlanesMode7
OneLoneCoder_RetroArcadeRacer
OneLoneCoder_Splines1
OneLoneCoder_Splines2
OneLoneCoder_SpriteEditor
These are the ones that do not compile:
OneLoneCoder_AR_OpticFlow (missing escapi.h)
OneLoneCoder_Balls2 (missing function max)
OneLoneCoder_CaveDiver (imports Windows.h)
OneLoneCoder_CommandLineFPS (imports Windows.h)
OneLoneCoder_FlappyBird (imports Windows.h)
OneLoneCoder_LogitechG13Twitch (winsock2.h)
OneLoneCoder_LudumDare42 (missing function max)
OneLoneCoder_olcEngine3D_Part1-4 strange errors, haven't checked
OneLoneCoder_PanAndZoom (missing to_wstring)
OneLoneCoder_RacingLines (missing FillTriangle)
OneLoneCoder_Snake (imports Windows.h)
OneLoneCoder_Tetris (imports Windows.h)
OneLoneCoder_Webcam (missing escapi.h)
worms/OneLoneCoder_Worms1-3 (missing escapi.h)
I like this, but do not have a sensible way to test it. What I will do is encourage people to examin this PR and use it as they see fit - so I wont close it down.
`Does not seem to work on my Linux Mint, any ideas?
olcConsoleGameEngineSDL.h: In member function ‘bool olcSprite::Save(std::wstring)’:
olcConsoleGameEngineSDL.h:383:66: error: no matching function for call to ‘std::basic_ofstream::basic_ofstream(const wchar_t*, std::_Ios_Openmode)’
383 | std::ofstream f(sFile.c_str(), std::ios::out | std::ios::binary);
| ^
In file included from olcConsoleGameEngineSDL.h:141,
from OneLoneCoder_Asteroids_linux.cpp:64:
/usr/include/c++/9/fstream:850:7: note: candidate: ‘std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits]’
850 | basic_ofstream(basic_ofstream&& __rhs)
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:850:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/9/fstream:825:7: note: candidate: ‘std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::string = std::__cxx11::basic_string; std::ios_base::openmode = std::_Ios_Openmode]’
825 | basic_ofstream(const std::string& __s,
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:825:41: note: no known conversion for argument 1 from ‘const wchar_t*’ to ‘const string&’ {aka ‘const std::__cxx11::basic_string&’}
825 | basic_ofstream(const std::string& __s,
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/fstream:790:7: note: candidate: ‘std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]’
790 | basic_ofstream(const char* __s,
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:790:34: note: no known conversion for argument 1 from ‘const wchar_t*’ to ‘const char*’
790 | basic_ofstream(const char* __s,
| ~~~~~~~~~~~~^~~
/usr/include/c++/9/fstream:779:7: note: candidate: ‘std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits]’
779 | basic_ofstream(): __ostream_type(), _M_filebuf()
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:779:7: note: candidate expects 0 arguments, 2 provided
In file included from OneLoneCoder_Asteroids_linux.cpp:64:
olcConsoleGameEngineSDL.h: In member function ‘bool olcSprite::Load(std::wstring)’:
olcConsoleGameEngineSDL.h:409:65: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const wchar_t*, std::_Ios_Openmode)’
409 | std::ifstream f(sFile.c_str(), std::ios::in | std::ios::binary);
| ^
In file included from olcConsoleGameEngineSDL.h:141,
from OneLoneCoder_Asteroids_linux.cpp:64:
/usr/include/c++/9/fstream:587:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits]’
587 | basic_ifstream(basic_ifstream&& __rhs)
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:587:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/9/fstream:562:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::string = std::__cxx11::basic_string; std::ios_base::openmode = std::_Ios_Openmode]’
562 | basic_ifstream(const std::string& __s,
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:562:41: note: no known conversion for argument 1 from ‘const wchar_t*’ to ‘const string&’ {aka ‘const std::__cxx11::basic_string&’}
562 | basic_ifstream(const std::string& __s,
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/fstream:529:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]’
529 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:529:34: note: no known conversion for argument 1 from ‘const wchar_t*’ to ‘const char*’
529 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
| ~~~~~~~~~~~~^~~
/usr/include/c++/9/fstream:518:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]’
518 | basic_ifstream() : __istream_type(), _M_filebuf()
| ^~~~~~~~~~~~~~
/usr/include/c++/9/fstream:518:7: note: candidate expects 0 arguments, 2 provided
In file included from OneLoneCoder_Asteroids_linux.cpp:64:
olcConsoleGameEngineSDL.h: In member function ‘void olcConsoleGameEngine::GameThread()’:
olcConsoleGameEngineSDL.h:928:70: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 209 [-Wformat-truncation=]
928 | snprintf(s, 256, "OneLoneCoder.com - Console Game Engine (SDL) - %s - FPS: %3.2f", bufAppName, 1.0f / fElapsedTime);
| ^~ ~~~~~~~~~~
olcConsoleGameEngineSDL.h:928:22: note: assuming directive output of 4 bytes
928 | snprintf(s, 256, "OneLoneCoder.com - Console Game Engine (SDL) - %s - FPS: %3.2f", bufAppName, 1.0f / fElapsedTime);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
olcConsoleGameEngineSDL.h:928:13: note: ‘snprintf’ output between 59 and 624 bytes into a destination of size 256
928 | snprintf(s, 256, "OneLoneCoder.com - Console Game Engine (SDL) - %s - FPS: %3.2f", bufAppName, 1.0f / fElapsedTime);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:59: OneLoneCoder_Asteroids] Error 1
`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a Makefile to build the examples in this repository on GNU Linux. It has been tested on Ubuntu 18.04. Running make will create temporary cpp file that are modified versions of the the original cpp files. Main differences are using
olcConsoleGameEngineSDL.hinstead ofolcConsoleGameEngine.hand substituting theVK_SHIFTandVK_CONTROLflags.You don't need to accept the pull request, I just wanted to let you know about it.
These are the programs that build and run at the moment:
OneLoneCoder_Asteroids
OneLoneCoder_Balls1
OneLoneCoder_ComandLineFPS_2
OneLoneCoder_Frogger
OneLoneCoder_GameOfLife
OneLoneCoder_Matrix
OneLoneCoder_Mazes
OneLoneCoder_OverEngineered
OneLoneCoder_PathFinding_AStar
OneLoneCoder_PerlinNoise
OneLoneCoder_PlatformGame1
OneLoneCoder_Pseudo3DPlanesMode7
OneLoneCoder_RetroArcadeRacer
OneLoneCoder_Splines1
OneLoneCoder_Splines2
OneLoneCoder_SpriteEditor
These are the ones that do not compile:
OneLoneCoder_AR_OpticFlow (missing escapi.h)
OneLoneCoder_Balls2 (missing function max)
OneLoneCoder_CaveDiver (imports Windows.h)
OneLoneCoder_CommandLineFPS (imports Windows.h)
OneLoneCoder_FlappyBird (imports Windows.h)
OneLoneCoder_LogitechG13Twitch (winsock2.h)
OneLoneCoder_LudumDare42 (missing function max)
OneLoneCoder_olcEngine3D_Part1-4 strange errors, haven't checked
OneLoneCoder_PanAndZoom (missing to_wstring)
OneLoneCoder_RacingLines (missing FillTriangle)
OneLoneCoder_Snake (imports Windows.h)
OneLoneCoder_Tetris (imports Windows.h)
OneLoneCoder_Webcam (missing escapi.h)
worms/OneLoneCoder_Worms1-3 (missing escapi.h)