Recent

Author Topic: How to install internettools ??  (Read 14186 times)

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to install internettools ??
« Reply #15 on: November 03, 2017, 09:44:26 pm »
Add the import/FLRE/src directory to your project or copy the .pas files from there to your project's directory.

Better would perhaps be to add FLRE to your FPC packages as it is a Free Pascal project and not specifically a Lazarus one.

FLRE is not 'installed' by package interrnettools (it was written by BeRo and not by user BeniBela who wrote internettools). Your project is unable to locate the required source-files, hence the error.
« Last Edit: November 03, 2017, 09:48:06 pm by molly »

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: How to install internettools ??
« Reply #16 on: April 04, 2018, 05:28:25 am »
Hi Molly,

Internettools is what I want. I have downloaded the zip file and extracted it.

I don't think I will need it for many projects, but will need it for a few so how do I "Add the import/FLRE/src directory" to the project?

And while on the subject, where is a good place for little units such as these, given it is to be used only in a few applications. I feel the source code area for the current project is not suitable.

Also note, for the current project, I have 2 build modes.

Thanks Bazza






Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to install internettools ??
« Reply #17 on: April 04, 2018, 06:51:07 am »
Internettools is what I want. I have downloaded the zip file and extracted it.
Earlier in this thread it is mentioned (link to wiki available as well) how to install the internettools package to your lazarus installation and how to add this dependency to your current project (e.g. there seems no apparent reason to repeat, unless you experience issues with these instructions)

Quote
I don't think I will need it for many projects, but will need it for a few so how do I "Add the import/FLRE/src directory" to the project?
The easiest way would be to extract the FLRE sources and copy the files from that mentioned directory into the (root) folder of your current project.

Quote
And while on the subject, where is a good place for little units such as these, given it is to be used only in a few applications. I feel the source code area for the current project is not suitable.
For a) testing purposes and b) not using it often it would suffice to just copy the FLRE files to your projects directory.

If you would want to do it in a more sturdy manner then i already mentioned to add FLRE units to your free pascal installation (free pascal, not lazarus).

The easiest solution can be done using one of following two methods
a) copy compiled FLRE units into your free pascal units directory (situated at architecture subdirectory) or
b) add an additional units directory for 3th party units (let say for example they are situated in unitsx, with a subdirectory for every individual 3th party addition). The latter requires you to add the new unitsx unit directory to your units search directory inside your free pascal configuration file (for example -FuX:\Development\pascal\FPC\$FPCVERSION\unitsx\$FPCTARGET\*)

Quote
Also note, for the current project, I have 2 build modes.
Whether that is of influence or not depends on the differences in build mode and/or what it is you desire.

Do you have you Free Pascal units compiled separately using those build modes as well ? if so, then apply the same for the FLRE sources and compile twice, once for each build-mode. In that case you know which subdirectories (for the different builds) to use. If not, then just simply compile the FLRE sources with FPC using default build mode used by Free Pascal (as was done for all the other free pascal packages) and you should be good to go to use those.

Because things can be tricky (make sure to use verbose logging to get better informed where the compiler is looking/searching), feel free to complain in case you experience problems. Make sure to post full log messages in order to be able to locate the culprit so that we're able to pinpoint what's going wrong.

Other approaches are quite possible (and perhaps even easier) but for those i would redirect you to original author of internettools. I have mentioned in the past that i've got no clue as of why this 'solution' (which actually isn't a solution rather a burden for end-user) was chosen and i refuse to fill in the gaps for the original author. He created this mess, so he should fix it  :P

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: How to install internettools ??
« Reply #18 on: April 04, 2018, 09:58:12 am »
Hi Molly,

Thanks for the quick reply.

If you mean
http://wiki.freepascal.org/Lazarus_Packages
then I am struggling, as it is so generic. I did look at that before posting and posted because it is all gobbledy-gook to me.

I tried adding files from Internet tools to project inspector, but got the same error message as others in previous posts.

