[Lazarus] TMSSQLConnection how to specify the server port?

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri Dec 29 17:28:33 CET 2017


On 2017-12-29 14:31, Bo Berglund via Lazarus wrote:
> But I am not used to select installer according to capabilities
> (except for licensed or unlicesnsed etc). So it never dawned on me
> that it would also only build 64 bit applications....
> 
> Now that I have the win64 version installed how do I go about making
> it possible to build for both 32 and 64 bit environments?

In my experience, there are two methods to achieve this.

1) Use the win32 FPC compiler and the win64 FPC cross-compiler. In
   Lazarus you set up fpc.exe as your compiler. In the Project's Compiler
   Settings, it will pass a -T command line parameter to fpc.exe which
   in turn will execute the correct ppc*.exe executable to generate
   the appropriate binary for your project.

2) This option doesn't use a cross-compiler. Instead I start off with
   64-bit versions of FPC and Lazarus. I normally use FreeBSD for
   development, but the same configuration can be applied to Windows or
   Linux. I install FPC is a specific directory layout so it supports
   multiple targets with one fpc.cfg file. For example:

     c:\fpc-3.0.4
          \x86_64-win64
             \bin
             \lib
             \share
          \i386-win32
             \bin
             \lib
             \share


The fpc.cfg search paths and such with then use the built-in macros to 
resolve the correct path location. For example, my FreeBSD system have 
lines as follows:

 
-Fu/data/devel/fpc-$fpcversion/$fpctarget/lib/fpc/$fpcversion/units/$fpctarget


Adapt the fpc.cfg for windows to match your FPC install hierarchy and 
appropriate $fpc* macros.

In Lazarus IDE I then use "IDE Options -> Environment -> FPC" to select 
between the FPC compilers and related FPC Source directories.

The same can be done (actually even easier) in MSEide because MSEide has 
better IDE/Project macro support. So in MSEide I have different keyboard 
shortcuts to compile my projects for different targets. I don't have to 
toggle any global settings.


> In my Delphi XE5 environment I can do this easily in the project
> options where the target can be switched for each configuration.

Delphi simply hides much of the underlying configuration from the 
developer - after all, I hope that is why you pay them so much. Delphi 
ships with different compilers (depending on the version you bought 
(Starter, Pro, Enterprise, Studio, Architect, add-on packages 
installed). Depending on the version, in then enables you to specify new 
targets in the Project Options dialog, which in turn uses different 
search paths and compilers.



CodeTyphon is a spin-off of Lazarus, which ships with many 
cross-compilers all ready for you out of the box. They did some 
excellent work in simplifying that process and getting later updates. 
This is closer to the experience you get with Delphi. There are some 
other stuff I don't like or agree with about that project, but that is a 
personal opinion and another matter.


Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list