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. Compile generate 0 byte files on OS X
QtWS25 Last Chance

Compile generate 0 byte files on OS X

Scheduled Pinned Locked Moved Solved General and Desktop
24 Posts 4 Posters 6.5k Views
  • 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 13 Jul 2016, 13:44 last edited by
    #6

    Can you show the content of medicad2.pro ?

    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
    • A Offline
      A Offline
      Amott
      wrote on 13 Jul 2016, 14:22 last edited by
      #7

      here it is :

      TEMPLATE = subdirs
      
      SUBDIRS += \
          MdCore \
          MdWidgets \
          MediaCad \
          MdModels \
          QtOpenGL \
          MdDimension \
          MdProfile \
          MdDrawing2d \
          MdPrint \
          MddwgParameters
      
       # where to find the sub projects - give the folders
      MdCore.subdir = MdCore
      MdWidgets.subdir  = MdWidgets
      MediaCad.subdir  = MediaCad
      MdModels.subdir  = MdModels
      MdDimension.subdir  = MdDimension
      QtOpenGL.subdir  = QtOpenGL
      MdProfile.subdir = MdProfile
      MdDrawing2d.subdir = MdDrawing2d
      MdPrint.subdir = MdPrint
      MddwgParameters.subdir = MddwgParameters
      
       # what subproject depends on others
      MdWidgets.depends = MdCore
      MediaCad.depends = MdCore MdWidgets
      MdModels.depends = MdCore
      MdDimension.depends = MdCore MdWidgets
      MdProfile.depends = MdCore MdWidgets MdModels
      MdDrawing2d.depends = MdCore
      MdPrint.depends = MdCore
      MddwgParameters.depends = MdCore MdWidgets
      
      
      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 13 Jul 2016, 20:43 last edited by
        #8

        Can you reproduce that with a minimal project ?

        Note there's one thing that I find a bit strange with your current project. For MdDimension, it looks like you are picking pieces from other folders and rebuild them there rather than having the common classes themselves in a library that would link against.

        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
        • A Offline
          A Offline
          Amott
          wrote on 15 Jul 2016, 07:10 last edited by
          #9

          Yes, I have a basic project (just a main.cpp and a mainwindow), using the ODA library and I have the same result. Maybe the error comes from this library ?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 15 Jul 2016, 20:59 last edited by
            #10

            What does that library look like ?

            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
            • A Offline
              A Offline
              Amott
              wrote on 18 Jul 2016, 07:31 last edited by
              #11

              I don't know what you mean by saying that but I hope my answer is what you expect.
              ODA is a library to manage .dwg and .dgn files. It is composed with a folder "lib" where are placed a lot of .a, a folder "bin" with some unix executable, a folder "include" with some headers. I copied / pasted them into different folder and linked them to my application.
              Here is the what the full library looks like :
              http://hpics.li/58b8b54

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Amott
                wrote on 19 Jul 2016, 14:51 last edited by
                #12

                Here I am again with some news, I have successfully built a basic project that includes ODA library, so I did the same operation with the same include files on the real project but it still generate me empty files.
                I have compared both .pro file and I have notice that may be the source of the error :

                target.path = /usr/lib
                INSTALLS += target
                

                It's the only thing that is different between the project that works and the real project. I have tried to change the target but nothing happens, am I missing something ?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 19 Jul 2016, 22:50 last edited by
                  #13

                  Try change target for some other name. my_target should do it.

                  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
                  • A Offline
                    A Offline
                    Amott
                    wrote on 20 Jul 2016, 09:23 last edited by
                    #14

                    I tried this too but it doesn't change anything. Maybe a last idea, at the very beginning, I had an error :
                    Undefined symbols for architecture x86_64
                    The solution I find was to add -stdlib=libstdc++ to qmake. Maybe there was another solution ?

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Amott
                      wrote on 20 Jul 2016, 15:00 last edited by
                      #15

                      I just realizze that I spoke too fast, my other project was working but it was to generate a .app not a lib...
                      I retried to create a lib step by step :
                      -create a lib project -> works
                      -add include path to ODA library to the project -> works
                      -use a variable of ODA -> error above
                      -add libstdc++ to qmake -> generate empty files
                      So the problem comes from either ODA or libstdc++, I will continue to search the solution

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 20 Jul 2016, 21:59 last edited by
                        #16

                        Is ODA built against the old C++ library ?

                        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
                        • A Offline
                          A Offline
                          Amott
                          wrote on 21 Jul 2016, 07:35 last edited by Amott
                          #17

                          I don't know, the package is named "Teigha_macOsX_x64_10.11" and the mac is in 64bit on OS X 10.11. I will ask in the ODA forum to know
                          Edit : I can generate some files now ! I change qmake argument to CFLAGS="-arch x86_64" but at a certain point it generate me the error above.

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 22 Jul 2016, 21:19 last edited by
                            #18

                            The best would be to ensure what were the parameters used to build that library. It's surprising if they don't use libc++.

                            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
                            • A Offline
                              A Offline
                              Amott
                              wrote on 26 Jul 2016, 12:41 last edited by
                              #19

                              I have made a test with the command "file" to know what kind of library is it, here are my results :

                              a random lib in /usr/lib :

                              Mach-0 universal binary with 2 architectures
                              (for architecture x68_64): Mach-0 64-bit dynamically linked shared library x86_64
                              (for architecture i386): Mach-0 dynamically linked shared library i386
                              

                              a lib from ODA :

                              current ar archive random library
                              

                              I'm not sure of what it means, the library is not compatible with the Mac ?

                              K 1 Reply Last reply 26 Jul 2016, 12:59
                              0
                              • A Amott
                                26 Jul 2016, 12:41

                                I have made a test with the command "file" to know what kind of library is it, here are my results :

                                a random lib in /usr/lib :

                                Mach-0 universal binary with 2 architectures
                                (for architecture x68_64): Mach-0 64-bit dynamically linked shared library x86_64
                                (for architecture i386): Mach-0 dynamically linked shared library i386
                                

                                a lib from ODA :

                                current ar archive random library
                                

                                I'm not sure of what it means, the library is not compatible with the Mac ?

                                K Offline
                                K Offline
                                kenchan
                                wrote on 26 Jul 2016, 12:59 last edited by kenchan
                                #20

                                @Amott

                                I use that ODA library on OSX and I link it with the c library like this...

                                LIBS += -lc++ \
                                -lTD_Db \
                                ... other ODA libs

                                and it works fine.

                                A 1 Reply Last reply 26 Jul 2016, 14:38
                                0
                                • K kenchan
                                  26 Jul 2016, 12:59

                                  @Amott

                                  I use that ODA library on OSX and I link it with the c library like this...

                                  LIBS += -lc++ \
                                  -lTD_Db \
                                  ... other ODA libs

                                  and it works fine.

                                  A Offline
                                  A Offline
                                  Amott
                                  wrote on 26 Jul 2016, 14:38 last edited by Amott
                                  #21

                                  @kenchan

                                  Thanks for your response ! I have tried again but I still have the same error. Which version of OSX, ODA and XCode are you using ?

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    Amott
                                    wrote on 27 Jul 2016, 12:57 last edited by
                                    #22

                                    I finally found the solution : I needed a line on the .pro :
                                    QMAKE_LFLAGS += -framework CoreFoundation

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 27 Jul 2016, 13:06 last edited by
                                      #23

                                      Strange… You should have had undefined symbols errors…

                                      In any case it should rather be: LIBS += -framework CoreFoundation

                                      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
                                      • A Offline
                                        A Offline
                                        Amott
                                        wrote on 27 Jul 2016, 14:32 last edited by
                                        #24

                                        it works too, I will replace this variable. It strange but it works, after 3 weeks, I'm so happy that something works taht I won't search why it doesn't make me an error !

                                        1 Reply Last reply
                                        0

                                        15/24

                                        20 Jul 2016, 15:00

                                        • Login

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