I am developing a simple camera JNI interface program in Objc. I managed to compile. But I get the following link error. I use the following command. Is there anything I can add to solve this problem? Note that I use Intel MacMini.
g++ -framework Foundation -framework AVFoundation CameraMacOS.m
Undefined symbols for architecture x86_64:
"_CMVideoFormatDescriptionGetDimensions", referenced from:
_openCamera in CameraMacOS-517c44.o
_listWebcamNamesAndSizes in CameraMacOS-517c44.o
"_CVPixelBufferGetBaseAddress", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferGetBytesPerRow", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferGetHeight", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferGetWidth", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferLockBaseAddress", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
"_CVPixelBufferUnlockBaseAddress", referenced from:
-[CaptureDelegate captureOutput:didFinishProcessingPhoto:error:] in CameraMacOS-517c44.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compiler
RSS for tagDiscuss the various compiler and toolchain technologies used in development.
Posts under Compiler tag
85 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
With Xcode 16 I cant make the Final Cut Extension Workflow work.
I am quite sure I was able to add the Workflow Extension target a couple of months ago in Xcode 15 and did successfully build it, but in Xcode 16 it wont build and it fails with this error:
clang: error: unknown argument: '-e_ProExtensionMain'
I have installed multiple times Workflow Extensions SDK 1.0.2 and even disabled Library validation like its described in the release notes but I dont think thats the problem here.
Seems like clang doesn't have the arguments for it, I guess the SDK should add these but seems like something got messed up - the template shows up fine in Xcode. I reinstalled Xcode and command line tools but that didnt help. Checking clang it really doesnt have the argument. But where does the SDK add this? Xcode seems to be using internal clang and /usr/bin/clang doesn't have it either.
Any tips what could be the problem here? I was not really able to locate the SDK to remove it before trying to install again - any ideas?
Steps to reproduce
Create new project
Add FCP workflow extension target
Build -> it fails
Same behaviour with 16.1 Beta. I am running Sonoma 14.7.
Thanks in advance for any ideas!
Hi there!
Was there a change in Xcode regarding incremental builds / updating an active Simulator with a new build? We use xcodebuild to manage our internal build framework and out of the sudden, incremental builds are not launched anymore and the Simulator is stuck waiting for the new build to be launched. This was not happening for the last 10+ years.
If there is an xcodebuild flag and/or guide of this new behavior, it would help a lot.
Thanks everyone!
I suppose this is a bug in compiler.
Xcode 16.0 (16A242d) - AppStore release version
When building a project from Xcode 15 in Xcode 16, an error occurs:
appintentsmetadataprocessor[12633:13677489] error: At least one halting error produced during export. No AppIntents metadata have been exported and this target is not usable with AppIntents until errors are resolved.
AppShortcut phrases may have at most one parameter, but found phrase, "Set Dark Mode ${darkMode} for Widget ${widget}" with more than one parameter: darkMode, widget
Apparently this is an Xcode bug because I have a production app with this AppShortcut and it works fine in Apple Shortcuts.
Everything is made according to the official WWDC video about AppShortcuts
https://developer.apple.com/videos/play/wwdc2022/10170
after updating to macOS sequoia C++ compiler on vscode is not working is it just me or it is a common issue ?
Hi i am currently using XCode 15 to build a Swift command line application.
But when I try to build & debug my project, it throws an error saying that it could not launch the executable.
It does build but as the error suggests, the Build dir does not have a executable in it. I have messed around with DerivedData & Build location settings for quite a bit with no luck.
Currently both of them are at default settings as I cleared XCode caches from ~/Library/Caches & created a new project. I tried compiling the basic Hello World but that seems to "build" but with no executable.
I have attached the report for the Could not launch error
Error report
Am i missing something with respect to build location / configuration?
Thanks for any assistance.
Hi, I have a workspace with a couple of modules, and now I'm making a Swift package. It's great.
However, i have this SwiftUI View extension you can see at the end of this post. My Swift package needs to have the target set to IOS16, so i have added #available where I need, like I've done in the past.
When i had this extension in my Widget extension target, it worked fine. However, i am now trying to move that into my new Swift package, with the Swift package declaration you can also find below.
When moved, i get an error from the compiler:
Type 'ContainerBackgroundPlacement' has no member 'widget'
It seems that my #available is ignored? I'm at a loss as to why this happens, so if anyone has any ideas i'm all ears. Otherwise guess i'll have to move it back to the Widget extension target :(
My extension code:
extension View {
func widgetBackground(_ color: Color) -> some View {
if #available(iOSApplicationExtension 17.0, *), #available(iOS 17.0, *) {
return containerBackground(color, for: .widget)
} else {
return background(color)
}
}
.....more stuff
}
Swift Package (i renamed and cropped some stuff for simplicity):
import PackageDescription
let package = Package(
name: "MyPackage",
platforms: [
.iOS(.v16)
],
products: [
.library(
name: "MyPackage",
targets: ["MyPackage"]
)
],
targets: [
.target(
name: "MyPackage"
),
.testTarget(
name: "MyPackageTests",
dependencies: ["MyPackage"]
)
]
)
I have an app that uses FrameworkA and FrameworkB.
FrameworkA is simple, i.e., no dependencies.
FrameworkB includes FrameworkA, which is normal. But it also uses pieces of FrameworkA's public interface in its own public interface. Yes, I find that a bit odd... (I didn't make those frameworks... just trying to sort out things...)
Now I am trying to enable Xcode's module verifier for FrameworkB and the problem begins...
FrameworkB can no longer have
#import <FrameworkA/FramworkASomethingSomething.h>
in its public headers.
The modulemap file for FrameworkB currently looks like
framework module FrameworkB {
umbrella header "FrameworkB.h"
export *
module * { export * }
}
Is it possible still use FrameworkA's public interface in FrameworkB's public interface?
And if yes, how is that sorted out in the modulemap?
So far I have tried
framework module FrameworkB {
umbrella header "FrameworkB.h"
export *
module * { export * }
link framework "FrameworkA"
module FrameworkA [system] {
umbrella header "FrameworkA.h"
export *
}
}
But it gives the error
Umbrella header 'FrameworkA.h' not found
Thanks!
Hi I was using Xcode for c++ (for competitive programming purposes, not sure if this is the standard choice but using it anyway)
I included a <bits/stdc++.h> to the include file for XCode.app and they didn't show any error. But then when I ran my code, it showed "Build Succeeded" although no output was visible.
When I was compiling with MacOSX.SDK, these error occurred
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h:796:20: error: unknown type name 'uuid_string_t'; did you mean 'io_string_t'?
char reserved[JIB_RESERVED_SIZE];
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h:787:61: note: expanded from macro 'JIB_RESERVED_SIZE'
#define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/device/device_types.h:89:33: note: 'io_string_t' declared here
typedef char io_string_t[512];
I searched on the Internet and found the similar problem, it seems that there is something wrong with uuid.h. Actually, I do have this head file in my project directory.
Anybody encountered with the same problem ? How to solve this problem?
Our project contains a large amount of OC code. When compiling with Xcode16 beta4, it crashes midway and reports the following error:
error: unexpected service error: The Xcode build system has crashed. Build again to continue.
crash.txt
I have an old project that combines Objective-C with Swift and it is compiling just fine in XCode 15 but is not compiling on XCode 16 Beta 3. There are multiple errors such as:
"could not build module 'UIKit'" "could not build module 'CoreMedia'" "could not build module 'CoreLocation'"
Among the errors there is this one about failing to emit precompiled header in the Bridging header file of the project.
I've tried re-installing XCode 16 Beta 3, re-installing the simulator, restarting the computer and I've also created a sample project that also combines swift and Ojb-c and that one compiles just fine.
Any clues? Thanks!
We use XCode 15.2 to build our application, but we found that the app crashes on iOS 12.1.1, while it works without crashing on iOS 12.5.7. We discovered that the crash is related to ImageLoaderMachO::doModInitFunctions. We're not sure what is causing this.
Hi @all,
I get follow error:
needs -Onone Swift optimization level.
how can I solve this?
thank you for the help
greeting Fabian
Hello All:
I dusted off some old code to bring up to date with the latest and greatest Xcode (16B3) and ran into this weird compile error. Doesn't appear to be actually in my code. The code is in Objective-C (I did say it was old).
In file included from /Volumes/Hard Disk 2/Codewarrior Projects/iCollect For Mac and iPad/iCollect2/Classes/NSImage+Additions.mm:9:
In file included from /Volumes/Hard Disk 2/Codewarrior Projects/iCollect For Mac and iPad/iCollect2/Classes/NSImage+Additions.h:10:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Quartz.framework/Headers/Quartz.h:9:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Quartz.framework/Headers/PDFKit.h:6:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKit.h:21:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFDocument.h:26:53: error: expected identifier or '{'
26 | typedef NS_ENUM(NSUInteger, PDFSelectionGranularity);
| ^
1 error generated.
Any ideas? I understand that Xcode is in beta now and if this is outside of the forum's scope, no problem. If a radar needs to be opened, I'll do that too if required.
Thanks in advance for your time.
All Best
John
During my analysis of the binary size changes after compiling Swift source code, I discovered symbols with the ".island" suffix. I couldn't find meaningful information about this suffix through my search, so I decided to reach out for assistance.
While comparing the changes in binary size after modifying specific code, I noticed a significant increase (from 33MB to 520MB). Upon analyzing the symbols of the enlarged binary using the nm command, I found the following pattern:
t _$s12{SomeSymbol}WOb
t _$s12{SomeSymbol}WOb.island
t _$s12{SomeSymbol}WOb.island2
t _$s12{SomeSymbol}WOb.island3
When I output the symbols of the binary using nm, I noticed many symbols with the same name but different ".island", ".island2", ".island3" suffixes. Disassembling the binary showed that functions with these suffixes simply delegate calls sequentially: x.island3 -> x.island2 -> x.island1 -> x.
It appears that these symbols serve as delegates for function calls, but I would like to understand why such duplicated functions with these suffixes are generated. Could someone help me to provide some insights on this matter?
Building with below imports returns an error. What could I do to mitigate this? I did clean the build cache and delete the derived data folder.
import SwiftData
import SwiftUI
The error:
Command SwiftCompile failed with a nonzero exit code
/Users/thomas/Documents/Projects/SwiftUI/workouts/Workouts/Workouts/Views/Workout/WorkoutView.swift:9:8 No such module '_SwiftData_SwiftUI'
This feedback has also been submitted under: FB14182548
when building my project with Xcode16 Beta, I came across several compile errors in c++ code, which used to be ok when building with Xcode15. It's not easy to fix them because some of them came from third part libraries. Is there a way to configure Xcode to build c++ code conforming to the Xcode 15 manner? (I know I can get back to Xcode15 temporarily, but I worry these issue can not be fixed even in the official release version)
I have a very simple Mac app with just a MTKView in it which shows a single color. I want to move the rendering code to C++. For this I created a C++ framework target which interoperates with the Swift code - main project target. I am trying to link metal-cpp library to the C++ framework target using these instructions. Approach described in this article works with simple C++ Mac console apps. But in my mixed Swift/C++ project Xcode cannot find Foundation/Foundation.hpp (and probably other headers) to include into the C++ header.
I inserted metal-cpp folder into my project and added it to C++ target's header search paths, as written in the instructions.
I had code compiling with C++20 using XCode 14.3.
I now updated to XCode 15.4, and that feature is not available anymore...
No member named 'join' in namespace 'std::ranges::views'
Why is join got dropped?