Search ProofOfProgress Blog

Tuesday, January 19, 2016

Forward Declarations may be needed.

http://stackoverflow.com/questions/2133250/does-not-name-a-type-error

Remembering how to remember friend class C++

  • Friendships are not symmetric – If class A is a friend of class B, class B is not automatically a friend of class A.
    "I thought you were my friend, but the feelings were not mutual."
  • Friendships are not transitive – If class A is a friend of class B, and class B is a friend of class C, class A is not automatically a friend of class C.
    "Just because he is your friend doesn't make him my friend."
  • Friendships are not inherited – A friend of class Base is not automatically a friend of class Derived and vice versa; equally if Base is a friend of another class, Derived is not automatically a friend and vice versa.
    "You've changed. You are not the person I used to know. I don't like you anymore."

    More: https://en.wikipedia.org/wiki/Friend_class

Monday, January 11, 2016

Trying SFGUI with pre-built library.

AHK SHORTCUT: [sfgui]
//SFGUI SETTINGS in CODE::BLOCKS:
//-----------------------------------------------------------------------------+
//  /Compiler settings\_______________                                         |
//  /#defines\________________________                                         |
//  SFGUI_STATIC                                                               |
//                                                                             |
//  /Linker settings\_________________                                         |
//  /Link libraries\__________________                                         |
//  libsfgui-s.a                                                               |
//                                                                             -
//  /Search directories\______________
//  /Compiler\________________________
//  C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include
//                                                                             -
//  /Search directories\______________                                         |
//  /Linker\__________________________                                         |
//  C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib    |
//-----------------------------------------------------------------------------+

//SFML SETTTINGS in CODE::BLOCKS: (Version 2.3 of SFML)
//You must also specify these settings since SFGUI is built on top of SFML:
//THE SETTINGS ARE VERY DIFFERENT DEPENDING ON WHAT VERSION OF SFML YOU USE!!!
//CONSULT THE CORRECT TUTORIAL FOR SETUP ON SFML'S SITE IF NOT USING 2.3
//-----------------------------------------------------------------------------+
//  /Compiler settings\_______________                                         |
//  /#defines\________________________                                         |
//  GLEW_STATIC                                                                |
//  SFML_STATIC                                                                |
//  UNICODE                                                                    |
//                                                                             |
//  /Linker settings\_________________                                         |
//  /Link libraries\__________________                                         |
//  sfml-graphics-s                                                            |
//  sfml-window-s                                                              |
//  sfml-network-s                                                             |
//  sfml-system-s                                                              |
//  winmm                                                                      |
//  freetype                                                                   |
//  ws2_32                                                                     |
//  gdi32                                                                      |
//  opengl32                                                                   |
//  jpeg                                                                       |
//                                                                             |
//  /Search directories\______________                                         |
//  /Compiler\________________________                                         |
//  SFML-2.3.2\GCC_TDM_SJLJ_32BIT\include                                      |
//                                                                             |
//  /Search directories\______________                                         |
//  /Linker\__________________________                                         |
//  SFML-2.3.2\GCC_TDM_SJLJ_32BIT\lib                                          |
//-----------------------------------------------------------------------------+

Results:
||=== Build: Release in SFGUI_TRY01 (compiler: GNU GCC With MinGW-w64 Debugger JMIM) ===|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Adjustment.hpp|19|error: looser throw specifier for 'virtual sfg::Adjustment::~Adjustment()'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Object.hpp|23|error:   overriding 'virtual sfg::Object::~Object() noexcept (true)'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Widget.hpp|43|error: looser throw specifier for 'virtual sfg::Widget::~Widget()'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Object.hpp|23|error:   overriding 'virtual sfg::Object::~Object() noexcept (true)'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Alignment.hpp|12|error: looser throw specifier for 'virtual sfg::Alignment::~Alignment()'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Misc.hpp|16|error:   overriding 'virtual sfg::Misc::~Misc() noexcept (true)'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Frame.hpp|13|error: looser throw specifier for 'virtual sfg::Frame::~Frame()'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Misc.hpp|16|error:   overriding 'virtual sfg::Misc::~Misc() noexcept (true)'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Image.hpp|13|error: looser throw specifier for 'virtual sfg::Image::~Image()'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Misc.hpp|16|error:   overriding 'virtual sfg::Misc::~Misc() noexcept (true)'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Label.hpp|13|error: looser throw specifier for 'virtual sfg::Label::~Label()'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\include\SFGUI\Misc.hpp|16|error:   overriding 'virtual sfg::Misc::~Misc() noexcept (true)'|
||=== Build failed: 12 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

