Compile generate 0 byte files on OS X
-
Hi SGaist,
yes, here it what the project looks like :
http://hpics.li/d8bb2ec
The main project uses every libs. And all of them generate empty files -
Can you show the content of
medicad2.pro
? -
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.
-
What does that library look like ?
-
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 -
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. -
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 ?
-
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++
. -
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.
-
Strange⦠You should have had undefined symbols errorsā¦
In any case it should rather be:
LIBS += -framework CoreFoundation