Missing glib/gobject when compiling

Edward Bridges ebridges at eqbridges.com
Wed Nov 8 21:57:25 EST 2017


On Wed, Nov 8, 2017, at 09:59 AM, John Ralls wrote:
> 
> 
>> On Nov 7, 2017, at 8:42 PM, Edward Bridges
>> <ebridges at eqbridges.com> wrote:>> 
>> On Tue, Nov 7, 2017, at 10:26 AM, John Ralls wrote:
>>> 
>>> 
>>>> On Nov 6, 2017, at 6:27 PM, Edward Bridges <ebridges at eqbridges.com>
>>>> wrote:>>>> 
>>>> On Mon, Nov 6, 2017, at 08:40 PM, Edward Bridges wrote:
>>>>> 
>>>>> On Sun, Nov 5, 2017, at 10:39 PM, John Ralls wrote:
>>>>>> 
>>>>>> 
>>>>>>> On Nov 5, 2017, at 6:07 PM, Edward Bridges
>>>>>>> <ebridges at eqbridges.com> wrote:>>>>>>> 
>>>>>>> I've built libdbdpgsql.so using jhbuild build libdbi-drivers,
>>>>>>> then run:>>>>>>> 
>>>>>>> cp gnucash-stable/lib/dbd/libdbdpgsql.so \
>>>>>>>   /Applications/Gnucash.app/Contents/Resources/lib/dbd
>>>>>>> 
>>>>>>> 
>>>>>>> install_name_tool -change gnucash-stable/lib/libdbi.1.dylib \
>>>>>>>   /Applications/Gnucash.app/Contents/Resources/lib/libdbi.1.dyl-
>>>>>>>   ib \>>>>>>>   /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpg-
>>>>>>>   sql.so>>>>>>> 
>>>>>>> I'm assuming that, then, when I start up Gnucash (v2.6.15) I
>>>>>>> would have>>>>>>> the
>>>>>>> option to "Save As..." to a Postgresql database option under
>>>>>>> "Data>>>>>>> Format"
>>>>>>> but it's not appearing, and am not seeing any logs under
>>>>>>> Console.>>>>>>> 
>>>>>>> Thanks for your quick response earlier.  Am I missing a step
>>>>>>> somewhere>>>>>>> here?
>>>>>> 
>>>>>> I think you also need the pgsql client dylib in the bundle and it
>>>>>> would>>>>>> be better to use @executable_path/../Resources/lib/libdbi.1.dylib
>>>>>> rather>>>>>> than /Applications/Gnucash.app/Contents as that will allow you to
>>>>>> move>>>>>> the bundle.
>>>>>> 
>>>>>> Use `otool -L
>>>>>> /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpgsql-
>>>>>> .so` to>>>>>> make sure that your install_name_tool invocation did what you
>>>>>> want. I’m>>>>>> suspicious of the relative path in your install_name_tool
>>>>>> invocation.>>>>>> 
>>>>>> Console doesn’t catch stderr anymore and hasn’t since Lion
>>>>>> (10.7). You>>>>>> can check the trace file (`sudo find /var/private/Temp -name
>>>>>> gnucash.trace` to get the path) but link errors might not get
>>>>>> into there>>>>>> either, so best to run GnuCash from a Terminal session:
>>>>>> /Applications/Gnucash.app/Contents/MacOS/Gnucash
>>>>>> so the stderr output goes where you can see it.
>>>>>> 
>>>>>> Regards,
>>>>>> John Ralls
>>>>> 
>>>>> Hi John --
>>>>> 
>>>>> Thanks for your help on this.  
>>>>> 
>>>>> When I run according to your instructions I get a brief error
>>>>> message>>>>> that libdbi is unable to load the driver -- and it still is not
>>>>> working>>>>> (see below).  I could not find a gnucash.trace file under /var as
>>>>> well.>>>>> 
>>>>> ```
>>>>> ~ $ /Applications/Gnucash.app/Contents/MacOS/Gnucash
>>>>> Application Path /Applications/Gnucash.app/Contents/MacOS/Gnucash-
>>>>> bin>>>>> 
>>>>> (process:4934): gnc.gui-WARNING **: [mac_set_languages()] Language
>>>>> list:>>>>> en:en_US:C
>>>>> (null)
>>>>> libdbi: Failed to load driver:
>>>>> /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpgsq-
>>>>> l.so>>>>> ^C
>>>>> 
>>>>> ~ $ otool -L
>>>>> /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpgsq-
>>>>> l.so>>>>> /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpgsql-
>>>>> .so:>>>>> /Users/gnucash/gnucash-stable/lib/libpq.5.dylib (compatibility
>>>>> version 5.0.0, current version 5.9.0)
>>>>> /Users/gnucash/gnucash-stable/lib/libdbi.1.dylib (compatibility
>>>>> version 3.0.0, current version 3.0.0)
>>>>> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
>>>>> version 1252.0.0)
>>>>> ```
>>>>> 
>>>>> Cheers, 
>>>>> Ed
>>>> 
>>>> Just noticed that `otool` is reporting that `libdbdpgsql.so` under>>>> /Applications/Guncash.app is depending on `libdbi` and `libpq` 
>>>> that live under the `gnucash` user home directory (i.e. that were
>>>> built>>>> along with libdbdpgsql.
>>>> 
>>>> That may explain the failure to load the shared library (as the
>>>> user I>>>> ran
>>>> Gnucash as does not have access to the gnucash user home
>>>> directory).>>>> 
>>>> However, I tried running it as root as well, and still get the same>>>> error
>>>> message.
>>> 
>>> What does `file /Applications/Gnucash.app/Contents/Resources/lib/db-
>>> d/libdbdpgsql.so` return?>>> 
>>> Regards,
>>> John Ralls
>>> 
>> 
>> It returns:
>> 
>> /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpgsql.so[-
>> 1]: Mach-O 64-bit bundle x86_64> That’s the problem: Everything else is 32-bit. Change the setup_sdk()
> call in ~/.jhbuildrc-custom to>   setup_sdk(architectures=[‘i386’])
> and rebuild everything.
> 
> Another issue: Be sure to run
>   install_name_tool -change /Users/gnucash/gnucash-
>   stable/lib/libdbi.1.dylib \>   @executable_path/../Resources/lib/libdbi.1.dylib \
>   /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdpgsql.so> 
> (That’s all one command, note the ‘\’ at the end of the first two
> lines) so that GnuCash and libdbdpgsql are using the same instance of
> the library; weird memory errors are likely if they don’t.> 
> Regards,
> John Ralls

It appears that I don't have i386 MacOS development libraries installed
on my x86_64 system:
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libpq.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libpq.tbdUndefined symbols for architecture i386:
.
.
.
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is that something that's readily available for download somewhere?

Thanks!
Ed


Links:

  1. http://gnucash.app/Contents/Resources/lib/dbd/libdbdpgsql.so


More information about the gnucash-devel mailing list