Fix: Switch to compiler version 4.8.1
The compiler that comes with code::blocks has some type of error in it. See picture above.

And.... Back to the undefined reference errors I had in last post
when I tried to build SFGUI myself with cmake.
Actually, the cmake went alright after some troubleshooting.
But couldn't fix the errors when I ran mingw-make on the files
generated by cmake.

||=== Build: Release in SFGUI_TRY01 (compiler: GNU GCC With MinGW-w64 Debugger JMIM) ===|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(SFGUI.cpp.obj):SFGUI.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(SFGUI.cpp.obj):SFGUI.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(SFGUI.cpp.obj):SFGUI.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(Context.cpp.obj):Context.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5Color5WhiteE'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5Color5BlackE'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5Color5WhiteE'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5Color5BlackE'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5Color5WhiteE'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_imp___ZN2sf5Color5WhiteE'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| more undefined references to `_Unwind_SjLj_Resume' follow|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
C:\DEV\SDK\GAME_DEV\SFGUI\OFFICIAL_COMPILATIONS\TDM\SFGUI-TDM481x32\lib\libsfgui-s.a(BREW.cpp.obj):BREW.cpp:(.text$_ZN3sfg6Engine11SetPropertyIN2sf5ColorEEEbRKSsS5_RKT_[__ZN3sfg6Engine11SetPropertyIN2sf5ColorEEEbRKSsS5_RKT_]+0x24)||undefined reference to `__gxx_personality_sj0'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 5 second(s)) ===|

I really don't want to have "not made here" syndrome.
But it might be best to code my own UI on top of SFML...
Since I can get SFML working...





Have the UI run on a different EXE file?

https://en.wikipedia.org/wiki/Inter-process_communication

By putting the exe for the UI in another program that communicates with game, you
would not have to worry about different error handling systems being used for the
UI vs the rendering.

Sunday, January 10, 2016

SFGUI How do I CMAKE?

So far, I've never been able to successfully use CMAKE.
I tried it with SFML and now SFGUI.
And I put in a lot of time trying to get it to work.

Feels kind of hackish to depend on pre-built builds of these libraries if that isn't the way it is
supposed to be done.

But, here are builds of SFGUI that I need:
https://www.nightlybuilds.ch/compiler/show/10/TDM-481-32/

SFGUI CMAKE trouble shoot

When using CMake, remove C:\DEV\PROG\Git\bin from path variable.
Because it contains sh.exe, and it messes up setup.

//ERROR:
CMake Error at cmake/Modules/FindSFML.cmake:306 (message):
  Could NOT find SFML (missing: SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY
  SFML_SYSTEM_LIBRARY)
Call Stack (most recent call first):
  CMakeLists.txt:21 (find_package)

SOLUTION TO TRY: Environment variable setting:
SET:
SFML_ROOT     == C:\DEV\SDK\GAME_DEV\SFML\SOURCES\SFML-2.3.2\src\SFML
SFML_INCLUDE_DIR == C:\DEV\SDK\GAME_DEV\SFML\SOURCES\SFML-2.3.2\include
SFML_GRAPHICS_LIBRARY == C:\DEV\SDK\GAME_DEV\SFML\SOURCES\SFML-2.3.2\src\SFML\Graphics
SFML_WINDOW_LIBRARY   == C:\DEV\SDK\GAME_DEV\SFML\SOURCES\SFML-2.3.2\src\SFML\Window
SFML_SYSTEM_LIBRARY   == C:\DEV\SDK\GAME_DEV\SFML\SOURCES\SFML-2.3.2\src\SFML\System
//Maybe GRAPHICS,WINDOW,SYSTEM are relative paths to SFML_ROOT?

