xcode: Avoiding link conflicts with a static library - xcode

We're developing an SDK for our technology for iOS, the sdk is delivered in a static framework. Our code uses openCV and we link OpenCV into the delivered framework binary.
This normally works well but we're having an issue with a client which is indirectly using a different version of openCV in another framework.
This is causing a conflict and the clients app crashes.
Beside switching to the same version of openCV, removing our openCV dependency or switching to a dynamic library (which allows to hide open CV inside), is there an another option to fix this?
I tried to compile our lib using "Perform Single-Object Prelink and add the openCV libs in "Prelink libraries" but this produced link error when I tried to integrate it and it looks as if it ignored "Prelink libraries", maybe I'm doing something wrong here.
Any thoughts or ideas on the matter would be much appreciated.

Related

Linker error building Adobe DNG SDK on MacOS 11

I am working on a project that uses Adobe's DNG SDK 1.6 library, and it is supposed to work on Windows and MacOS.
The library has instructions on how to build it for both platforms, but I had to figure out an error that came up on Windows with Visual Studio. I am not very experienced with big C++ projects so it was not trivial but I got it working. Most of my own code will be done in C# .Net Core, calling the native libraries using a wrapper class with P/Invoke.
Now for Mac that's a different story, I have a MacOS 11 VM, installed Xcode 12.5.1 and followed the steps provided, as expected, it does not work. Bare in mind this is my first time touching Xcode and MacOS.
The project I am trying to build is dng_validate, and it depends on two libraries built by these projects: XMPFiles64 and XMPCore64.
The library projects build without any hiccups, each one of them creating a ".a" file in the folder: dng_sdk_1_6/xmp/toolkit/public/libraries/macintosh/intel_64_libcpp/Debug, they are named libXMPFilesStaticDebug.a and libXMPCoreStaticDebug.a respectively.
When I try to build the dng_validate project, I get the following error:
Library not found for -lXMPFilesStaticDebug
Because of the the error starting with an "l" instead of "lib", under both libraries project settings, I changed the "Executable Prefix" setting to "l" instead of "lib". Rebuilt both of them and made sure the file names changed as expected. But the error persists when trying to build the main project.
Under dng_validate's project settings, there is a setting called "Library Search Paths" and it does point to the proper aforementioned folder using a relative path. I even changed it to an absolute path to see if that would make it work.
I am really lost here, does anyone have an idea of what might be causing it?
Well... After asking on other forums and almost hiring a freelancer to fix this for me, I tried another shot in the dark of renaming the library files and it worked.
I changed the extensions of libXMPFilesStaticDebug.a and libXMPCoreStaticDebug.a from ".a" to ".dylib" and it just compiled and blew my mind with it.

Qt static linking in Windows: successful in for one app, but unsuccessful for the other

I have succeeded in creating a statically linked version of an app in Windows. I have (1) compiled Qt statically and (2) compiled my application with the static version of Qt using the Qt Creator (see the documentation, and more in detail the steps I followed). This works great, and I'm able to distribute the app.
Now I'm trying to compile a different app, with the same compiler and settings in Qt Creator, but somehow the .exe ends up dynamically linked....?? Note that I have statically compiled both applications successfully on macOS.
What is going wrong?
I realize that this remains a wide question, but any suggestions are very much welcome.
I have tried so far to add CONFIG+=static to the .pro file (although that was not needed for the first app). Also here this had no effect.

How to properly install OpenGL in VS2010?

I am trying install OpenGL on VS2010.
I use this tutorial.
And I get the following error:
Unable to start program 'C:\Users\s151310\Tutorial 0.3.8\frameworkD.lib'.
The specified file is an unrecognized or unsupported binary format
How can I fix this?
Actually don't have to install anything at all to start OpenGL development with Visual Studio. As long as you limit yourself to OpenGL-1.1 and core Win32 APIs everything is already in place for you.
However to get modern OpenGL features one must use the so called extension mechanism to load pointers to functions of newer versions – a tedious and uninteresting process. Hence extension loader wrappers have been developed.
Also creating a window and setting up a matching OpenGL context is laborous as well. So you want to use some framework for that two.
Extension loader wrappers and frameworks are 3rd party libraries that need to be installed separately.
Unable to start program 'C:\Users\s151310\Tutorial 0.3.8\frameworkD.lib
Why are you trying to execute a library file? This is the framework library that's supposed to be linked into your executables. So this raises the question: How did you setup your project, specifically which build options did you configure. Without that I can't give better advice.

Directx changes

i have a problem with win8 and directx library. i have directx jun 2010 i added its d3dx11.lib and .h files but it doesnt work and says library not found. i found hte link bellow that says you can work with win8 sdk instead of directx libraries and d3dx.... libraries are not supported anymore.
http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275%28v=vs.85%29.aspx
i found in vs2012 there is a project that builds directx proggram but when i made a project with it it wasnt like any directx code ive seen before its more like xna
what these really mean? how should i work with these changes? its better to return to win 7 and previous libraries or work with these new tools. thanks for helping
"Where is the DirectX SDK?" explains that well. Probably you will want to read it one more time.
D3DX
D3DX and D3D is not the same. D3DX is just a helper library. Microsoft not recommends to use D3DX anymore and stripped it from SDK. So now:
For new code: "Living without D3DX" (alternative link) explains what to use instead in your new code. And here are some D3DX replacement stuff.
For old code: if you just want to build old code that uses D3DX (tutorial samples, for example), you just need to install DirectX SDK and add include/lib paths to your project, as if it was any other library. Mixing Windows SDK and DirectX SDK is not recommended and can lead to errors, so don't use it in new code. Also read here.
Probably, you will be interested to read this and that answer also.
P.S. As always, if linker says, "Library not found", double check, that you've added library path to project options and that library file exists at that folder.
Happy coding!

Any way to compile the firebreath as static library?

Now I am trying to develop a browser plugin with firebreath on mac os.
Although I managed to generate a project and eveything went just fine, but
once I move the project generated with the fbgen.py procedure to somewhere
else, it doesn't work any more. Is there any way for me to take use of
firebreath as a static library like many other third party frameworks? Thus
I can link my project to any other library. Someone managed to do this on
windows platform but I failed to get contact with him.
Any kind of advice would be appreciated.
Regards,
Jordan
All the libraries are statically linked to generate the plugin. The project generated by fbgen.py compiles into static libraries from the source which are then linked to for the plugin. You just have to keep your source files for the plugin with you. You can generate the project anywhere you want using the prep** scripts.

Resources