开发者

Will compiling a DLL in Delphi 7 on a 64bit OS result in a 64bit DLL?

As the title suggests!

I'm trying to get a 64bi开发者_如何学编程t dll


No.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