Re: Undefined symbols for architecture arm64


Walter McCreary
 

Thanks, Alex.

My architectures build settings do match yours.

This is an old project, originating in 2009. There are 7 targets, and this behavior is common to at least 2 of them. At least one of them (the newest, from 2014) is okay. So, I’m assuming that the project build settings aren’t problematic.

Since my last email, I tried building the target in question after updating the .LinkFileList by hand, to include the new classes that the linker could not find previously. This worked, and the build for arm64 succeeded (though it did not touch or update the .LinkFileList).

I also tried a build without a .LinkFileList, to see if that would force its generation, but this failed, with the linker complaining that it couldn’t find the file. So, I’m guessing that the compiler must be responsible for generating that list for the linker. Do you know if that’s the case?

Anyway, I decided to just mv the project’s build directory out of the way, to force rebuilding the whole tree. This has tested ok for one of the targets in question - I have not yet tested any of the others.

-Walter

On Jul 19, 2019, at 21:30, Alex Zavatone via Groups.Io <zav=mac.com@groups.io> wrote:

Yeah, in build settings, what are your settings for Valid Architectures?

Just enter Architectures in the search field in Build Settings and that should help.

I’ve got these on one of my projects.

arm64 arm64e armv7 armv7s

Also, for Architectures, do you have this?
$(ARCHS_STANDARD)




On Jul 19, 2019, at 4:48 PM, Walter McCreary <walt@gigs.com> wrote:

Working on an iOS app, implemented in obj-C and C. I recently added a Cocoa touch class to the project, and the app builds and tests fine on iOS 12.2 simulators. However, when attempting to test on an actual device (iPhone X, and iPhone 7+, with iOS 12.3.1) the build fails when linking, with this error:
Undefined symbols for architecture arm64:
“_OBJ_CLASS_$_(the new class)”
ld: Symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1

I have tried adding 3 different classes to the project, each of which works fine on simulators, but fails as above when attempting to test with an actual arm64 device.

Looking at the build files, I find that the problem seems to be that the app’s .LinkFileList file is not being updated in the Objects-normal/arm64 directory (it is using one from February), whereas the x86_64 build (for the simulator) generates a new one at build time. Cleaning the Build Folder via Xcode has no effect.

So, I’m still mucking through this to find the actual root cause. I suppose I could just delete the old .LinkFileList in question, but that wouldn’t seem to solve the problem of why a new one is not being generated for each arm64 build. Are there any Clang settings that would help with this?

-Walter








Join xcode@apple-dev.groups.io to automatically receive all group messages.