Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linking Error to lib on OSX
Forum Updated to NodeBB v4.3 + New Features

Linking Error to lib on OSX

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 2.6k 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.
  • B Offline
    B Offline
    billbonney
    wrote on last edited by
    #1

    Hi,

    I am building Qt5.4 from source (gitorious) and I having a problem linking in my project. I have built from source successfully (I think) using
    @./configure -developer-build -opensource -nomake examples -nomake tests@
    This assumes -system-zlib evaluated to use system version

    The link error I get is
    @Undefined symbols for architecture x86_64:
    "_z_adler32", referenced from:
    QuaAdler32::calculate(QByteArray const&) in quaadler32.o
    QuaAdler32::reset() in quaadler32.o
    QuaAdler32::update(QByteArray const&) in quaadler32.o
    "_z_crc32", referenced from:
    QuaCrc32::calculate(QByteArray const&) in quacrc32.o
    QuaCrc32::reset() in quacrc32.o
    QuaCrc32::update(QByteArray const&) in quacrc32.o
    _unzReadCurrentFile in unzip.o
    _zipWriteInFileInZip in zip.o
    "_z_deflate", referenced from:
    _zipWriteInFileInZip in zip.o
    _zipCloseFileInZipRaw in zip.o
    "_z_deflateEnd", referenced from:
    _zipCloseFileInZipRaw in zip.o
    "z_deflateInit2", referenced from:
    _zipOpenNewFileInZip3 in zip.o
    "_z_get_crc_table", referenced from:
    _unzOpenCurrentFile3 in unzip.o
    _zipOpenNewFileInZip3 in zip.o
    "_z_inflate", referenced from:
    _unzReadCurrentFile in unzip.o
    "_z_inflateEnd", referenced from:
    _unzCloseCurrentFile in unzip.o
    "z_inflateInit2", referenced from:
    _unzOpenCurrentFile3 in unzip.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [debug/apmplanner2.app/Contents/MacOS/apmplanner2] Error 1
    20:38:41: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project qgroundcontrol (kit: Qt5.4 (source))
    When executing step "Make"
    20:38:41: Elapsed time: 02:31.@
    I have LIBS += -lz in the pro file, but it fails.

    Any help on how to fix this, or debug this would be awesome.

    NOTE: the code can be seen at http://github.com/diydrones/apm_planner and it builds ok when using Qt5.4 pre-built binaries.

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

      Hi,

      Looks like your are linking to a zlib not built for x86_64, are you sure you are using the right one ?

      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
      • B Offline
        B Offline
        billbonney
        wrote on last edited by
        #3

        I'm building Qt from source on OSX 10.10 64 bit. I'm not electing the sib, but expecting Qt to pull the correct one. Are you suggesting I need to explicitly state 64bit on a 64bit system?

        The same code builds ok using prebuilt Qt on OSX 10.10 64bit. So I don't understand why it fails.

        Thanks for any pointers in right direction

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

          No, you don't need to.

          What are the options you gave to configure when building your own version of Qt ?

          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
          • B Offline
            B Offline
            billbonney
            wrote on last edited by
            #5

            See the first post. It was on OSX 10.10.

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

              Can you show the linker line that fails ?

              Also, which version of Xcode are you using ?

              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
              • B Offline
                B Offline
                billbonney
                wrote on last edited by
                #7

                Xcode 6.1. It's all latest versions for 10.10.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  billbonney
                  wrote on last edited by
                  #8

                  here's the linker line, see https://gist.github.com/billbonney/f8e6db162672078bc14d

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    billbonney
                    wrote on last edited by
                    #9

                    here's the linker line, see https://gist.github.com/billbonney/f8e6db162672078bc14d

                    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