audio unit fails to run in Logic; .exp _Entry undefined in linker - xcode

Background
I am trying to get Apple's example TremoloUnit to run in Logic 9. From various forums and this SO answer, the problem with Apple's examples seems to be that Logic 9 (and many other AU hosts) use old Carbon resources. According to this technical note, adding an appropriate .r file should provide the needed backwards compatability, so I added a .r that matches the sample .plist.
The Problem
If I include the line _TremoloUnitEntry in my .exp, the linker throws this error:
Undefined symbols for architecture i386:
"_TremoloUnitEntry", referenced from:
-exported_symbol[s_list] command line option
However, if I leave that line out (so that the entire .exp consists of _TremoloUnitFactory), Xcode compiles successfully. The resulting component:
passes auval -32 -v aufx TREM DEMO
runs in AU Lab
is detected by Logic's Audio Units Manager and passes its run of auval, but throws this error:
validation result: successfully validated
updating properties of AU Tremolo (Effect AU) by Apple Sample Code... Failed!
The Question
How can I get the demo AU to run in Logic? Endless Googling and Apple's outdated docs have failed me. (It would really be great if the example projects weren't still broken out of the box...)
System Details
Logic Express 9.1.8 (32 bit)
Xcode 6.2
Mac OS 10.9.5
AU Lab 2.2.2
Update
I wrote a simple gain demo from scratch, and... it works! Kind of. It runs in AU Lab and Logic but doesn't get detected by auval -a. Is there an Xcode project setting that would cause this? I'm new to Xcode and am failing to find a reason why the Apple demo is broken in one way and mine broken in another.

Make sure the only entry in your .exp file is _TremoloUnitFactory. You said you already removed _TremoloUnitEntry, so you should be good.
Next, in the Project Navigator, highlight "Info.plist". Select "View=>Utilities=>Show File Inspector" from the menu. In the File Inspector, under "Target Membership", uncheck "TremoloUnitEntry".
Recompile. That should do it.

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.

trying to work with EDSDK from Canon using Xcode

just tried to install the EDSDK framework into the Xcode project framework folder. However I cannot run anything, as I am getting a lot of error messages. for example at this position in the EDSDK.h file:
EdsUInt32 EDSAPI EdsRetain( EdsBaseRef inRef );
I get the error message:
A parameter list without types is only allowed in a function definition
I get these all over the place. I really would like to make an MacOS app that takes an image and saves an image with a certain name.
The EDSDK should include two sample XCode projects written in Objective-C, namely:
CameraControl -- controlling the camera
RawDevelop -- processing (raw) images downloaded from the camera
If you'd like to skip the Objective-C part, you could bridge this into Swift yourself. Alternatively, have a look at the most recent PowerShot G7X SDK where Swift is used to make a similar example project.

XCode 7 / Cordova plugin / Link issue: _utf8_nextCharSafeBody undefined symbol

