Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Creating custom postgres types using QT 5.0.1 and Postgres 9.2 with MacOSX10.6.sdk
Qt 6.11 is out! See what's new in the release blog

Creating custom postgres types using QT 5.0.1 and Postgres 9.2 with MacOSX10.6.sdk

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 2 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CharlesThoma2013gmail.com
    wrote on last edited by
    #1

    ** If this message is not in the right forum please direct me accordingly **

    With postgres 9.2 it is now possible to use 'CREATE EXTENSION' to install custom postgres types.

    I can successfully build and install a C++ custom type with g++; but I am running into issues creating an .so built by qt 5.0.1 (this so contains the C++ object(s) and extern "C" interface to same).

    Apparently Postgres still expects a 32 bit dll/so. This is somewhat problematic since, from everything I can tell, there is no way to successfully build a 32 bit version of qt 5.0.1 on a mac. I have tried without success to compile the qt source with macx-g++-32, macx-clang++-32 (et.al) with no success.

    Am I missing something obvious (like using -arch i386, in some specific way)? Or is this something that i need to do in Linux?

    The error message I get:

    ld: warning: ignoring file .lib/libReasonerModule.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): .lib/libReasonerModule.dylib

    Snippets from make log (If it would help...):

    gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -headerpad_max_install_names -arch i386 -arch x86_64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/include/libxml2 -I /Enterprise/9.2/include -I. -I. -I/Library/PostgreSQL/9.2/include/postgresql/server -I/Library/PostgreSQL/9.2/include/postgresql/internal -I/usr/local/include/libxml2 -I/usr/local/include/libxml2 -I/usr/local/include -c -o core_reasoner_module.o core_reasoner_module.c

    gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -headerpad_max_install_names -arch i386 -arch x86_64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/include/libxml2 -I /Enterprise/9.2/include -I. -I. -I/Library/PostgreSQL/9.2/include/postgresql/server -I/Library/PostgreSQL/9.2/include/postgresql/internal -I/usr/local/include/libxml2 -I/usr/local/include/libxml2 -I/usr/local/include -c -o core_reasoner_inout.o core_reasoner_inout.c

    gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -headerpad_max_install_names -arch i386 -arch x86_64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -bundle -multiply_defined suppress -o core_reasoner-1.0.so core_reasoner_module.o core_reasoner_inout.o -L/Library/PostgreSQL/9.2/lib -L/usr/local/lib -L/usr/local/lib -Wl,-dead_strip_dylibs -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib -lxml2 -lz -L.lib -lReasonerModule -bundle_loader /Library/PostgreSQL/9.2/bin/postgres

    Thanks in advance,
    CT

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It's look like libReasonerModule is only x86_64. If it's a lib of yours, you have to add CONFIG+=x86 to build it for 32bit

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CharlesThoma2013gmail.com
        wrote on last edited by
        #3

        I appreciate the response -- I apologize for not actually checking back after I posted.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No worries, did you make it work ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved