[fpc-pascal] CoreFoundation Freepascal MAC OSX

md at rpzdesign.com md at rpzdesign.com
Sun May 5 06:20:23 CEST 2013


Anybody have any success with the included units for
CoreFoundation on Mac OSX.



I was trying to use CFSetGetCount( ) function call, it is clearly 
defined in CFSet.pas
and yet the linker error is:

Identifier Not Found "CFSetGetCount"

But magically, the constants from CFBase.pas compile OK, so it must
be the compiler directives at the top of CFSET.pas that are preventing
that code from getting included and visible by the compiler.

#################################
program testcfset;

uses
   CFBase, CFSet ;
var
  fcnt : single ;
  ret : integer ;
begin
  fcnt := kCFCoreFoundationVersionNumber10_2 ;
  ret := CFSetGetCount(nil) ;
end.

{  Compiler messages Below:
testcfset.lpr(6,2) Note: Local variable "fcnt" is assigned but never used
testcfset.lpr(7,2) Note: Local variable "ret" is assigned but never used
ld: symbol(s) not found for architecture i386
Undefined symbols for architecture i386:
   "_CFSetGetCount", referenced from:
       _PASCALMAIN in testcfset.o
ld: symbol(s) not found for architecture i386
An error occurred while linking
testcfset.lpr(10,2) Error: Error while linking
testcfset.lpr(10,2) Fatal: There were 1 errors compiling module, stopping
}
##################################

On another project before I built the test project,
I saw these errors:

ld : symbol(s) not found for architecture i386.

Undefined symbols for architecture i386:
"_CFSetGetCount" referenced from : (my code mangled name)

Anybody have a clue how to force the compiler to see and use CFSet.ppu
from inside /usr/local/lib/fpc/2.6.2/

My machine in Mac Mini 2010 with OSX Lion and XCode 4.6.2 Apr 15 with 
command line tools of same date.

I am working under Lazarus 1.08.  All the PPU files are where they 
should be.

Somebody from the Mac Guru crowd have any comments

Thanks,

md
-------------- next part --------------
program testcfset;

uses
  CFBase, CFSet ;
var
 fcnt : single ;
 ret : integer ;
begin
 fcnt := kCFCoreFoundationVersionNumber10_2 ;
 ret := CFSetGetCount(nil) ;
end.

{
testcfset.lpr(6,2) Note: Local variable "fcnt" is assigned but never used
testcfset.lpr(7,2) Note: Local variable "ret" is assigned but never used
ld: symbol(s) not found for architecture i386
Undefined symbols for architecture i386:
  "_CFSetGetCount", referenced from:
      _PASCALMAIN in testcfset.o
ld: symbol(s) not found for architecture i386
An error occurred while linking
testcfset.lpr(10,2) Error: Error while linking
testcfset.lpr(10,2) Fatal: There were 1 errors compiling module, stopping
}


More information about the fpc-pascal mailing list