We are getting closer. Looks like freetype dependency is missing... I never recall having to setup freetype
when getting SFML to work. However, I did specify it in the build options for SFML and it just...
Magically worked.
Here is screen shot of my SFML linker settings. Notice the freetype.


Found freetype in SFML source folder here:
C:\DEV\SDK\GAME_DEV\SFML\SOURCES\SFML-2.3.2\extlibs\libs-msvc\x64

But... These are .lib files,  not .a files... I am worried.
.lib == windows
.a   == linux
From my understanding.Well, give it a shot.




CLOSER! But for some reason:
SFML_GRAPHICS_LIBRARY
SFML_WINDOW_LIBRARY
SFML_SYSTEM_LIBRARY
Are missing?? When I already set the environment variables for those.
And I can successfully echo it in the command prompt via:
$ echo %SFML_GRAPHICS_LIBRARY%
AH!
This post: http://sfgui.sfml-dev.de/forum/topic256-sfgui-doesnt-seem-to-work-with-sfml-21.html
Makes mention of the "advanced" tab. For some reason the flags I specified on command line were not picked up by CMAKE.

 Not sure what to do about the DEBUG libraries, since I don't have them. But hopefully I can omit them and be alright.
After hitting "GENERATE". I get lots of errors like this:
I think maybe I need to point to the sub-folder that contains the .h and .cpp files.
Editing SFML_GRAPHICS_LIBRARY, SFML_WINDOW_LIBRARY, SFML_SYSTEM_LIBRARY
to reflect this.
Actually.. Think those vars are good. Need to research the error:
"Targets may link only to libraries."

  Ah... Instead of using the SOURCE files... I need to use the compiled source.
I have a folder of offical cmake builds of SFML that I can reference for that:
 





Wonder if there is any chance that the freetype.a file exists in same folder.
Because the freetype.lib file scares me.
YES! It is here... Probably should change freetype to this path:
C:\DEV\SDK\GAME_DEV\SFML\OFFICIAL_COMPILATIONS\SFML-2.3.2\GCC_TDM_SJLJ_32BIT\lib\libfreetype.a
Also.. The .jpeg library was pointing to a .dll file in my JAVA installation folder... Yeah... That sounds
sketchy too. Fixed that as well. Here is the screen shot of the fix:


Okay... Configure and Generate...

Wow. Everything worked. At it did it all in a second.
I thought fancy progress bar stuff was going to happen...
Now what??

Time to reference more of the documentation:
http://sfgui.sfml-dev.de/p/docs/guide/installing

I am guessing since I have MinGw path in my environment variables...
CDing into my jmBuild directory and running mingw-make should be enough.
IT IS!


Looks like the end result failed on me however.
Maybe I need to un-reference anything from the SFML sources and
be referencing the build of SFML in my configurations?

Wait... Am I using the correct gcc compiler version?
The version in the code blocks executable directory would be the wrong version.
Code blocks uses 4.7.1 which is not compatible with SFGUI.
I downloaded 4.8.1 of MinGw / gcc from source forge... Check my variables...


Taking guess... CMAKE build type filled in to be == "RELEASE"
https://github.com/BIC-MNI/minc-toolkit/issues/28

error: '_hypot' was not declared in this scope

Getting an error about _hypot not declared in this scope...
Seems to be a GCC bug.
https://github.com/g-truc/glm/issues/300
QUOTE:
This is a GCC issues with no apparent workaround on GLM side. Use -D__NO_INLINE__ or edit math.h as a workaround. Closing.
Thanks,
Christophe
END_QUOTE

