Linker error building Adobe DNG SDK on MacOS 11 - xcode

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.

Related

Incorporating charls into a MacOS application

Charls is an implementation of the JPEG-LS lossless and near-lossless coder/decoder. I downloaded the source code, built it in Xcode, and ran it on MacOS. From a few tests I ran, it seems to be reliable and very fast.
Now I want to incorporate charls into my application. I added the static library libcharls.a to my Xcode project and added the header file charls.h. When I try to do a build, I get the error: library not found for -lcharls. I then added a path to libcharls.a in the Library Search Paths of the Build Settings for the Project in Xcode. Still get the same error. Anyone have suggestions for getting this to build? TIA.
To answer my own question: adding the path to libcharls.a in Library Search Paths does fix the problem, but you only add the path, but not the file libcharls.a.

wxwidgets platform.h error: no such file or directory wx/setup.h

I am using Code::Blocks with wxwidgets and I have include and lib folders under Document\wxwidgets. I am very new to c++ libraries. In Code::Blocks project initialization, I entered the location for wxwidgets. Then in setting/global enviornment variables I entered in base the Document\wxwidgets again. Still, I am not able to run the app. It shows the error in the include/wx/platform.h file where it says
C:\Users\Programming coder\Documents\wxwidgets\include\wx\platform.h|148|fatal error: wx/setup.h: No such file or directory|
I am not able to solve this and would appreciate some help. Also I checked and the wx folder does not seem to be there in the location. I don't know if that is normal.
Also, I downloaded the headers(include) from the wxwidgets github repo download page, wxWidgets-3.1.1-headers.7z. Any help appreciated.
Also, I am aware some questions exist already, but their problems are in different because most are using linux. Also I am using Code::Blocks IDE.
You need to build wxWidgets itself before building the applications using it. Its build process will create the setup.h file which is currently missing.
Note that, in principle, you could also use precompiled binaries, but in this case you must use exactly the same compiler as was used for compiling them, i.e. TDM gcc.

XCode Project - ld: library not found for -llib

Recently I ran into a CMake problem that can be found in this thread:
Cmake on OSX Yosemite 10.10.3 - GLEW: package 'gl' not found
Eventually it got solved, maybe partly due to my inexperience in XCode and CMake. (I mainly used visual studio to compile projects in the past.)
After the alteration in the linked thread I got warning about my GLEW libs in CMake
(Is this something I should be worried about or is it not important?):
MACOSX_RPATH is not specified for the following targets:
GLEW_MX_shared
GLEW_shared
I simply ignored it and tried to compile my project in XCode with the ALL_BUILD target selected. In the sparky target it said the include files in main could not be found so I added the .h files into the inc folder of my project.
When I compiled again the compiler started complaining again
(I don't know what this error means and how I can fix it.):
ld: library not found for -llib
Googled it for the entire day now and I can't find anything to solve this issue.
It's so frustrating working with XCode as an IDE but I really want to learn more about different platforms and their most popular IDE's so I can make multi platform applications from the start instead of porting it afterwards.
And if it matters I am using OSX Yosemite 10.10.3.
To make my issue easier to understand, I've put a zip of my project on my dropbox.
https://www.dropbox.com/s/xnrh90kuih9ia5a/SPARKY%202.zip?dl=0
Feel free to ask questions if I explained things to briefly and again, thanks to everyone who contributes here. I really learned allot after discovering these forums.
EDIT: Alright I booted up my windows machine, generated a visual studio environment and tried to build it on there. Seems that the same problem also happens here. I looked at the linker attributes/flags and saw a lib.lib file added to the linking process which doesn't look right at all.
When removing the file, the error disappeared and many others arrived! (Which are simply solved by linking the appropriate libs so I wont handle those here.)
I misunderstood the error on my mac and thought it was referring to a random library which I needed to hunt down but actually it's a inconsistency in one of my CMake files.
EDIT2: Now I only have to find out where the lib.lib comes from and how I can ditch the flags from the project so I can generate my environment and build right away!
So moral of the story. Sometimes the solution is right in front of you and still ends up more like looking for a needle in a haystack.
I removed the following from my root CMakeLists.txt file and the random lib.lib library was gone from my generated projects
SET( PROJ_LIBRARIES "lib" )
I thought this added a folder containing libraries but actually what it did was adding another flag for a specific library because this variable was being fed to:
TARGET_LINK_LIBRARIES( ${PROJ_NAME} ${PROJ_LIBRARIES} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} )

