How do I install powtils?? lazarus / 1-Linux ---------------------------------------------------------------------- wpflum · 2009-09-15 19:51 I'm trying to get a simple embeded webserver running, I found something called 'aservia' that looks like it will do what I need to do and am trying to get the code to compile.  It keeps asking for 'pwtypes' which appears to be part of the 'powtils' package.  I found the 1.7.1 package/src but I'm at a loss on how to install it to Lazarus so I can use it with aservia.  I can add it to the directory but then other things don't seem to compile so I'm guessing I have to have the full package of powtils installed to get this working.  So can anyone help me with the obvious 'bone headed' mistake I'm making  Just so you know what I'm trying to do in the first place in case  there is a better option, I'm working on a program to serve up an ebook library based on another program called 'Calibre'.  I didn't like the way the original works but I liked the ability to have the program act as a webserver to serve up the library database and files like it does so I want to make a similar program but running the way I like it.    In the original Calibre program all you had to do was enable an option and select what port to server the http on and bingo instant ebook library on the local network. Bill ---------------------------------------------------------------------- Phil · 2009-09-15 19:57 Why don't you try out ExtPascal's embedded Web server option: http://code.google.com/p/extpascal/ Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 14:28 I really hate it when I'm befuddled by just installing the needed software to write the needed software  I'm trying to get the two packages installed that the embeded ExtPascal page indicates but I'm hitting a brick wall in the fact that I'm REALLY new to Lazarus so am not sure WHERE to put the files??   I was able to compile the ExtPascal file but I'm not sure how to go about getting Lazarus to use it??  I've downloaded the indy source but again I'm not sure where to put it or exactly how to set up Lazarus to make it use it.  I'm not even into the 'How do I use This' stage yet I'd just like to get it set up and somehow test so I know I have it set up correctly and can start learning how to program in/to it. Help  Bill ---------------------------------------------------------------------- Phil · 2009-09-16 14:57 I assume you were able to complete the First Steps, which is compiling ExtToPascal.dpr and running it to generate the actual ExtPascal wrapper classes. This page is not entirely clear: http://code.google.com/p/extpascal/wiki/WebServer_Embedded I think they're referring to the ExtPascalSamples3.dpr example program, as a way of testing the Indy and WEBSERVER define against ExtPascal. Look under Files for a Lazarus .lpi file that you can use with ExtPascalSamples3.dpr. Also, if you're using 0.96 ExtPascal, take out ExtSql from the uses - this is left over from old version of ExtPascal. Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 15:08 Actually I only got as far as compiling ExtToPascal.  Where is ' ExtJS documentation' that I'm supposed to point it at to make the wrappers? Bill ---------------------------------------------------------------------- wpflum · 2009-09-16 15:20 Scratch the last post I missed the part of downloading the Ext file so I did that and pointed ExtToPascal at it and it worked but I'm not sure where the results were put.  I'll keep at it and get back to you. Bill ---------------------------------------------------------------------- wpflum · 2009-09-16 15:42 Ok, now I'm up to the point after compiling the ExtPascalSamples3, which worked after I removed the extsql like you said, but I don't see the menu item like is described  to add the indy source path? So I need to do the following according to the web page. ---------------------------------------------------------------------- --------------------------------------------- 3. Update Delphi/Lazarus Search Path (menu: Project/Options/Directories/Conditionals on Delphi) to   point Indy sources.  (How??) 4. Add a new define WEBSERVER on Conditional defines: entry (menu: Project/Options/Directories/Conditionals on Delphi). (Again, How??) 5. Build all. (Does this mean Build All Lazarus??) 6. Install ExtJS at folder ext below the folder of ExtPascalSamples.exe. (Huh??) 7. Start ExtPascalSamples. (Now I'm really confused, why would I be starting this??) ---------------------------------------------------------------------- ----------------------------------------------- And where should I be putting these directories?? Right now I have them, Ext, Indy, ExtPascal sitting on my desktop where I complied them. I can't wait till I actually try and use this in my code Bill ---------------------------------------------------------------------- Phil · 2009-09-16 16:29 Download ExtPascalSamples3_embedded.lpi from the Files section of the ExtPascal forums and place this file in the folder with your ExtPascal generated source files (Ext.pas, ExtGlobal.pas, etc.). Open this file in Lazarus, choose Project | Compiler Options and change the Other Unit Files to point to where your Indy files are. Choose Run | Build to compile. The ExtJS JavaScript files are in a folder named ext. Normally this folder is placed in the htdocs folder of the Apache server (for example). Since you won't be using a Web server, copy this folder below your ExtPascal folder or wherever you have the ExtPascalSamples3.exe file. Open browser and enter this: http://localhost/Home Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 17:42 A few steps to the end of the tunnel, whats that light ahead....TRAIN!!!!!!!! Ok, I've placed the three directories in my home directory for lack of a better place at the moment. I put the ext directory in in the ExtPascal directory so I have the following. /home/xxxx/ExtPascal /home/xxxx/ExtPascal/ext /home/xxxx/indy I downloaded the ExtPascalSamples3_embedded.lpi file and put it in the ExtPascal directory. I opened it with Lazarus. I changed the compilier options 'Other Unit Files' to point to /home/xxxx/indy/. Holding my breath I dropped the Run menu down and pressed the 'build' button.... and promptly got a can't find IdCustomHTTPServer.  Found that if I put in each individual directory under the indy directory, Core, Protocols, SuperCore and System I got further but now I crash with an 'Error: Identifier not found "GetLastError" '.  Just for giggles I commented out that item and tried again but it stopped at PAddressInfo not found so it looks like I'm missing a path or something. Bill ---------------------------------------------------------------------- Phil · 2009-09-16 17:46 Try using the .lpi without changing the path. It assumes indy is at same level as ExtPascal under a common parent folder. That's what this means: ..\indy\fpc\ Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 18:16 No matter what I do I'm still getting errors. Here is what the Messages are: /home/billp/indy/System/IdCompilerDefines.inc(160,1) Warning: compiler switches aren't supported in // styled comments /home/billp/indy/System/IdCompilerDefines.inc(160,1) Warning: compiler switches aren't supported in // styled comments /home/billp/indy/System/IdGlobal.pas(1601,3) Note: Local variable "LVoid" is assigned but never used /home/billp/indy/System/IdGlobal.pas(1641,15) Warning: lo/hi(dword/qword) returns the upper/lower word/dword /home/billp/indy/System/IdCompilerDefines.inc(160,1) Warning: compiler switches aren't supported in // styled comments /home/billp/indy/System/IdCompilerDefines.inc(160,1) Warning: compiler switches aren't supported in // styled comments /home/billp/indy/System/IdCompilerDefines.inc(160,1) Warning: compiler switches aren't supported in // styled comments /home/billp/indy/System/IdStackLinux.pas(207,21) Error: Identifier not found "GetLastError" /home/billp/indy/System/IdStackLinux.pas(208,19) Error: Identifier not found "SetLastError" /home/billp/indy/System/IdStackLinux.pas(287,26) Error: Identifier not found "PAddressInfo" /home/billp/indy/System/IdStackLinux.pas(287,26) Error: Error in type definition /home/billp/indy/System/IdStackLinux.pas(310,71) Error: Incompatible type for arg no. 4: Got "", expected "PPaddrinfo" /home/billp/indy/System/IdStackLinux.pas(318,54) Error: Illegal qualifier /home/billp/indy/System/IdStackLinux.pas(319,31) Error: Incompatible type for arg no. 1: Got "", expected "Paddrinfo" /home/billp/indy/System/IdStackLinux.pas(393,113) Error: Incompatible type for arg no. 5: Got "sockaddr", expected "PSockAddr" /home/billp/indy/System/IdStackLinux.pas(427,32) Error: Identifier not found "GetLastError" /home/billp/indy/System/IdStackLinux.pas(575,26) Error: Identifier not found "PAddressInfo" /home/billp/indy/System/IdStackLinux.pas(575,26) Error: Error in type definition /home/billp/indy/System/IdStackLinux.pas(585,70) Error: Incompatible type for arg no. 4: Got "", expected "PPaddrinfo" /home/billp/indy/System/IdStackLinux.pas(593,29) Error: Illegal qualifier /home/billp/indy/System/IdStackLinux.pas(594,31) Error: Incompatible type for arg no. 1: Got "", expected "Paddrinfo" /home/billp/indy/System/IdStackLinux.pas(993) Fatal: There were 14 errors compiling module, stopping So I'm guessing whatever I'm missing is not in the indy directory.  What I can't figure out is why the lpi file defaults the other directory to ../indi/fpc/ ??  I don't have a fpc directory under the indy directory, could I be missing something there? Bill ---------------------------------------------------------------------- Phil · 2009-09-16 18:24 I don't use Linux so I can't help with that. Where did you download indy from? It looks like a different version than what I have. Try to get one of the indy examples compiled before proceeding? Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 18:40 I got the indy code from the ExtPascal web page about embedding.  I'll see if I can fin another version. Bill ---------------------------------------------------------------------- Phil · 2009-09-16 19:04 I think that's pointing to the Delphi version of Indy. Try the "Newer attempt" port from here: http://wiki.lazarus.freepascal.org/Components_and_Code_examples Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 19:27 That's the version I found after you said you had a different version. I compiled it fine but when I tried to compile the ExtPascal program I got another error of a missing something or other. I think I'm gonna call it quits with ExtPascal.  I spent the better part of a day trying to get it to install and have nothing to show for it.  I can't imagine how much of a head ache it will give me trying to code with it  I'll keep looking, I did find a small 200 line c based webserver which if I could convert might be enough for me but I will keep looking. I need something that can work on both windows and linux platforms and unfortunately most of what I've seen, in the small program arena, is based on windows api code. Thanks for your help. Bill ---------------------------------------------------------------------- Phil · 2009-09-16 19:33 It's not ExtPascal so much as that you're struggling with Lazarus. That's a lot to try to tackle all at once. You don't mention your latest error. Really, it only took me about 5 minutes to get the embedded example working. I had never even looked at it before. But I think that's because I'm fairly familiar with Lazarus and I already had Indy on my system and use it for other things so it works. Thanks. -Phil ---------------------------------------------------------------------- wpflum · 2009-09-16 19:36 Could be, maybe I'll try back in a few weeks months.  Bill