Compile generate 0 byte files on OS X
-
wrote on 13 Jul 2016, 14:22 last edited by
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
-
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.
-
wrote on 15 Jul 2016, 07:10 last edited by
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 ?
-
What does that library look like ?
-
wrote on 18 Jul 2016, 07:31 last edited by
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 -
wrote on 19 Jul 2016, 14:51 last edited by
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 ?
-
Try change
target
for some other name.my_target
should do it. -
wrote on 20 Jul 2016, 09:23 last edited by
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 ? -
wrote on 20 Jul 2016, 15:00 last edited by
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 -
Is ODA built against the old C++ library ?
-
wrote on 21 Jul 2016, 07:35 last edited by Amott
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. -
The best would be to ensure what were the parameters used to build that library. It's surprising if they don't use
libc++
. -
wrote on 26 Jul 2016, 12:41 last edited by
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 ?
-
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 ?
-
I use that ODA library on OSX and I link it with the c library like this...
LIBS += -lc++ \
-lTD_Db \
... other ODA libsand it works fine.
-
wrote on 27 Jul 2016, 12:57 last edited by
I finally found the solution : I needed a line on the .pro :
QMAKE_LFLAGS += -framework CoreFoundation -
Strange⦠You should have had undefined symbols errorsā¦
In any case it should rather be:
LIBS += -framework CoreFoundation
-
wrote on 27 Jul 2016, 14:32 last edited by
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 !
16/24