Search ProofOfProgress Blog
Tuesday, June 28, 2016
LendingClub.com Account number confirmation does not match.
Saturday, May 7, 2016
TSQL Can be done on stack overflow?
Friday, April 22, 2016
Having trouble invoking static methods in VB.net
Static Methods. AKA: "shared" in vb.net termonology. Here is the paste bin: http://pastebin.com/RC9p74sE
Update: I was being stupid. The static methods were throwing an error because I was writing the statements within the class, but NOT within a function. Fix here:http://pastebin.com/2MsCzaMm
CodeEval VB.Net Sample Code Bug Fix
Reason: The sample code for VB.NET has a typo in it. GetCommandLneArgs should be: GetCommandLineArgs
Module Challenge Sub Main() Dim test As String Using fileStream As New System.IO.StreamReader(System.Environment.GetCommandLneArgs()(1)) Do Until fileStream.EndOfStream test = fileStream.ReadLine 'test' represents the test case, do something with it ... ... Loop End Using End Sub End Module
Thursday, April 7, 2016
Entity Data Model Wizard Shortcut
Tuesday, April 5, 2016
Get Class Of Active Window AHK
So, I was reading all through the documentation looking for a: WinGetActiveClass Since there is a WinGetTitle And a WinGetClass Turns out: WinGetClass's behavior IS to get the class of the active window. This sample code will display the class name of the active window when you press the enter key: enter:: { ;theClass = class of active window. WinGetClass, theClass, A msgBox %theClass% }
Friday, March 25, 2016
Friday, March 18, 2016
Close Properties Panel Shortcut Visual Studio
Close Solution Explorer Shortcut Visual Studio
Close ToolBox Visual Studio
Monday, March 14, 2016
Stood Vector
Tuesday, March 1, 2016
Delete Character
Monday, February 29, 2016
Enforce classes have same static method c++
All my classes must have a method called unitTest in DEBUG mode. This is because I don't want my test code in a separate library.
Separation of concerns is nice and all. But I think that separation also makes it more likely that your test library code will decay.
This might be what I need: http://stackoverflow.com/questions/9346076/static-template-functions-in-a-class
Basically, extend from a header-only class that defines no implementation. And have the function within that class be templated.
Something like:
public: template< typename T> static double foo( vectorarr );
In the header, without any implementation.
Can you extend from a class with no implementation? I bet you can. Need to look into that.
Maybe I need a "pure virtual function"? https://blogs.msdn.microsoft.com/oldnewthing/20131011-00/?p=2953
But that specifies type... Do I need a "pure virtual template function"? That sounds fancy and over complicated.
Yes, you can. http://stackoverflow.com/questions/8919566/are-pure-virtual-methods-allowed-within-a-template-class
Monday, February 15, 2016
Ownership of pointers in c++ and borrow boxes
Sunday, February 14, 2016
Overload = operator c++
Are structs initialized to zero?
object lifetime of structs c++
myStruct getStruct(){ myStruct val; return val; }Will the instance of myStruct be killed immediately after leaving the function scope? Turns out, this works with structs. Pretty sure it would not work if it were a class. Also strange is that it seems like... All the members of a struct are initialized? Rather than having whatever random data was there before hand? Or maybe I am just lucky... Might want to explicitly init values by specifying a constructor.
+= operator overloading a struct
deathNote operator_-(const deathNote &a){ this->apples = a.apples + this->apples; this->chocolate = a.chocolate + this->chocolate; this->paper = a.paper + this->paper; return (*this); }
operator+ must take zero or one argument
struct deathNote{ uint32_t apples; uint32_t chocolate; uint32_t pages; deathNote operator+(const deathNote &a, const deathNote &b){ deathNote ret_val; ret_val.apples = a.apples + b.apples; ret_val.chocolate = a.chocolate + b.chocolate; ret_val.pages = a.pages + b.pages; return ret_val; } };//struct //ERROR: operator+ must take zero or one argument. //The fix? One parameter is implied via the "this" pointer. //WORKING OVERLOADED OPERATOR: deathNote operator+(const deathNote &a){ deathNote ret_val; ret_val.apples = a.apples + this -> apples; ret_val.chocolate = a.chocolate + this -> chocolate; ret_val.pages = a.pages + this -> pages; return ret_val; }
Saturday, February 13, 2016
Use structs when 16 bytes or under
✓ CONSIDER defining a struct instead of a class if instances of the type are small and commonly short-lived or are commonly embedded in other objects.
X AVOID defining a struct unless the type has all of the following characteristics:
- It logically represents a single value, similar to primitive types (int, double, etc.).
- It has an instance size under 16 bytes.
- It is immutable.
- It will not have to be boxed frequently.
I think I'll name my structs with lowercase letters.
Constant class... But things like "float", "unit" and other built-in primitive value types
have lowercase letters. So I'll name my structs with lowercase letters.
How much is 16 byes?
1BYTE == 8BITS.
ARGB pixel = 32bits. Each channel is 8Bits. AKA: 32 bit color is 4Byte color.
How many pixels in 16 bytes?
Four. (4+4+4+4 == 16)
So, think of a struct as 4 pixels worth of data or less.
Invalid use of destructor foo as type
Bad Code:
~MyClass::MyClass(){
}
Good Code:
MyClass::~MyClass(){
}
Friday, February 12, 2016
Also useful for memory leak detection in C++
Though mentions having to "redefine" the "new" keyword if using
c++'s new keyword to construct new instances of objects.
Com Vs Crt Leaks
http://www.codeproject.com/Articles/3134/Memory-Leak-and-Exception-Trace-CRT-and-COM-Leaks
Thursday, February 11, 2016
Memory Leak Detection, pooling out of scope.
Decided that in my memory leak detection code, I should not try to support
LIVE and IDLE object pools for every single class.
That link together the instances using a linked-list base class.
Why:
1. Could get very complicated very quickly.
2. With inheritence, does the base class, or the superclass get to own the object
and have it within it's static linked list?
3. OUT OF SCOPE. This is memory management. We only want to do memory leak detection.
New approach:
All objects inherit from a linked list base class.
There is a MASTER two-way linked list in the C++ project when in debug mode.
If an object from my project exists, it is part of this linked list.
(Only if they are classes, structs do not follow this rule)
Between:
1. Using object_ids and parent_ids to confirm object has only one owner.
2. Using MyClass::kill( *instance) methods to manage deletion
3. Using kill_hash checksums to confirm the objects you think were destroyed were destroyed.
4. Using one master linked-list so we can check for orphaned pointers.
I say we have pretty good measures to prevent memory leaks.
Just need to make sure that, when memory leaks are found, we can control the situation.
AKA: I'd rather not find my memory leak by accessing a null pointer.
I'd like to find it by having my memory leak detection code find out about it's existence
in a less hazardous way.
Mem Leak detection Part 2
uint MyClass::deleteInstance(MyClass* c){
uint deletion_confirmation_hash = 0;
//Does object OWN it's pointers?
if(owns){
if(owns != 3){ throw("we may own more or less pointers than this.")}
uint num1 = OtherClass::deleteInstance(c->ptr01); // 1 //
uint num2 = OtherClass::deleteInstance(c->ptr02); // 2 //
uint num3 = OtherClass::deleteInstance(c->ptr03); // 3 //
deletion_confirmation_hash+=(num1+num2+num3);
}
deletion_confirmation_hash += c.getObjectID();
delete c;
return (deletion_confirmation_hash);
}
Homebrew memory leak detection.
NOT memory management. Because that would have to exist in both debug and release.
And memory managers would defeat the purpose of using a high-performance language like C++.
//For a class that has 3 pointers under it's ownership.
//Here is how we could delete it, and get a basic order-independent
//(combination based) hash to confirm the objects we think were deleted
//are deleted.
static uint32_t MyClass::deleteInstance(MyClass* c){
uint num1 = OtherClass::deleteInstance(c->ptr01);
uint num2 = OtherClass::deleteInstance(c->ptr02);
uint num3 = OtherClass::deleteInstance(c->ptr03);
uint finalNum = c.getObjectID();
delete c;
return (num1+num2+num3+finalNum);
}
Tuesday, January 19, 2016
Forward Declarations may be needed.
Remembering how to remember friend class C++
- Friendships are not symmetric – If class
A
is a friend of classB
, classB
is not automatically a friend of classA
.
"I thought you were my friend, but the feelings were not mutual." - Friendships are not transitive – If class
A
is a friend of classB
, and classB
is a friend of classC
, classA
is not automatically a friend of classC
.
"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 classDerived
and vice versa; equally ifBase
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.
//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?
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?
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
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.
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%
This post: http://sfgui.sfml-dev.de/forum/topic256-sfgui-doesnt-seem-to-work-with-sfml-21.html
After hitting "GENERATE". I get lots of errors like this:
Editing SFML_GRAPHICS_LIBRARY, SFML_WINDOW_LIBRARY, SFML_SYSTEM_LIBRARY
to reflect this.
"Targets may link only to libraries."
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:
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
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.
Blog Archive
-
▼
2016
(33)
-
►
February
(14)
- Enforce classes have same static method c++
- Ownership of pointers in c++ and borrow boxes
- Overload = operator c++
- Are structs initialized to zero?
- object lifetime of structs c++
- += operator overloading a struct
- operator+ must take zero or one argument
- Use structs when 16 bytes or under
- Invalid use of destructor foo as type
- Also useful for memory leak detection in C++
- Com Vs Crt Leaks
- Memory Leak Detection, pooling out of scope.
- Mem Leak detection Part 2
- Homebrew memory leak detection.
-
►
February
(14)
My Blog List
-
Goodbye to All That (2014)9 years ago
-
Pen To Paper12 years ago
-
Moving!12 years ago
-
-
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:
#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 ofhypotf (float, float)
; the bug is triggered when compiling C++, with the affected header included (as it is whencmath
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 themath.h
file, with#if 0
or otherwise, but to correct the broken inline implementation ofhypotf (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);
////////////////////////////////////////////////