TMySQL50Connection in apache module (fpWeb) lazarus / 16-Databases ---------------------------------------------------------------------- Max3073 · 2011-08-09 10:36 Hi everybody. I'm developing a simple apache module using fpWeb. Everything works fine... but when I add the TMySQL50Connection to the datamodule... things go wrong: restarting apache I have the following error: "undefined symbol: WSRegisterCustomImageList" Same result if I add "Interfaces" to the uses clause and select "NOGUI" as LCL widget type. While if I use gtk2 as widget type I get the following error: "GTK: cannot open display" Any suggestion? Is there a way to connect to MySQL in a fpWeb apache module? ---------------------------------------------------------------------- Leledumbo · 2011-08-09 23:30 Add LCL as project's dependency ---------------------------------------------------------------------- Max3073 · 2011-08-09 23:48 Do you mean "Project Inspector -> Required packages" ? LCL has been there from the beginning. ---------------------------------------------------------------------- Leledumbo · 2011-08-10 00:25 Hmm... I can't think of anything else. Those WSxxx functions should be bound to chosen widgettype, even NoGUI implements all of them. Do you only get one undefined symbol? ---------------------------------------------------------------------- Max3073 · 2011-08-10 08:15 Yes! Just a one line error: undefined symbol: WSRegisterCustomImageList this is the result of my tests: an apache module is a piece of code where no Grapical User Interface is allowed. After all this makes sense: you do not want a window to pop up on the server every time someone requests a page. I started with a working module. I added the "Dialogs" unit and used the "MessageDlg" function just as test. The result is the same: this is enough to make the error appear: undefined symbol: WSRegisterCustomImageList everything that needs GUI forces this error. Now the problem is that inside the TMySQL50Connection there are hundreds of MessageDlg calls (as an exemple you get a message dialog when you cannot connect to the server). I think this is the cause! How to solve it? Logically there should be 3 ways 1. teaching fpc to deal with this WSRegisterblabla 2. teaching apache to deal with this WSRegisterblabla 3. using something that does not need GUI (I tried to install ZeosLib to see if things are different.... but no way... according to fpc there is an error in the source... this would be another thread) Is it possible that out there NOBODY wrote a module who connects to a db???? ---------------------------------------------------------------------- herux · 2011-08-10 08:39 Open the project file *view source, and try removing sqldb pakage in uses clause ---------------------------------------------------------------------- Max3073 · 2011-08-10 17:48 Oh my! It was too easy! IT WORKS! Thank you herux! (Well many thanks to Leledumbo too)