OK, it sounds like you're trying to compile a Windows API based program on a Linux machine.
If this is the case then you're running into the fact that Windows API is not cross-platform. You would run into the same error if you tried to compile for Mac, Unix, Android... any system that is not Windows.
You could try converting the code to Qt, SDL, SFML, or one of dozens of cross-platform libraries out there, but windows.h is a no-fly zone. (Technically you could use "Wine" to run windows-compiled code https://en.wikipedia.org/wiki/Wine_(software) )
Edit: I like the improved prompt, it's well worded and provides some information about the original code.
You are not providing enough information. What library are you converting to?
All three libraries that I mention above have interfaces to a GUI, mouse and keyboard (All of which could be a reference to a "ButtonClick") and they are event driven. I know SDL2 uses what it calls a pollevent loop which allows for an input que (events are generally given to you one at a time). Qt tend towards throwing signals out to everything and it's the job of each object to either catch and react to it or just ignore it (Signals and slots method).
I don't remember what SFML uses, but I'd guess it's similar to SDL.
I don't remember an
OnButton2Click(event);
function in the Windows API. It kind of sounds like a framework is involved in the code. Can you provide the original demo code that you are looking at?
I haven't used wxWidgets, but this could be an issue with codeblocks. How did you port this over to the linux machine? Did you just copy the entire project folder, or zip it, or what?
I'm currently thinking that there might be something windows-specific in the *.cbp file or some other issue that is preventing the proper linking of your headers at compile time. Perhaps you have some precompiled objects (*.o files) from previous compile on Windows.
Try creating a new project and add the *.cpp and *.h files into the project manually.
I still do not have any experience in wxWidgets, but something does stand out. The event that you are passing from OnTimer1Trigger() is from a wxTimerEvent, but OnButton2Click() is expecting a wxCommandEvent.
Can you overload OnButton2Click to accept the wxTimerEvent type?
Edit: Actually, the calling function in the prompt is a snippet from the "wxSQLi_417Frame" class, so calling OnButton2Click() is not calling wxSQLite2Frame::OnButton2Click().
Do you have a wxSQLite2Frame object inside of your wxSQLi_417Frame class that you could call?
Double Edit:
I remember asking you to post the original code and that's what you provide in the lower code sample. You said you'd made modifications which could explain some of the confusion in my previous edit. Can we see the new code for OnButton2Click()?
This looks promising. I think you only have to overload OnButton2Click() to take a wxTimerEvent. (Make sure to do that in both the cpp file and the h file.
That or perhaps wxTimerEvent can be cast to a wxCommandEvent. They both inherit from the wxEvent class so it would make sense for casting to work.
Try type-casting first, it would save you time if it works:
If that fails then you would next have to try overloading the function:
1 2 3 4 5
void wxSQLi_417Frame::OnButton2Click(wxTimerEvent& event)
{
// copy and paste all the code from the original function into here.
// Luckily the event itself is never used so there are no conflicts inside the function.
}
[Please, anyone with experience in wxWidgets feel free to step in]