Found location of Math.h:
C:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\tr1\Math.h

Looks like it also requires editing of file "cmath" within the same folder.


9Months ago on stack overflow:
http://stackoverflow.com/questions/29450016/o1-2-3-with-std-c1y-11-98-if-cmath-is-included-im-getting-error-hypo
QUOTE:
To avoid any further speculation, and downright bad suggestions such as using #if 0, let me give an authoritative answer, from the perspective of a MinGW project contributor.
Yes, the MinGW.org implementation of include/math.h does have a bug in its inline implementation of hypotf (float, float); the bug is triggered when compiling C++, with the affected header included (as it is when cmath is included), and any compiler option which causes __STRICT_ANSI__ to become defined is specified, (as is the case for those -std=c... options noted by the OP). The appropriate solution is not to occlude part of the math.h file, with #if 0 or otherwise, but to correct the broken inline implementation of hypotf (float, float); simply removing the spurious leading underscore from the inline reference to _hypot (float, float), where its return value is cast to the float return type should suffice.
Alternatively, substituting an equivalent -std=gnu... for -std=c... in the compiler options should circumvent the bug, and may offer a suitable workaround.
FWIW, I'm not entirely happy with MinGW.org's current implementation of hypotl (long double, long double) either; correcting both issues is on my punch list for the next release of the MinGW runtime, but ATM, I have little time to devote to preparing this.
ENDQUOTE:

Wait... Looks like I am looking at the wrong files:
Need to be looking at:
c:\mingw\include\math.h

See the spurious underscore that the MinGW contributor was speaking of? Remove it.

Here is my solution in Math.h
////////////////////////////////////////////////
/* 7.12.7.3  */
//BUGFIX: See stack overflow for hypot error.
//http://stackoverflow.com/questions/29450016/o1-2-3-with-std-c1y-11-98-if-cmath-is-included-im-getting-error-hypo
extern double __cdecl hypot (double, double); /* in libmoldname.a */
extern float __cdecl hypotf (float, float);
#ifndef __NO_INLINE__
__CRT_INLINE float __cdecl hypotf (float x, float y)
{ return (float)(hypot (x, y)); } //JMIM COMMENT: Fixing bug in MINGW.
#endif
extern long double __cdecl hypotl (long double, long double);
////////////////////////////////////////////////

Now trying to build SFGUI again... Getting these errors:
undefined reference to:
'__gxx_personality_sj0'
'_Unwind_SjLj_Register'
'_Unwind_SjLj_Resume'
'_Unwind_SjLj_Unregister'

 I guess the different libraries were compiled using different types of exception handling.
And this has lead to incompatibilities.
http://stackoverflow.com/questions/7751640/undefined-reference-to-gxx-personality-sj0


 Taking a guess:


Added -lstdc++ to compiler flags... Maybe this will help??
NOPE! Gets to 60 something percent and goes BOOM! On me with lots of errors like last time.








Above screen shot of my second attempt. Think I was just adding the flag wrong!

Weird... Seems to be starting me off from where I left-off...
Rather than starting at zero percent:



It is 9:22PM on Sunday... Might want to pack up soon...

Note: it is "mingw32-make" not "mingw-make" on the command line.
Is there are mingw64-make???
Because I am on a 64bit operating system, compiling 64 bit libraries... Wait... No... SFML is 32bit...
Is SFGUI that I am using 64bit? Could any of that be causing problems?

Still blowing up at 64%.

Trying a lot of stuff from here:
http://stackoverflow.com/questions/11783932/how-to-add-linker-or-compile-flag-in-cmake-file
But still no luck...

More research. Seems beyond me.
http://www.qtforum.org/article/29890/qt-4-6-linking-problem.html

I don't want to have "not made here syndrome". But at this point... Seems like making my own
simple UI library will be easier than this.
I just don't know enough to use Awesomium or SFGUI it seems.