I'm adapting an (apparently outdated) Cordova plugin for use in my app (PhoneRTC if you're curious).
As a Linux/CLI guy at heart I've been struggling with XCode for a day, and I managed to iron out most of the deprecated code using a lot of Google and some blind guessing. However, now I'm stuck with a final error during the linking phase:
"Undefined symbols for architechture arm64: "_utf8_nextCharSafeBody", referenced from: [snip]"
The plugin's original installation instructions mention linking the binary to the library libicucore.dylib, but this seems to have been removed in the latest XCode (there are references of the same name with .tbh extensions available but these aren't valid for that dialog - even though I can select them, but whatever).
Some more Googling offered suggestions for linking various *.frameworks instead, but to no avail - the error remains.
Does anyone have any idea what I need to link to to make this function available? Or if it's permanently removed I'd also like to know, although that would involve rebuilding the binaries which wouldn't be something I'm looking forward to...
Or if you don't know, would there be a way to grep through Apple's libraries somehow to see which one is supposed to be defining a missing symbol?
(Needless to say, IF I can get this working it's going to be forked from the original repo and donated back to the community :))
So, I'm not sure what I changed exactly, but suddenly I could add libicucore.tbh as a linked library. I probably changed the build target or something, but in any case the linking error disappeared (to be replaced by a signing error because XCode, but that I can solve).

Linking static library from Xcode into Lazarus app fails on architecture mismatch

Much research here and in-depth exploration via Google links, to no avail.
I've made a simple, one function, static C library with OSX Xcode (5) which I'm trying to link into a Lazarus app, basically to port the Xcode function from Xcode to Lazarus.
Xcode builds the static library alright, and I have what seems to be the proper linkage code in the Lazarus app, as follows:
type
byteptr = ^byte;
const
libname = 'libLORaudio.a';
function LORaudioPlay (fd : longint; audio : byteptr): Integer;
cdecl; external libname;
r := LORaudioPlay(e, z);
All of that compiles just fine, but the build fails with the following messages:
Id: symbol(s) not found for architecture i386
Id: Warning: ignoring file libLORaudio.a, file was built for archive which is not the architecture being linked (i386): libLORaudio.a
(and it goes on to say the function is undefined, of course, since it ignored the library that supplies it.)
My problem could be solved in either of two ways, neither of which have I found sufficient information on, online nor within Xcode or Lazarus.
One solution would be to get Xcode to produce the static library with the architecture expected by Lazarus. I have tried the various options for setting the build architectures in Xcode mentioned in other answers here to similar questions, but it seems I haven't done them correctly because none of them worked for me.
The other solution would be to get Lazarus to accept the architecture produced by Xcode. The Laz.y documentation is not helpful in this regard.
Any suggestions I could try? Thanks so very much for your consideration.
So eventually, I scrounged around with Finder and found where (see below) I had built both the x86_64 and the i386 object files in separate attempts to solve the problem. This was done by changing the build settings for Architectures to 'i386'. Subsequent re-builds for 'x86_64' didn't remove the i386 object info from earlier.
Then I copied the i386 object file into the folder containing the Lazarus project (it was necessary to make the copy with the alt-option dragging method, as copy then paste didn't work).
There, I ran ar on it in Terminal, as: 'ar -r -s libname.a name.o' to build the static lib from the object.
Lazarus now handles the library as desired. (This of course, revealed some other buggy situations to be dealt with, but hey, progress happens.)
Xcode had put both versions of the object in a folder. Find these products from Xcode by right-clicking on the product mentioned in the project navigator and choose 'show in finder'. You can do this for whichever architecture you currently have; both lead to the same build folders. From there work your way back up thru the containing folders until you spot Build. Open that and work your way forward among the contained folders until you get to Objects-normal. In there you'll find folders for i386 and x86_64. Each of those folders contains the corresponding object file as name.o among other product related files.

Qt Creator "The program has unexpectedly finished."

Yesterday I installed Qt Creator and the Qt Library 5.0.1. When I created a new project and wanted to see how it looks, so I build and run the program and I got the following error:
Starting C:\Users\Khaled\workspace_qt\Test-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug\debug\Test.exe...
The program has unexpectedly finished.
C:\Users\Khaled\workspace_qt\Test-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug\debug\Test.exe exited with code -1073741511
I got the same error when I tried to build and run the address book application from the example section.
I looked for other questions here, and I read one that said to check g++ version and to change toolchain from the Build & Run section in the setting, but there is nothing that says toolchain. I also read one where it said to try to chnage between debug and release mode, both didn't work. I also just read a post about using Event Viewer to see the lacking dlls but I couldn't find anything.
Why am I getting this error message and how can I fix it?
Thanks
If you run your application by clicking on it or using cmd (basically not through Qt), you will get a Windows system error informing you of the problem. If you're missing DLL's (which you seem to be), you'll be told which ones, although it will only tell you one at a time.

Resources