During a build it asked me if I wanted the package linked to the 4 build modes there (I only use 2), so I accepted the default (all checked). It asked me a similar question a second time, so I accepted the default of all checked. When you don't know, just accept the default.

After the supposed build, again the same error message as others in previous posts.

Copying source files to the projects root I want to absolutely avoid as I store projects in different subdirectories.

> copy compiled FLRE units into your free pascal units directory (situated at architecture subdirectory) or

"situated at architecture subdirectory" ... you have lost me.

Bazza

Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to install internettools ??
« Reply #19 on: April 04, 2018, 10:42:11 am »
Ok, let's start from scratch then, breaking things down in individual steps.

Part 1: install a new package.
1) download internettools zip archive.
2) extract the archive to a location where you (read: lazarus) have enough access rights to be able to read the extracted files.
3) start lazarus, and follow instructions (note the correct paragraph)

This will/should add a new (previously non existing package) internettools to your lazarus list of known packages.

Part 2: Add/install package to your lazarus installation

Now that you've done the previously part, you should be able to add an already existing package to your lazarus installation.

Part 3; Add the package to the list of dependencies of your project. See Reply #8 made by Mike.Cornflake
... You have to add the package internettools to your project.

Lazarus - Project - Project Inspector - second add button (Add other) - Second Tab Sheet (Add new requirement), from the dropdown list, choose InternetTools.

In addition to the above, it seems that when defining use FLRE, there is also the dependency for this package. I suggested to add this package to Free Pascal, to make it more permanent (and also usable when using stand-alone fpc compiler. It is just a suggestion, not a must).

If you look at the FPC installation inside you lazarus directory, you'll (hopefully) notice a path something similar as:
D:\Apps\Development\Lazarus\fpc\3.0.4\units\i386-win32

the part i386-win32 is also named the architecture. This will be named differently when you are targeting another platform, f.e. (cross) compiling your application for the pi would be using the units located in the path like: D:\Apps\Development\Lazarus\fpc\3.0.4\units\arm-linux

If you have used different build-modes for Free pascal then one way to distinguish is to place them inside another directory that explicitly distinguishes between different builds (in order to prevent constant recompilation when changing build-modes). For example my debug compiled units are located at: D:\Apps\Development\Lazarus\fpc\3.0.4\unitsdbg\arm-linux

That hopefully answers your questions related to architecture and build modes. if not then feel free to ask (*) :)

(*) In case this is magic to your ears, then please forget about it immediately. Because in that case you do not use different build modes for your FPC units/packages and you should not start worrying about that at this point in time.

Part 4: the FLRE units
1) Inside the archive you've downloaded/extracted  is a directory named import/FLRE/src
2) copy these files to a location where you are able to compile them with plain FPC compiler (or use lazarus to open the files and compile them).
3) copy the compiled units into D:\Apps\Development\Lazarus\fpc\3.0.4\units\i386-win32\FLRE (replace the used path in this example with the one used on your system and take note of the architecture that you are using. It would have to match yours).

That should work for you to have a more permanents installation of the FLRE package.

With all these steps you should now be able to open up your project (or start a new one), add the internettools dependency to your project and start using the internettools package. Don't forget to set the internettools parameters correctly before compiling/building your project. e.g. explicitly setting use FLRE define if that is what you wish for the package to use (same as for other options available in the internettools package)

In case of errors, please state which part, which number and what error message you receive and try to post a verbose log (or better yet, try to read the verbose log yourself and see what the compiler actually tries to do). These logs can be very long, so you could cut some stuff away, but take note of parts where it tries to search for the (missing) units.
« Last Edit: April 04, 2018, 10:45:57 am by molly »

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: How to install internettools ??
« Reply #20 on: April 04, 2018, 11:52:04 am »
Hi Molly,

Thanks it worked. Still only half way through your post though. Will read and digest the rest. I did have some compile errors, but worked my way through them (getting lots of experience).

While I was waiting to get internettools compiled I developed the rest of the scraping code, and the results with the tools working are as expected, so the scraping works.

Many thanks,

Bazza
Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

 

TinyPortal © 2005-2018