[fpc-pascal] Re: building universal binary

Ken G. Brown kbrown at mac.com
Wed Feb 4 18:48:27 CET 2009


At 12:00 PM +0100 2/4/09, fpc-pascal-request at lists.freepascal.org apparently wrote:
>Date: Wed, 4 Feb 2009 10:50:17 +0100
>From: Jonas Maebe <jonas.maebe at elis.ugent.be>
>Subject: Re: [fpc-pascal] Re: building universal binary
>To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
>Message-ID: <00E64550-AE30-4DB1-8882-E4B26E09CD2C at elis.ugent.be>
>Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
>On 03 Feb 2009, at 23:33, Ken G. Brown wrote:
>
>>>> Have a Pascal program calling some C code from a static library I
>>>> build in a separate project so I can use the debugger.
>>>
>>> You can also build it in a separate target of the same project and
>>> then change the target-specific flags for that C library (as in the
>>> "FPC-C-C++ Carbon Application 2.2.0" template).
>>
>> Does this method still allow running gdb on the C code?
>
>Yes. When you have separate targets, you can set separate options for 
>the different targets (so you can turn on gcc debugging info for the 
>library target and disable it for the FPC target).
>
>
>Jonas

So far I'm still in two projects but I'll try this method later, it will be easier I think. Don't want to change too many things right now.

Now everything seems pretty good, have universal bninary, building both debug and release versions, both run as desired under Xcode control.

Program formats output and sends directly to a serial port to a tractor feed printer.

However, when I try running from Finder, I get a short few characters out the serial port then the program dies. This is whether or not the 'run under Rosetta' box is checked in Get Info. Intel or PowerPC shows properly in Activity Monitor. I've tried inserting printf in the 'C' code just before the write statement but cannot find any output. Also tried fprintf's to stdout and stderr. I've tried running the program from Terminal to see if that helped. How and where should I be able to see output? Where should a write(var); go from the pascal side?

Debug print stuff shows up to the console when running under Xcode.

What should I look for that would cause it to work fine from Xcode but die from Finder?

MacOS 10.5.6, fpc 2.2.2, Xcode 3.1.2

Info.plist looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>PrintSmallOSX</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>com.yourcompany.PrintSmallOSX</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>PrintSmallOSX</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>CSResourcesFileMapped</key>
	<true/>
	<key>CFBundleShortVersionString</key>
	<string>1.0.0</string>
</dict>
</plist>

Thx for any tips,
Ken G. Brown



More information about the fpc-pascal mailing list