Now 9:55PM.

SFML provides most of what I will need to make a GUI library.
GUI should probably be a distinct library from my game project.


Well, I want a flat file system... But... I will have to think about organization.





SFGUI vs AWESOMIUM

Replacing code::blocks minGW --version: 4.7.1
C:\DEV\PROG\codeBlocksInstalledDir\CodeBlocks\MinGW\bin
with version downloaded using source forge installer:
C:/MinGw/bin

Now when running:
gcc --version
on command line, we get: 4.8.1
Good. Now we can run SFGUI library.

Think this will be better than using awesomium:
1. Want to statically link stuff. Not fan on .exe with tons of .DLL files.
2. Using less libraries == less complexities.

Downside is that I did want to leverage HTML and Javascript to make awesome uis...
But in reality, I just want something that works and looks decent.
Awesomium requires I install SDL as well. So the complexities of getting it up and running
are a bit much for me.

And the Awesomium linux make files...... Cant get working on windows.
But I am using code::blocks and minGW, so I can't use the windows installer version.

Thursday, March 19, 2015

Custom Haxe Libs.

 Not sure what the answer is to get custom library code to work...
I just want to write a class...
But I think the clue lays in downloading haxeflixel and blit5 and looking at the
configuration files in their root directory.

//the clue is probably here:
 ///include.xml for blit5 library
//http://yal.cc/introducing-openfl-bitfive/


   
   

I just want to make a damn class Haxe


I just want to make a class and import it into my project.
It has been over an hour of trouble shooting.

What I know:
1. Typical AS3 package conventions are not conventions in haxe, but rather rules.
To keep safe, keep all folders using only lowercase letters a-z.
All class names like MyClass.hx MUST start with capital letter.

Bad package structure:
MY_LIB_ROOT.GAME_LIB.utils.math.FloorUtil;
MY_LIB_ROOT.DECOUPLED_LIB.utils.math.SomeClass;

Good package structure:
mylib.gamelib.utils.math.FloorUtil;
mylib.decoupledlib.utils.math.SomeClass;

There seems to be some XML configuration that needs to happen as well...
As simply going into the project properties and adding "mylib" to your classpath
will not work.

The IDE will recognize it. But the compiler will not.
Something about a config file overriding whatever you do in those areas of the IDE.

So...
I know you CANNOT use the IDE to configure haxe projects...
But what I exactly need to do, I am not sure.

I think it has to do with haxelib keywork inside of application.xml
And also having configuration files inside the root folder of your custom library folders.

Fuck this.
I don't want to deal with this kind of bullshit.
Haxe seems like a really good idea... But maybe it is time to learn straight c++?
And cut myself off from all these tech stack problems.

I mean, sure, I would still have a tech stack issue.
But lets not forget that haxe is built with C++ and C.

In the end... There is no magic tool if you have a very specific vision...

I need to think on this.

-John Mark

My Haxe Classes Not Found


Trying to figure out why I can't make my own class and import it in haxe.
So far I've found out this:

1. dont use upper cases, underscores, or numbers in your package folder names.
2. Possible that .hx file MUST start with a capital letter.

Basically:
The parsing of packages is kind of weird, and you need to keep everything super simple...
Even with all of this... I Still don't have my stuff working just yet...
Will keep working on this, and cut/paste the links I've visited here.


//This is where I learned about the capitalization thing:
http://stackoverflow.com/questions/27471026/class-not-found-exception-when-importing-a-class-haxe-with-openfl-flixel-lib

//A simple class definition example:
http://old.haxe.org/ref/oop

//About the import statement and resolution order:
http://haxe.org/manual/type-system-import.html


//hmm... a manual add of the library?
//Could definitely be a case of "The IDE knows, but the compiler does not:"
http://stackoverflow.com/questions/27789554/cannot-import-library-on-haxe-flashdevelop
  &lt name="openfl" />
  &gt name="task"/>

