Thread: Build failure on OSX

Build failure on OSX

From
"Florian G. Pflug"
Date:
Hi

I'm getting linker error on OSX since about two days. Any idea why the symbol __ftol is missing,
and which library should provide it?

g++ -Wall -Wno-non-virtual-dtor -I../src/include -I../src/agent/include -I../src/slony/include
-L/Users/pgadmin3/Installs/PostgreSQL/8.1.3/lib-L/Users/pgadmin3/Installs/wxMac/2.6.2/lib -o pgadmin3  
  pgAdmin3.o dlgJob.o dlgSchedule.o dlgStep.o pgaJob.o pgaSchedule.o pgaStep.o base.o appbase.o sysLogger.o
pgConnBase.opgSetBase.o factory.o calbox.o ctlComboBox.o ctlListView.o ctlSQLBox.o  
ctlSQLGrid.o ctlSQLResult.o ctlSecurityPanel.o ctlTree.o explainCanvas.o explainShape.o timespin.o xh_calb.o
xh_ctlcombo.oxh_ctltree.o xh_sqlbox.o xh_timespin.o keywords.o pgConn.o pgSet.o  
dlgAddFavourite.o dlgAggregate.o dlgCast.o dlgCheck.o dlgColumn.o dlgConnect.o dlgConversion.o dlgDatabase.o
dlgDomain.odlgEditGridOptions.o dlgForeignKey.o dlgFunction.o dlgGroup.o dlgHbaConfig.o  
dlgIndex.o dlgIndexConstraint.o dlgLanguage.o dlgMainConfig.o dlgManageFavourites.o dlgOperator.o dlgPgpassConfig.o
dlgProperty.odlgRole.o dlgRule.o dlgSchema.o dlgSelectConnection.o dlgSequence.o  
dlgServer.o d
  lgTable.o dlgTablespace.o dlgTrigger.o dlgType.o dlgUser.o dlgView.o frmAbout.o frmBackup.o frmConfig.o frmEditGrid.o
frmExport.ofrmGrantWizard.o frmHbaConfig.o frmHelp.o frmHint.o frmIndexcheck.o  
frmMain.o frmMainConfig.o frmMaintenance.o frmOptions.o frmPassword.o frmPgpassConfig.o frmQuery.o frmRestore.o
frmSplash.ofrmStatus.o frmUpdate.o events.o dlgClasses.o pgAggregate.o pgCast.o  
pgCheck.o pgCollection.o pgColumn.o pgConstraints.o pgConversion.o pgDatabase.o pgDatatype.o pgDomain.o pgForeignKey.o
pgFunction.opgGroup.o pgIndex.o pgIndexConstraint.o pgLanguage.o pgObject.o  
pgOperator.o pgOperatorClass.o pgRole.o pgRule.o pgSchema.o pgSequence.o pgServer.o pgTable.o pgTablespace.o
pgTrigger.opgType.o pgUser.o pgView.o dlgRepCluster.o dlgRepListen.o dlgRepNode.o  
dlgRepPath.o dlgRepProperty.o dlgRepSequence.o dlgRepSet.o dlgRepSubscription.o dlgRepTable.o slCluster.o slListen.o
slNode.oslPath.o slSequence.o slSet.o slSubscription.o slTable.o xrcDialogs.o  
favourites.o m
  isc.o pgconfig.o sysProcess.o sysSettings.o tabcomplete.o update.o utffile.o
-L/Users/pgadmin3/Installs/wxMac/2.6.2/lib  -framework QuickTime -framework IOKit -framework Carbon -framework Cocoa  
-framework System  /Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_macu_xrc-2.6.a
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_macu_qa-2.6.a 
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_macu_html-2.6.a
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_macu_adv-2.6.a
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_macu_core-2.6.a 
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_base_carbonu_xml-2.6.a
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_base_carbonu_net-2.6.a 
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_base_carbonu-2.6.a -framework WebKit -lwxregexu-2.6 -lwxexpat-2.6
-lwxtiff-2.6-lwxjpeg-2.6 -lwxpng-2.6 -lz -lpthread -liconv  
-L/Users/pgadmin3/Installs/wxMac/2.6.2/lib   -framework QuickTime -framework IOKit -framework Carbon -framework Cocoa
-frameworkSystem  /Users/pgadmi 
  n3/Installs/wxMac/2.6.2/lib/libwx_macu_stc-2.6.a /Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_macu_ogl-2.6.a
