Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...
Title:

64-bit MidasLib in Update #1

Author: Bob Swart
Posted: 10/12/2011 1:53:44 PM (GMT+1)
Content:

Delphi XE2 Update #1 included the 64-bit MidasLib unit - however, this introduced another problem. When compiling a 32-bit application that has the MidasLib unit added to the uses clause, you’ll get compiler hints about duplicate strings (actually resource identifiers) in midas.res. And when compiling as a 64-bit application, you’ll get two errors: File not found: midas.res and midas64.res.

To cover the first problem first: if you look inside the MidasLib unit (post Update #1) the following code can be seen in the list of $R and $L lines:

 (*$R midas.res*)
(*$L midas.obj*)
(*$L bcd.obj*)
(*$IFDEF CPUX86*)
(*$R midas.res*)
(*$L cpprtl.obj*)
(*$ELSE*)
(*$R midas64.res*)
(*$ENDIF CPUX86*)
If you look closely, you’ll see that midas.res is added regardless of the CPUX86 or not, and then either midas.res is added (in case of CPUX86) or midas64.res. So for a 32-bit target, the midas.res is included twice, which causes the compiler hints. To fix this, place the first <$R midas.res> in comments.

However, we can only recompile the MidasLib.pas file for the 32-bit target, since the required midas.obj, bcd.obj and cpprtl.obj are only those of the 32-bit version, compiled with C++Builder. We cannot fix the hints in the 64-bit edition of the MidasLib.dcu.

The second problem – the compiler error for the 64-bit edition of the MidasLib unit, is related to midas64.res which is not found on my disk.
To solve this problem, I just copied the midas.res file from the Embarcadero\RAD Studio\9.0\lib\win32\release directory to the win64\release directory, and placed another copy renamed as midas64.res. This will give me the duplicate string warnings again, but at least I can now compile a 64-bit application that uses the MidasLib unit (so I do not have to ship the 32-bit and/or 64-bit version of the MIDAS.DLL).

Back  


9 Comments

AuthorPostedComments
Lars Fosdal 11/10/12 15:49:03Sounds like something that needs to be QC'd and fixed in a future release?
Bob Swart 11/10/12 15:52:27Agreed, but I'll need to check if it isn't in QC already... Otherwise I'll report it later this week for sure.
Bob Swart 11/10/12 15:54:10It also appears that there is a midas64.rc file, so we can produce our own midas64.res file (there is only one difference with the midas.res file: the description "64-bit") ;-)
Uwe Schuster 11/10/12 17:03:21Duplicate .res issue and midas64.res delivery are both QCed. http://qc.embarcadero.com/wc/qcmain.aspx?d=99808 http://qc.embarcadero.com/wc/qcmain.aspx?d=99919 When you create midas64.res from the .rc file make sure that you create the string only version without the version info! There is no difference between midas.res and midas64.res from the POV of MidasLib unit and the res files to be delivered in $(BDSLIB). Copying midas.res to midas64.res is the easy way to go.
john friel 11/10/13 03:44:38That is just another example of sloppy testing before release...
Tamaki suoh 11/11/01 17:14:09hi Doc, Can i get a copy of you midas.res and midas.dcu my email is tamakisuoh25@yahoo.com
Bob Swart 11/11/01 22:09:04Why? If you have Delphi XE2, you will also have these files - otherwise, the .dcu file cannot be used by other versions than Delphi XE2 anyway...
Bob Swart 11/12/15 17:16:04Update #3 of Delphi XE2 has fixed the 64-bit MidasLib problems.
link building 13/09/06 12:35:01HqjMWG I loved your blog article.Really thank you! Keep writing.


New Comment (max. 2048 characters, no HTML):

Name:
Comment:



This webpage © 2005-2017 by Bob Swart (aka Dr.Bob - www.drbob42.com). All Rights Reserved.