//hmm... that solution just led me to the error:
Could not find haxelib "hroot", does it need to be installed?

...So...I have to install libraries as well as include/import them?? WTF.

Hmm.. I remember something about adding your classes to the compiler options,
rather than to the class paths in haxe. Maybe that will lead me to the answer?
http://old.haxe.org/forum/thread/3395#nabble-td7047303

Maybe user classpath in the haxe context of the compiler options?
But I was told not to do that... That global class paths are a bad idea...
Hmm... Whatever...
I don't care about bad conventions right now.
Something working with a hack is better than nothing working with a "best" practice.

So, I think the problem is "compiler cant find my class haxe"
So, searching for that. Still having trouble. It has been about an hour of trouble shooting now.

Haxe seems like a really good idea.
But it is this kind of trouble shooting that makes me wonder if this is a stable platform that
will be around for a while.

Error: Could not find haxelib "hroot", does it need to be installed?

Hmm... looks like you may have to include a .json file at the root of your library?
http://old.haxe.org/doc/haxelib/using_haxelib

//On: "you can't make good games in haxe" and blit5.
http://yal.cc/introducing-openfl-bitfive/
http://yal.cc/answering-you-cant-make-good-html5-games-in-haxe/

...Still can't find answer...
Maybe I should just give up and go to SDL and C++ and forget about all of the tech stack confusion of mobile? You know... Instead of focus on making a game on all of these different platforms... Just focus on making a good game for ONE platform?

Embed Assets in OpenFL NME Haxe






 In summary:
Inside file: main.hx:
/////////////////////////////////////////////////////////////////////////
import openfl.Assets;
Assets.getBitmapData("assets/img/TEST.png");
/////////////////////////////////////////////////////////////////////////

Inside file: application.xml:
/////////////////////////////////////////////////////////////////////////
< assets path="assets/img" include="*" / >
/////////////////////////////////////////////////////////////////////////
the &lt and &gt is supposed to be less than and greater than symbols...
But the HTML editor wont let me escape them when I go into the source...



----------------------- Rants an other information below. ---------------------------------------
Found the answer.
Kind of angry at the fact that... What was lacking was an import.
What the hell?!

Maybe I am just a complete idiot.
But how about people start remembering to include the damn import statements with
their code examples!?

Answer here:
http://stackoverflow.com/questions/17078148/embeding-and-reading-image-assets-when-deploying-to-windows

Extra notes:
This looks interesting:
 embed="true" path="Assets" rename="assets" include="*" exclude="openfl.svg" />

Source:
http://stackoverflow.com/questions/21660069/how-to-embed-an-image-in-windows-target

Wednesday, March 18, 2015

: Unknown identifier : Assets Haxe OpenFL

Having trouble with the global assets path in HAXE 3.0 / OPENFL.

Storing links here:
http://stackoverflow.com/questions/17078148/embeding-and-reading-image-assets-when-deploying-to-windows

Problem:
Getting message: : Unknown identifier : Assets

Instructions in openfl-readme.txt say:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Assets

    Place all your images, sounds, fonts in /assets and access them in your code using the
    global Assets class which abstracts assets management for all platforms:
   
        var img = new Bitmap(Assets.getBitmapData("assets/my-image.png"));
        addChild(img);
   
    Tutorials:
    https://github.com/openfl/openfl/wiki/Get-Started
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

http://www.haxenme.org/
...Is... Parked?
Okay. One dead lead.


Mention of a .hxcpp_config.xml
File that needs to be configured. But only shows up when you target C++.
What is the C++ target? NEKO I am guessing?
http://www.openfl.org/archive/community/programming-haxe/first-time-with-nme-problems-compiling/


More in the openfl-readme.txt:
- on mobile, Bitmap blitting is NOT performant,
    - use spritesheets and Tilesheet.drawTiles for optimal rendering performance.