Compiling Autotalent v2 Issues with Xcode 5.0.1 and Mavericks

I've been struggling to get Auto Talent from Oli Larkin to compile for some time now. I'm pretty new to Xcode and that may be the issue, but either way I figured I'd see if anyone could help me. I'm trying to compile this in order to make a 64 bit version.
Starting from the top:
I've traced down a few things that I thought were the issues.
Noticed that wdl sdk was missing. Downloaded it from https://github.com/olilarkin/wdl-ol. Added the wdl folder outside of the src folder.
Got some warnings when starting up Xcode 5.0.2. Let Xcode fix them.
Realized that the /Developer/Examples folder doesn't exist in Mavericks. Found https://developer.apple.com/library/mac/samplecode/CoreAudioUtilityClasses/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012328-Intro-DontLinkElementID_2, downloaded the sample code, linked to AUBase as I realized this path needed updating in the AU Build Settings (see screenshot).
iPlug.xcodeproj is in red. Not sure what to do about this. Any ideas? I'm assuming it's important.
Update: Based on the recent comments, I'm now getting somewhere. But, at the moment I'm getting the following errors. This has to do with not having a Lice SDK or something. Is this absolutely needed? If so, do you have the time to elaborate on this and where to get it? Thanks again for all of the help.
It looks like I'm getting another issue as well related to clang. Maybe related to Xcode - Command /Developer/usr/bin/clang failed with exit code 1, not sure.
Note: Before finally getting to the errors above, I had to...
Link CoreMIDI.framework "Frameworks and Libraries" -> "Linked Frameworks" -> App to /System/Library/Frameworks/CoreMIDI.framework.
Set compiler in the build settings to default compiler. Otherwise it said unsupported compiler and threw some warnings. Hopefully this didn't mess anything up.
Rename aeffect.h and aeffectx.h to aeffect.h and aeffectx.h from the VST3 SDK. You can find these files in public.sdk -> source -> vst2.x. Apparently 2.x isn't really supported anymore. After renaming them, I moved them to the VST_SDK folder in WDL as the readme instructed.
the source you have will not compile straight off with recent versions of WDL-OL, since lots has changed. The way to upgrade it is to strip out the pertinent source code (i.e. autotalent.h/cpp and the mayer fft stuff) and re-duplicate one of the template projects in WDL-OL and bring it in to the new folder.
I've done it for you:
https://github.com/olilarkin/autotalent
you can clone this repository into the IPlugExamples folder of WDL-OL, and provided you've put all the SDK files in place it should compile straight off.
oli

Mac Ogre Xcode project can't find headers

While trying to get the template Xcode 4 ogre project to work, the build fails because it can't find OgreCamera.h.
I've installed Ogre to /opt/local/lib/OGRE, and specified that as the Ogre SDK location when creating the Xcode 4 project.
Needless to say, the header and framework include paths in the project settings point exactly to where all the header files are, yet not one of them can be found. I've tried commenting out the include of OgreCamera.h, and upon trying to run, the next include, OgreEntity.h, cannot be found. Commenting that out and running again, the next include can't be found, and so on (these includes are in OgreFramework.h.
I don't understand why these headers, which clearly exist when I go look for them in the Finder or Terminal, can't be found by the project, even when I specify their full path like this:
#include </opt/local/lib/OGRE/lib/release/Ogre.framework/Versions/1.7.4/Headers/OgreCamera.h>
Did I somehow install the Ogre SDK incorrectly? (I copied it from the DMG into placeā€¦)
I had the same problem, and found partial success by following rjstelling's answer from this thread:
why can't Xcode find this header file?
That solved the OgreCamera.h include issues, but now I'm stuck on including the boost libraries. They are not picked up on the search paths, or in the Indexing group as suggested in the thread above.
Basically it looks like a bug in XCode4 that has to be worked around until a patch is released. There is also more information here:
Compile, Build or Archive problems with Xcode 4 (and dependencies)

Resources