Qt c++ how to use nested libraries - c++

Hi im rather new to qt here. Im using QT subdir to better organize and modulate my code.
I created a shared c++ library subproject (A) which uses the static gdal library. Then i created another shared c++ library subproject (B) which attempts to use (A).
Building (A) is okay. However the #includes for gdal dont work when i build (B). It says cannot open include file: 'ogr_feature.h': No such file or directory.
I went to read the qt guide in creating shared libraries and it said when deploying the library there should be no dependency to internal headers. What does that mean and how do i work around it?

Related

manage order of static link for IOS in XCode

QUESTION: how to manage linking order in xcode?
DETAILES:
I'm new in Apple-dev and have some troubles with building my project for ios.
I'm building OGRE3d(1.10) and MyGUI(3.2) libraries from source code via cmake and ios-toolchain.cmake.
MyGUI using functions from ogre and I like them using cmake function target_link_library. And I have any .a static libraries. We will name them ogre.a and mygui.a.
Then I've create ios project and create Objective-c++ file(.mm) where tried to use mygui and ogre function. To link mygui and ogre i've drag them and drop to the root of project structure of xcode and i see them in "linked framework and libraries".
But I have linking errors, which says that ogre function can't be linked to MyGUI (undefined symbols).
As I think the reason of the errors is wrong linking order of the libraries.
So, I tried to move the order on the project struct, but nothing changed. It seems that changing order libraries in project struct doesn't change linking order. So how can i manage it?
I've seen the same question on OGRE forum.
But there is no answer :(

creating a static library and linking using Cmake

I have a application which need to use two libraries (pugixml and lua) and need to be an multi-platform build capable. I am trying to use Cmake for this. Since I have three different solution (two for creating static libraries and one solution which actually uses that libraries). So far what I do is run Cmake for those two libraries and copy those static libraries manually to the lib folder into application and run cmake again.
I need to reduce the three step and make it as a single step so that I can handle the multi-platform build in a single shot.
I need to know, should we need to create a dynamic link library or shared library or static library for these kind of operation?
And need help on how to do it. I tried creating the source folder of pugixml and copy the cpp/hpp/h file and wrote a cmakelists file like
set(HEADERS pugixml.hpp pugiconfig.hpp)
set(SOURCES ${HEADERS} pugixml.cpp)
add_library(pugixmlLib STATIC ${SOURCES})
target_link_libraries(pugixmlLib pugixml)
On the solution I could see my application project and pugixml project, but on my application project linker property I could find pugixml library.

Build a CMake project using multiple libraries(built or not/source code)

I want to create a Visual Studio Project which will utilize 4 different Libraries.
Library 1: I have got it from github and I have only src code files+CMakeLists.txt which calls libraries like opencv/opengl/glut and also library 2.I don't have any dlls,bins etc.
Library 2: Is openCV 3.0.I have both build files and src files.
Library 3: I have ready files-->include,bin,dlls etc
Library 4: I have ready files-->include,bin,dlls etc
How can I start with CMake to combine all the above libraries?
I should start a brand new project and write a CMakelists file which will call for all 4 libraries stated above? Can I use immediately the 1st library which hasn't been compiled? Any CMakeLists.txt example to get started for combining all these?

Build C++ library on OS X/Mac using Qt

I have created a C++ library on Windows using Qt and it works well. Now I want to build the same C++ library on OS X/Mac using Qt, and after running the same steps as how I made this C++ library on Windows, I’m not sure which generated files is the library I need on OS X.
On Windows, I can use the library in other C++ project through the following files: .dll, object file library and the header file. I can find the first two files generated in the target folder:
But on Mac, after checking the same folder I found the generated files as below:
Which files are the library that I made? And how to use the generated library in other C++ project on OS X?
I try to find some step-by-step guide but with no luck so far, so if there’s any useful link that will be of help.
Thank you in advance!
The library is
libsdk.1.0.0.dylib
all other libsdk*.dylib are links to the library (compatibility reasons, some applications look for libsdk.dylib). You use these library as you would use any other dynamic library. Supply the library and the header files to the local path or install them system wide (DYLD_LIBRARY_PATH).
See How to use dylib in Mac OS X (C++) for more information.

Building and Using a DYLIB in Xcode

I'm trying to build a .dylib in Xcode. Currently the .dylib builds, but when I drag the .dylib into another project and try to #import one of the headers (Seeker.h) in the .dylib, I get this error:
*: No such file or directory
Seeker.h: No such file or directory
The project is available as an Xcode project here.
I can confirm the header is indeed in a path alongside the .dylib once built, but as for what to do with it I have no idea. My only experience with .dylib files is frameworks built into Mac OS X, like libsqlite3.dylib, which works perfectly. All the tutorials I can find on .dylib files does not cover how to use them with Xcode in a sensible manner; all of them rely either on complex scripts or machine-dependent configuration which will not work for us.
So basically I need a start-to-finish step-by-step process that successfully builds the .dylib and successfully includes it in another Xcode project in a way that's not dependent on changing build settings for different users. In other words, a way that just works and that will work when we distribute both projects to members of our team.
Dylibs don't carry headers: they're brainless executable files. Built-in libraries have their headers in known locations, like /usr/include, which makes them globally available. What you're looking for is probably a framework.
Frameworks are packages that contain a dynamic library and header files, so once you link with the framework you can import the headers it has. It can also carry other resources such as images and sounds.
I suggest you read the Framework Programming Guide for more informations.
You are not able to create static library .dylib from Xcode because they are using OS, but you are able to create a dynamic framework with .dylib inside
[iOS static vs dynamic library]
[Create dynamic framework]