/Users/pgadmin3/Installs/wxMac/2.6.2/lib/libwx_base_carbonu-2.6.a-lwxregexu-2.6  
-lwxexpat-2.6 -lwxtiff-2.6 -lwxjpeg-2.6 -lwxpng-2.6 -lz -lpthread -liconv
-L/Users/pgadmin3/Installs/libxml2/2.6.23/lib-lxml2 -lz -lpthread -liconv -lm  
/Users/pgadmin3/Installs/PostgreSQL/8.1.3/lib/libpq.a   -lssl -lcrypto
ld: Undefined symbols:
__ftol

greetings, Florian Pflug

Re: Build failure on OSX

From
OpenMacNews
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> I'm getting linker error on OSX since about two days. Any idea why the
> symbol __ftol is missing,
> and which library should provide it?
...
> /Users/pgadmin3/Installs/PostgreSQL/8.1.3/lib/libpq.a   -lssl -lcrypto
> ld: Undefined symbols:
> __ftol
...


i haven't yet tried a recent build here, but i DO remember seeing ftol
b4 ... though on PC-boxen.

doing a little quick digging, it seems ftol is related to runtime
Floating-Point-to-Int conversion; cref e.g. this thread --

http://lists.apple.com/archives/PerfOptimization-dev/2005/Jan/msg00027.html

reading the thread, i'm fairly certain ftol is NOT avail on PPC ... but
perhaps on Intel?

florian, what box are you building on?

has someone here, perhaps, been monkeying with Intel code for the new macs?

just guessing for now ...

richard


- --

/"\
\ /  ASCII Ribbon Campaign
 X   against HTML email, vCards
/ \  & micro$oft attachments

[GPG] OpenMacNews at gmail dot com
fingerprint: 50C9 1C46 2F8F DE42 2EDB  D460 95F7 DDBD 3671 08C6
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iEYEAREDAAYFAkRLsjwACgkQlffdvTZxCMYkDgCgu6RQ6zQ7E6BYhmfRaAerOu1L
/aAAnjN/I/Gnr8rAczFr+y3vNAs+5pyq
=8ZcZ
-----END PGP SIGNATURE-----


Re: Build failure on OSX

From
"Florian G. Pflug"
Date:
OpenMacNews wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>> I'm getting linker error on OSX since about two days. Any idea why the
>> symbol __ftol is missing,
>> and which library should provide it?
> ...
>> /Users/pgadmin3/Installs/PostgreSQL/8.1.3/lib/libpq.a   -lssl -lcrypto
>> ld: Undefined symbols:
>> __ftol
> ...
> i haven't yet tried a recent build here, but i DO remember seeing ftol
> b4 ... though on PC-boxen.
>
> doing a little quick digging, it seems ftol is related to runtime
> Floating-Point-to-Int conversion; cref e.g. this thread --
>
> http://lists.apple.com/archives/PerfOptimization-dev/2005/Jan/msg00027.html
>
> reading the thread, i'm fairly certain ftol is NOT avail on PPC ... but
> perhaps on Intel?
>
> florian, what box are you building on?
OSX 10.3.9 on an old G3 350Mhz, with the newest devtools available for
10.3 IIRC.

greetings, Florian Pflug

Re: Build failure on OSX (Solved)

From
"Florian G. Pflug"
Date:
Florian G. Pflug wrote:
> OpenMacNews wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: RIPEMD160
>>
>>> I'm getting linker error on OSX since about two days. Any idea why the
>>> symbol __ftol is missing,
>>> and which library should provide it?
>> ...
>>> /Users/pgadmin3/Installs/PostgreSQL/8.1.3/lib/libpq.a   -lssl -lcrypto
>>> ld: Undefined symbols:
>>> __ftol
>> ...

I found the error. misc.cpp defines _ftol or _ftol2 as "extern". Whoever
added that code seems to have believed that "#if (_MSC_VER < 1300)" will
evaluate to false if _MSC_VER is not defined ;-) It doesn't, howerver,
so this needs wrapping inside "#ifdef WIN32".

Heres a patch, please apply.

Index: src/utils/misc.cpp
===================================================================
--- src/utils/misc.cpp  (revision 5084)
+++ src/utils/misc.cpp  (working copy)
@@ -428,9 +428,10 @@
  }
  #endif

+#ifdef WIN32
  #if (_MSC_VER < 1300)
  /* _ftol2 is more than VC7. */
  extern "C" long _ftol( double );
  extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); }
  #endif
-
+#endif

mfg, Florian Pflug