"performant", never heard that word.

Okay... Need to pack up.
I'd like to make a simple Haxe App.
Because Haxe seems like an easier to work with tech stack than Android Studio.
Though I do like google and what they do.

-John Mark

Sunday, March 15, 2015

How to use std::logic_error for custom errors c++


If you are NOT using namespace std, it is a bit tricky:
//begin c++ file:
#include
int main()

{
      throw std::logic_error("This is an error");
}



Tricky things to note:
1. We are NOT using the 'new' keyword here.
2. logic_error is in the std namespace... yet will not be recognized unless you #include
I find this weird because you don't need to #include if you are using namespace std.
However, using namespace std is a bad idea because of all the names it imports into the global namespace.

I rather like to be more specific with which names/tokens I want to use in my code.
For example:
using std::string
So I don't have to write std::string everywhere.

error: conversion from ‘std::vector<std::basic_string<char> >*’ to non-scalar type ‘std::vector<std::basic_string<char> >’ requested

Here is a post that helps with that on stack overflow:
http://stackoverflow.com/questions/13985290/filling-a-vector-of-strings

So today I've been doing simple code-eval problems using C++.
I don't know much about C++.

I keep up finding solutions on closed threads on stack overflow that say:

closed as too localized by [name here]

"This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center."

And it makes be wonder...

Hmm... 1877views in 2 years?
I guess that isn't a lot. But how do they define "unlikely to help any future visitors?"
1877/ 2 = 938
938 / 365 = 2.5
So, at least 2 people are stumbling upon this every day.

IDK. I just find it odd that I find most of my solutions on threads that are closed for breaking some kind of rule. I find it hard to think my problems as a total noob are just so unique that I keep stumbling upon useful closed threads. Which makes me question how the site is moderated.



error: ‘logic_error’ is not a member of ‘std’

Closest matching post isn't very close:
https://groups.google.com/forum/#!topic/quickfast_users/vXq5xZH7rqo

/source.cpp: In function ‘int main(int, char**)’:
/source.cpp:52:23: error: ‘logic_error’ is not a member of ‘std’
                 throw std::logic_error("woah buddy");


Don't understand... Because I have the same line of code working in some other code of mine.
And all the examples say to write it the way I have:

throw std::logic_error("woah buddy");

Quoting:
http://stackoverflow.com/questions/2924058/confused-about-stdruntime-error-vs-stdlogic-error
"std::logic_error is thrown by a user C++ program logic intentionally. Predicted by a user program."

https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.5/a00537.html
huntch that maybe #using <stdexcept> might help?

YES.
If you are not using namespace std, then you must
put #using in the top of your c++ file to get std::logic_error to work.

Which is weird to me. Because I included "std::" so shouldn't it work without any declarations?
I don't know what I am doing.

But. Trying to code without the "using namespace std" to avoid name collisions and other weird

errors that I hear can happen by importing a whole bunch of things you do not need into the global namespace.

Sunday, March 1, 2015

CodeEval ReadMore: Hardest Easy Problem Ever

I am going to save you the headache of this easy problem that took me about 4 hours to solve:

Here is the description:

READ MORE

CHALLENGE DESCRIPTION:

You are given a text. Write a program which outputs its lines according to the following rules:
  1. If line length is ≤ 55 characters, print it without any changes.
  2. If the line length is > 55 characters, change it as follows:
    1. Trim the line to 40 characters.
    2. If there are spaces ‘ ’ in the resulting string, trim it once again to the last space (the space should be trimmed too).
    3. Add a string ‘... ’ to the end of the resulting string and print it.
Trim did not mean what I thought it meant. To me, trimming is removing white spaces.
Trimming to 40 characters to me would mean... line.substring(0,40); //(JAVA)

I was really confused at why non of the read-more example output stopped in the middle of a word.
Because of a bad example, I couldn't figure out if that was co-incidental or by design.

