My guess is you are mixing two compiler toolchains together; that can result in weird errors like you got.
Link to how to use code tags https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Edit: The reason I think two tool chains are being used.
C:\Program Files (x86)\CodeBlocks\MinGW\i686-w64-mingw32\lib
"..\..\..\..\..\Program Files\CodeBlocks\mingw32\i686-w64-mingw32\lib\libwinmm.a"
Tim S.
1st warning:
hwnd = CreateWindowEx(NULL, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, nullptr, mod, this);
"cambalinho.h|2949|warning: passing NULL to non-pointer argument 1 of 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)' [-Wconversion-null]|"
1st error:
std::wstring towstring(const std::string& v)
{
std::wstring out(v.size()+1,L'\0');
int size = MultiByteToWideChar(CP_UTF8, 0, v.c_str(), -1, &out[0], out.size());
out.resize(size-1);
return out;
}
"main.cpp|9|error: redefinition of 'std::__cxx11::wstring towstring(const string&)'|"
Please try using this way to do static library usage
$(TARGET_COMPILER_DIR)/i686-w64-mingw32/lib/libmsimg32.a
Instead of doing this way!
"..\..\..\..\..\Program Files\CodeBlocks\mingw32\i686-w64-mingw32\lib\libmsimg32.a"
You need to use *only* a single toolchain!!!!
Tim S.
done!!
now lets go to another error:
a.KeyDown=[](int key, int repeat)
{
if(CombinationKeys({'A','S'},{'W'},{'R','T'}, {'O','P'})==true)
{
a.Text="hello world";
MessageBox(NULL,"hi", "hello",MB_OK);
}
if(key==VK_ESCAPE)
End();
};
'a' it's from 'form' class:
//KeyBoard events:
event(KeyDown, (int *Key, int repeat)) = [](int *Key, int repeat) {;};
from:
#define event(EventName, ... ) std::function<void(__VA_ARGS__ )> EventName
now i get the error here:
a.KeyDown=[](int key, int repeat)
{
if(CombinationKeys({'A','S'},{'W'},{'R','T'}, {'O','P'})==true)
{
a.Text="hello world";
MessageBox(NULL,"hi", "hello",MB_OK);
}
if(key==VK_ESCAPE)
End();
};
"C:\Users\Utilizador\Documents\CodeBlocks\classcontrols\main.cpp|73|error: no match for 'operator=' (operand types are 'std::function<void(int*, int)>' and 'WinMain(HINSTANCE, HINSTANCE, LPSTR, int)::<lambda(int, int)>')|"
what i'm doing wrong?
yes.. now it's fixed:
a.KeyDown=[](int *key, int repeat)
{
if(CombinationKeys({'A','S'},{'W'},{'R','T'}, {'O','P'})==true)
{
a.Text="hello world";
MessageBox(NULL,"hi", "hello",MB_OK);
}
if(*key==VK_ESCAPE)
End();
};
it's a pointer.. that's my error :(
now i have more 2 Warnings:
1)
if (inst->clrBackColor==-1)
"warning: comparison of integer expressions of different signedness: 'color' {aka 'long unsigned int'} and 'int' [-Wsign-compare]|"
i use '-1' for transparent... can i avoid these warning?
2)hwnd = CreateWindowEx(NULL, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, mod, this);
"warning: passing NULL to non-pointer argument 1 of 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)' [-Wconversion-null]|"
i don't know avoid these 2 warnings :(