2

As the title suggests!

I'm trying to get a 64bit dll

Jon
  • 53
  • 2
  • 4
  • Technically there shouldn't be a reason you can compile a 64-bit dll on a 32-bit computer. Why don't you simple do some research on how to compile a Delphi dll so its a 64-bit dll. – Security Hound Jun 10 '11 at 19:19
  • 2
    The compiler is basically a computer program that takes a text file as input, and creates an EXE file. The program follows a step-by-step algorithm to create the EXE from the text file. But the compiler is the same program no matter what OS it is running on. – Andreas Rejbrand Jun 10 '11 at 19:19
  • 1
    You will need to have a Delphi/compiler version that **knows** how to compile to 64 bits - Delphi 7 certainly **does not**.... just running your compiler on a 64-bit OS doesn't help at all – marc_s Jun 10 '11 at 19:27
  • 8
    Will baking a cake in a blue house produce a blue cake? – dthorpe Jun 10 '11 at 19:33
  • @dthorpe: Depending on the colour intensity, the cake *might* look bluish. :) – Andriy M Jun 10 '11 at 19:35
  • Will storing old rusty pipes in food freezer make them edible? @dthorpe, paint from the walls might do the job :) – Premature Optimization Jun 10 '11 at 19:42
  • @Ramhound If only your sentiments were well founded! – David Heffernan Jun 10 '11 at 19:44
  • Maybe you might want to head over here. http://www.embarcadero.com/products/delphi/64-bit – Warren P Jun 12 '11 at 03:06

4 Answers4

29

No.

Cosmin Prund
  • 25,498
  • 2
  • 60
  • 104
  • @andreas not original ;-) http://stackoverflow.com/questions/5031604/is-a-b-more-efficient-than-a-a-b-in-c/5031618#5031618 – David Heffernan Jun 10 '11 at 19:22
  • @David I've seen yours, but it honestly feels appropriate for this question: short and to the point, no need to mention FreePascal nor the next Delphi version that will (most likely) include a 64 bit compiler. – Cosmin Prund Jun 10 '11 at 19:28
  • @Andreas Rejbrand: sorry, but that is not the best answer ever, the best answer ever is this: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags – The_Fox Jun 11 '11 at 11:22
  • Sadly, my answer referred to above has just been deleted. Boo hoo! – David Heffernan Jun 13 '11 at 09:29
8

Nope. Delphi 7 was released in 2002; the first AMD64 processor was released in 2003. No way Delphi 7 knows how to generate 64-bit code.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186
8

All released versions of Delphi following the 16 bit Delphi 1 emit 32 bit targets. At the moment your options are:

  1. Wait until the upcoming 64 bit Delphi release. We anticipate this some time this year, but your port will be non-trivial.
  2. Port to FreePascal. Again, a non-trivial port.
  3. Port to a completely different language: even more work than porting to Free Pascal.
  4. Carry on running 32 bit code.
Community
  • 1
  • 1
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • I thought Delphi 1 compiler produced 16-bit binaries. Or was it able to compile both? – Andriy M Jun 10 '11 at 19:29
  • If you build the Delphi 1 executable, do that four times, and concatenate the results together, the result might be 64 bit, right? :-) – Warren P Jun 12 '11 at 03:05
  • @Warren: If only it was that simple! You are forgetting that aside from concatenating the code you should also make sure the four parts are going to run in parallel. So, without additional tricks the resulting binary will most probably not run on processors with fewer cores than 4. :) – Andriy M Jun 15 '11 at 05:00
2

Compiling a program means to translate your source files into CPU opcodes (and something more, it has to generate a executable image that can work on the OS it was designed for, respecting the OS ABI - Application Binary Interface). Each type of CPU has its own set of opcodes, and even if the Intel x86 architecture has many similarities among 16, 32 and 64 bit opcodes, there are enough differences and the ABI is anyway different.

Creating a 64 bit exe/dll means to generate 64 bit opcodes using also the new 64 bit ABI, and to do that a compiler must be written to "know" them, what a compiler can do is defined by how the compiler itself is written, not by the system it is run on. Delphi 7 compiler "doesn't know" about 64 bit CPUs and exe/dll ABI, and thereby can't generate it. This is true as well up to Delphi XE. The next version should be the first one to come with a 64 bit compiler, you can wait for it, or if you're in a hurry there are some partially compatible compilers like FPC.