Compiling x64 in 32-bit Lazarus 1.2.6

Instead of drudging through a million documents that cover every end-case under the sun, here’s a simplified, abridged set of instructions on how to compile x64 applications for windows using Lazarus 1.2.6.  It may also work with future, newer versions of Lazarus.

It is recommended to use the 32-bit IDE and cross compile x64 unless you really need some x64 components to run at design time.  Most components will be x86 compiled, so use the x86 IDE.

1) Install Lazarus 1.2.6 (or later)

2) Install the x64 cross compiler, which has traditionally been included in the folder/page along with the Lazarus IDE but as a separate download.  I’d link you, but I’m sure there will be a newer one by the time you read this.

3) In Project->Options->Config and Target Set

  • Target OS to Win64
  • Target CPU family x86_64
  • Target processor ATHLON64

4) Build and Run.  Debugging support should be available, but it is a tad bit flaky in my initial tests.  Have fun!

0 Replies to “Compiling x64 in 32-bit Lazarus 1.2.6”

  1. What a spectacular guide! I’ve been banging my head against the wall trying to compile x64 in Lazarus 1.2.6. Your point about using the 32-bit IDE and cross compiling x64 was very enlightening indeed. Still, you mention that most components will be x86 compiled. So, what would be the implication if I want to use a component that isn’t?

    1. If a component isn’t x86 compiled, you might run into compatibility issues or extra steps for recompilation in x64. It’s not a deal-breaker, but it can be a bit of a hassle, adding complexity to the process. Depending on the component, you may need to find or build a version specifically for x64.

    2. Totally get the headache, Kaia! Been there, done that. Emily’s right about the potential for extra steps. The complexity totally amps up with components outside the x86 norm. I’d say it’s totally worth looking into whether any third-party components you’re using have x64 support or if the community’s come up with a workaround. Community can be a lifesaver!

    3. Ain’t that the truth, Kaia! This is why we need more straightforward guides like this. When ya hit a wall with a non-x86 component, sometimes you gotta either wait for an update, get your hands dirty with some source code, or hunt down an alternative that’s already x64-friendly. Ain’t always simple, but that’s coding for ya!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.