Lazreport and cgi problem lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- xinyiman · 2015-04-25 06:56 Hello guys, I'm creating a cgi with freespider / lazarus and everything seems to work. Then when I go to insert the generation of a report with LazReport instead does not compile anymore. Tells me: / usr / bin / ld: warning: link.res contains output sections; Perhaps you have forgotten -T The problem are the two units: LR_Class, LR_DBSet How do I fix it? thanks a lot ---------------------------------------------------------------------- motaz · 2015-04-25 07:56 The question is: why do you generate GUI report in web application? Could you please explain your project function ---------------------------------------------------------------------- xinyiman · 2015-04-25 08:03 no gui report but pdf report with lazreport and pdfexport addons. other idea?! ---------------------------------------------------------------------- motaz · 2015-04-25 08:06 Ok, I got it Add interfaces unit in the main project file : Code: [Select] Uses {$IFDEF UNIX}{$IFDEF UseCThreads}   CThreads, {$ENDIF}{$ENDIF} interfaces,  main, form, fortes324forlaz   { add your units here }; begin   DataModule1:= TDataModule1.Create(nil) end. ---------------------------------------------------------------------- xinyiman · 2015-04-25 11:51 Error in browser Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. ---------------------------------------------------------------------- xinyiman · 2015-04-26 08:32 I can not understand. I do a simple report generator pdf I print hello world on a report LazReport and then exports it to pdf? Or with any work other stumento. thanks ---------------------------------------------------------------------- motaz · 2015-04-26 11:17 Please test your CGI executable without apache by typing: yourappname -con ---------------------------------------------------------------------- Graeme · 2015-04-27 09:14 LazReport depends on LCL, which in turn depends on a GUI toolkit and requires a graphical desktop. So when running CGI apps (which are basically a console program - no GUI), the LazReport program will fail because it can't hook into the graphical desktop environment. This is a bad design of LazReport, because generating reports and PDF's really shouldn't require a GUI at all. The engine part should have been 100% non-GUI, and the visual report designer should have been the only GUI part in a separated package. Unfortunately this was never done. A better solution would be to use a pure report or PDF engine that doesn't require LCL or any other GUI. fpGUI includes such a PDF report engine, and soon (no exact timeframe yet) FPC will include such a report engine too. Work-Around In the mean time you will have to compile your CGI+LazReport application with the LCL-NoGUI interface as a work-around. It fakes some GUI desktop features to get around the problem, but still a terrible work-around. Hope that helps.