Example: With the input:
123456789 123456789 123456789 123 Supercalifragilisticexpialidocious
I was pretty sure due to the instructions, the proper output would be something like this:
123456789 123456789 123456789 123 Superc... Read More
But the correct answer is more like:
123456789 123456789 123456789 123   //Notice the absence of the sliced in half "Superc"

 So... What they are actually asking you to do is:
If the line is > 55 characters:
1. Tokenize the line using " " as a delimiter.
2. Build the string back up, stopping before you go over 40 characters.
3. If you get a zero-length string this way, just do line.substring.split(0,40);

I hope this helps someone.
Judging by everything I read on the internet.
I seem to be the only one who couldn't make sense of the instructions.
I really hate problems where the majority of why I can't solve it is because I don't know
what it is asking.

Today definitely re-affirms my grandfather's saying:
"A problem well stated is a problem half solved."

Wednesday, May 14, 2014

NG Testers

I was able to strip out a HTML list of newgrounds testers using "view source" on newgrounds.
It is a huge list... I can't compose all of this information on my own... I need to learn some network programming so that I can submit information to a server and then the server can build the tester info.

Make it so users can submit their own bios if they wish.

Ugh... Need to learn database programming in addition to C++.

Ask dad what I can use to setup a database.

Having UI Trouble - and focus issues.


"A problem well stated is a problem half solved"
I believe this.

Most of the time when I have a hard time programming something, it is because I don't know exactly what I want. Yes, programming is flexible, and you don't want a completely finished "plan" before you start coding.

Because there are unforeseen variables.

But you don't want to code "straight ahead" either.

You might get away with it with SIMPLE things, or things you have a very clear vision of in your head already. Hence why I can code pretty awesome effects straight ahead. Because I am very good with geometry and visualization.

However, my "testers" menu is giving me a hard time...
And I know it is because I haven't decided exactly how it works yet.

So... What are some ways I can get unstuck?

Traditionally, this is how I get unstuck when I don't know how to finish a piece of code:

1. Write placeholder data that the code needs to work with.
It's like, the difference between practicing sauteing with a pan full of beans, and practicing sautaying with just going over the motions with an empty skillet.
In my current situation, I should assemble the JSON file that has all of the tester info within it.

2. PRETEND to use the code in your current project.
Write code calling upon public methods of the class you are writing.
These methods may not exist yet, but just pretend they do.
After writing code PRETENDING to use the unfinished class, you get a better idea
of what functions you still need to write. And what data needs to be inputted and stored within the class. I do this a LOT. This also helps make the code easy to use, since you approached it from a usability standpoint.

3. Draw out the connections. Draw out how everything is connected.

4. Related to 3:
Add comments and diagrams to the already existing code. While you are stumped, why not take time to become very familiar with the code you have already written. This will help you move forward.

I am still feeling quite lazy. Like I am spinning my wheels. I am feeling lazy and uninspired. So I figured the least I could do is document my current problems.

Looking over everything I have written... Writing a testerNameAndInfo.JSON file looks like the
next thing I need to do. I could also include a slot for their EMAIL if they have given me email.

I don't want to do it... But I listened to some TED talks that say, "You'll never feel like doing the things that need to be done."

While I disagree with the NEVER part. I sometimes feel it is necessary to force yourself to work on something that you feel uninspired by...

Though a better solution would be to figure out how to inspire myself.

Or... figure out how to take a break.

You cannot get blood from a stone.

And I still need to make a list of "things I have done today."

Okay... I will check my planner... Then create the .JSON file... Then out of here because I cannot focus.

CMAKE

Note: Need to learn how to use CMAKE.
This will help me setup the game engine that uses SDL.

SDL Debugger errors in visual studio

SDL Debugger errors in visual studio solution:

Cannot find or open the PDB file in Visual Studio C++ 2010


http://stackoverflow.com/questions/12954821/cannot-find-or-open-the-pdb-file-in-visual-studio-c-2010