The LLVM compiler is the next-generation compiler introduced in Xcode 3.2 for Snow Leopard based on the open source LLVM.org project.

Posts under LLVM tag

172 Posts

Post

Replies

Boosts

Views

Activity

New compile error in Xcode 14.3: "Mixing declarations and code is incompatible with standards before C99"
Hi, This is a weird one: We have a iOS project that has CorePlot as a sub-project that builds it's .a file that are linked with our binary. Everything worked fine on Xcode 14.2 but building the projects with 14.3 I get a massive amount of errors of this kind: "Mixing declarations and code is incompatible with standards before C99" That relates to declarations that are not at the top a functions and that has been normal for as long as I have written Obj-C. It only happen in the CorePlot files not in our own. I can't find any special differences between the sub-project and the enclosing projects settings. Since it's has worked for years in all older versions of Xcode, I suspect this is something related to 14.3 and perhaps some older project formats? Any ideas to try? I've already messed with the compiler version settings, but both projects had GNU99 set, and changing it would did nothing...
2
0
5.2k
May ’23
LLVM Profile Error: Runtime and instrumentation version mismatch : expected 4, but get 5
While running the unit tests of our iOS project, we encounter the error I mentioned below. We tried with different iOS versions in XCode 13.4.1 and 14 versions, but the result did not change. Because of this error, Coverage.profdata file cannot be created and we cannot obtain coverage data. Has anyone ever encountered such an error or does anyone know how to solve it? We would be glad if you help. Test Suite 'All tests' passed at 2022-10-07 11:25:19.487. Executed 2110 tests, with 0 failures (0 unexpected) in 7.292 (10.705) seconds LLVM Profile Error: Runtime and instrumentation version mismatch : expected 4, but get 5 Failed to merge raw profiles in directory /Users/*** /Build/Intermediates.noindex/CodeCoverage/ProfileData/7FFCA33C-01FF-46BE-923D-A1A0CCF11A16 to destination /Users/*** /Build/Intermediates.noindex/CodeCoverage/ProfileData/7FFCA33C-01FF-46BE-923D-A1A0CCF11A16/Coverage.profdata: Aggregation tool '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-profdata' failed with exit code 1: warning: /Users/*** /Build/Intermediates.noindex/CodeCoverage/ProfileData/7FFCA33C-01FF-46BE-923D-A1A0CCF11A16/B5268FD3-2A23-4CA3-BE5F-AEFA9869C8ED-14839.profraw: failed to uncompress data (zlib) error: no profile can be merged
2
0
2.1k
Apr ’23
"failed to emit precompiled header" error
I'm using the newest Xcode(v9.2) and getting this error<unknown>:0: error: failed to emit precompiled header '/Users/me/Library/Developer/Xcode/DerivedData/Fresh2-eugsmsynpsltschevftirypojuqv/Build/Intermediates.noindex/PrecompiledHeaders/Bridge-swift_ZYI7U6U05XJ7-clang_53GTILGSD4G9.pch' for bridging header '/Users/me/Documents/xcode/Fresh2/Bridge.h'I've tried reinstalling xcode and starting an entirely new project with the same code pasted but that didn't improve the issue. I have no idea what is causing this issue; I've tried the suggestions on this pagehttps://stackoverflow.com/questions/46293028/xcode-9-failed-to-emit-precompiled-header?noredirect=1&lq=1but that didn't improve the situation.I would really appreciate any support.
4
0
22k
Apr ’23
Clang defaults override user-specified warning flags
Clang apparently adds some default flags to every run, and sometimes these take precedence over user-specified flags. For example, I compiled the following program with clang -Wgnu main.c: /* main.c */ int main(int argc, char *argv[]) { const int foo = 42; switch (argc) { case foo: return 5; } return 0; } Using foo in the switch case is illegal because it isn't a constant expression, but gcc has a feature so that it is. The -Wgnu flag enables warnings when any of these GNU features are used, including the one being used here: constant folding (-Wgnu-folding-constant). I expected to see the warning, "expression is not an integer constant expression; folding it to a constant is a GNU extension". However, I don't see any warning at all, despite passing the -Wgnu flag. Even with the -Weverything flag, the warning still does not show. Only when explicitly specifying the -Wgnu-folding-constant flag does the warning show, which sort of defeats the purpose of having -Wgnu at all. Running clang with the verbose flag (-v) sheds more light on the issue (large portions of uninteresting output elided): $ clang -v -Wgnu main.c Apple clang version 13.1.6 (clang-1316.0.21.2.3) Target: arm64-apple-darwin21.4.0 ... "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx12.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all ... -v ... -Wgnu -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant ... -x c main.c ... The output above shows the final command being passed to the frontend. You can find the -v and -Wgnu injected amidst a bunch of ceremony, and you'll also notice that eventually following the -Wgnu is a -Wno-gnu-folding-constant, the culprit for why this particular warning is hidden. If you specify -Wgnu-folding-constant, the disable mysteriously disappears from the end of the command. I'd like to know where these default flags are coming from, and how to disable them if possible.
3
0
2.1k
Apr ’23
Type UITextField has no member padding
Expected to connect to ContentView which is my View module with the code below. What can I get rid of, add, or edit? import Foundation import SwiftUI struct ContentView: View { @State private var searchQuery = "" @State private var searchResult: SearchResult? var body: some View { VStack { UITextField .padding() .background(Color.gray.opacity(0.2)) .cornerRadius(10) .padding() Button(action: { Task { do { let resultData = try await queryAPI(for: searchQuery) searchResult = try JSONDecoder().decode(SearchResult.self, from: resultData) } catch { print("Error: \(error)") } } }) { Text("Search") .padding() .foregroundColor(.white) .background(Color.blue) .cornerRadius(10) } if let result = searchResult { Text(result.answer) .padding() } } } func queryAPI(for query: String) async throws -> Data { let url = URL(string: "https://example.com/search?q=\(query)")! let (data, _) = try await URLSession.shared.data(from: url) return data } } struct SearchResult: Codable { let query: String let answer: String }
2
0
1.1k
Apr ’23
Getting (arm64) could not find object file symbol for every symbol in static library
Hi! I've recently upgraded to XCode 14.3RC and am getting the warning (arm64) could not find object file symbol for symbol for virtually every symbol found in my C++ static library linked to my app. For the C++ lib compilation and app build I haven't changed anything, this seems to be coming with the new XCode version. I've searched literally everything on the web regarding this issue, however nothing was useful: tried comparing the .o file paths in both versions of my built C++ lib (the one compiled with apple clang 14.0.0 and the one compiled with 14.0.3) Dumped the debug info with dwarfdump, the debug symbols seem to be there Tried pre-linking the object files Nothing seemed to work so far, still trying to find the difference(s) between the two versions ... I target arm64 btw. Did something change in Apple Clang with the new XCode regarding the compilation? Am I missing something? Thanks! Edit: I forgot to mention I upgraded from XCode 14.0.1 and was using Apple Clang 14.0.0 when compiling the static lib.
6
5
4k
Mar ’23
C++14 integer literal separator causes AppleClang error
On AppleClang 14.0.0, this code... #include <iostream> #define EXPECT_EQ(x, y) int main() { const int foo = 6'765; std::cout << foo << '\n'; EXPECT_EQ(6'765, 6'765); } ...causes a compile error: test/src/main.cpp:8:19: warning: missing terminating ' character [-Winvalid-pp-token] const int foo = 6'765; ^ test/src/main.cpp:8:19: error: expected ';' at end of declaration const int foo = 6'765; ^ ; test/src/main.cpp:10:24: error: too few arguments provided to function-like macro invocation EXPECT_EQ(6'765, 6'765); ^ test/src/main.cpp:5:9: note: macro 'EXPECT_EQ' defined here #define EXPECT_EQ(x, y) ^ test/src/main.cpp:10:2: error: use of undeclared identifier 'EXPECT_EQ' EXPECT_EQ(6'765, 6'765); ^ With clang-16 out, clang-format now supports IntegerLiteralSeparator, which actively adds these digit separators on a codebase: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#integerliteralseparator By the way, according to cppreference.com, AppleClang should be supporting this: https://en.cppreference.com/w/cpp/compiler_support/14 Is this issue just for me, or does AppleClang really not work with these integer literal separators at the moment?
1
1
1.1k
Mar ’23
Compilation Issues with Xcode 14 for <vector> <map> <iostream> etc.
I'm trying to compile with a brand new install of Xcode 14. A very simple .cpp and .h for testing. The .h has: #include "mcut.h" #include <stdio.h> #include <stdlib.h> The .cpp has: #include "MCut_Wrapper.hpp" #include <iostream> I know this doesn't do anything.... but with the #include When I compile I suddenly get: No member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'? No member named 'memmove' in namespace 'std::1'; did you mean simply 'memmove'?_ etc. without the #include everything compiles without any errors. The same errors show up for any #includes such as etc. I've also tried adding using namespace std; But that doesn't work. I've tried a simple hello world program like this: #include "MCut_Wrapper.hpp" #include <iostream> #include <vector> #include <string> using namespace std; int main() { vector<string> msg{"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"}; for (const string& word : msg) { cout << word << " "; } cout << endl; } But it also throws out the same error. Any and all assistance to get this working would be appreciated. I'm attempting to make a bundle with Xcode 14 on a machine with an M2 Max Chip (if that makes any difference). Cheers
1
0
2.5k
Mar ’23
strip not stripping certain symbols
I'm a bit confused with a static library that I'm using... Consider this code : static ContentManager& getInstance() { static ContentManager cm; return cm; } Now I have told Xcode to strip "Non-Global Symbols." But if I run nm on the library (piped through c++filt) I'll see various versions of: 000000000001b900 D ContentManager::getInstance()::cm ...in files which call ContentManager::getInstance. cm should be non-global, so it should be stripped, right? Or am I missing something? My only thought is that optimization may inlining that somehow, but if I turn off optimization (-O0) it still shows up. This is in Xcode 14.1 but I believe we had a similar issue with Xcode 12-ish.
0
0
891
Mar ’23
Cannot figure out a very basic issue...
Hello everyone. I've been dealing with this issue for over a month on my M1 MBP. I'm using CLion for C++. I cannot get any program I write to compile with g++/gcc. I have taken the following steps to remedy the issue: Update CLion, Reinstall CLion, Update and Reinstall CommandLineTools, Reinstall MacOS, reset the computer to default. I've tried everything I can think of to get this to behave how it was originally. The issue started when I updated to MacOS Ventura. I deeply, deeply regret upgrading at this point but have no way of going back. This is a very basic program I've written to demonstrate the issue. int main() { welcome(); } void welcome(){ std::cout << "Hello world"; } void welcome(); Very, very basic. The issue is that every single time I try to do g++ main.cpp, I get the following error. "welcome()", referenced from: _main in main-fbb48c.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
2
0
1.5k
Mar ’23
How to report bug on Apple clang ?
Hello, How would you report bugs on the Apple clang compiler on macOS? I have a found an invalid code generation bug with clang on arm64e platform. Code generation bugs are particularly dangerous (well, this one crashes the application and you can spot it quite rapidly). I initially reported it to the LLVM open source team here: https://github.com/llvm/llvm-project/issues/60239 But the team refused to take Apple-related topics and the report was closed. They said to go to https://developer.apple.com/bug-reporting/ Now, this link just redirects to the "Apple Feedback" utility. So, I re-entered the report in this utility (report #FB11965434) two weeks ago. But I have no response, no news, not even some automatic acknowledgement in any form. Since the "Apple Feedback" utility seems more end-user oriented ("hey, this button has the wrong color"), I wonder if the report will simply fall into oblivion. Any alternative or more technical way of reporting compiler bugs? Thanks -Thierry
4
1
1.3k
Feb ’23
ld: unsupported tapi file type '!tapi-tbd' in YAML file
I'm trying to compile a fortran code on macOS Ventura v 13.1 (22C65) on my MacBook pro (M1) using gfortran. However, I get the following error when linking: ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libSystem.tbd' for architecture arm64 collect2: error: ld returned 1 exit status I have tried brew upgrade llvm brew upgrade gcc sudo rm -rf /Library/Developer/CommandLineTools xcode-select --install and also to install a downgrade version from https://developer.apple.com/download/more/, but nothing seems to work. Any suggestions?
4
6
7.5k
Feb ’23
Xcode 14 update has bugs and my code in c++ is not compiling with memory issues.
Earlier my C++ was working on Xcode 13 versions but when updated to Xcode 14 it is now returning various errors (seems memory errors). The same code is compiling on other platforms such as windows and in online compilers. Error:- 0 0x1029141a0 __assert_rtn + 140 1 0x10279ba8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x10276dd38 mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 3 0x1027d64ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468 4 0x1027d9360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56 5 0x188b381f4 _dispatch_client_callout2 + 20 6 0x188b4b954 _dispatch_apply_invoke + 224 7 0x188b381b4 _dispatch_client_callout + 20 8 0x188b49a04 _dispatch_root_queue_drain + 680 9 0x188b4a104 _dispatch_worker_thread2 + 164 10 0x188cf8324 _pthread_wqthread + 228 A linker snapshot was created at: /tmp/solution-2022-09-14-105028.ld-snapshot ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061. collect2: error: ld returned 1 exit status Code : #include<bits/stdc++.h> using namespace std; #define int long long int #define vi vector<int> #define pii pair<int,int> #define fast() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define all(x) begin(x),end(x) #define rep(x,a,b) for(int x = a;x<(b+1);x++) #define F first #define S second const long long inf = 1e18, mod = 1e9 + 7; int pw(int x, int y, int p = mod) { if (y == 0) return 1; if (y == 1) return x; int res = pw(x, y / 2); if (y & 1) return ((res * res) % p * x) % p; return (res * res) % p; } int nu(vi & suff, int l, int r){ int n = suff.size(); int ans = suff[l] - ((r<n-1)?suff[r+1]:0); int di = pw(10, n-r-1); ans = (ans*pw(di, mod-2))%mod; return ans; } void test_case() { string s; cin>>s; int n = s.size(); int w,m; cin>>w>>m; vi suff(n+1,0); suff[n] = s[n-1]-'0'; for(int i = n-2;i>=0;i--){ suff[i+1] = ((s[i]-'0')*pw(10,n-i-1) + suff[i+2])%mod; } map<int, pii> mp; for(int i = n-w+1;i>0;i--){ int t = nu(suff, i, i+w-1)%9; mp[t] = {i, (mp.count(t)>0?mp[t].F:0)}; } while(m--){ int l,r,k; cin>>l>>r>>k; int ans1 = inf, ans2 = inf; rep(j,0,8){ int l1 = mp[j].F; int v = nu(suff, l, r); int p = (j*v)%9; int x = (k-p+9)%9; int l2 = mp[x].F; if(l2==l1) l2 = mp[x].S; if(l1>0 and l2>0){ if(l1<ans1){ ans1 = l1; ans2 = l2; }else if(l1==ans1){ ans2 = min(ans2, l2); } } } if(ans1<inf and ans2<inf){ cout<<ans1<<" "<<ans2<<endl; } else cout<<"-1 -1"<<endl; } } int32_t main() { fast(); int tt = 1; cin >> tt; for(int i = 1;i<=tt;i++) { // cout<<"Case #"<<i<<": "; test_case(); } return 0; } Give input to code: 5 1003004 4 1 1 2 1 179572007 4 2 2 7 3 2 7 4 111 2 1 2 2 6 0000 1 2 1 4 0 1 4 1 484 1 5 2 2 0 2 3 7 1 2 5 3 3 8 2 2 6
20
3
9.3k
Feb ’23
-fmodules prevents building against private copy of ncurses
Ventura, Xcode 14.2 + CLTs The macOS SDK currently ships ncurses 5. If you want to build your project against a private copy of ncurses 6, and also use modules, that seems to be impossible. Here's a reduced test case that illustrates the problem. Create a file named moduletest.c: #include &lt;ncurses.h&gt; int main(void) { beep(); return 0; } Install ncurses 6 headers into a directory alongside, called ncurses6/include. Compile like so: clang -c -fmodules -I./ncurses6/include moduletest.c This results in a number of errors like this: In file included from moduletest.c:1: ./ncurses6/include/ncurses.h:684:45: error: conflicting types for 'keyname' extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);              /* implemented */                                             ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ncurses.h:598:45: note: previous declaration is here extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);              /* implemented */                                             ^ This seems to be happening because when ./ncurses6/include/ncurses.h includes some standard C headers, having modules enabled somehow causes /usr/include/ncurses.h to be included as well. Building without -fmodules works fine. Building without -I./ncurses6/include also works fine for this simple test case, of course, because you just get the system ncurses. I've also seen basically the opposite problem, where importing system frameworks like Cocoa will indirectly include /usr/include/ncurses.h, and that will then include ./ncurses6/include/unctrl.h instead of /usr/include/unctrl.h, which of course also results in errors. I haven't been able to come up with a reduced test case to repro the latter yet. These seem like they must be bugs in the SDK or clang. What's the best way to get progress on a fix started? Open an issue at llvm.org? Apple Feedback report? Paid developer support incident? Anyone know a good workaround in the meantime?
0
0
974
Feb ’23
XCode 13 issue - Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
Good day everyone. Have problems with xcode 13 (worst update i've ever seen). On xcode 12.5.1 all works fine and run with no issues on real devices iOS 14/15. But on xcode 13.0 i faced strange things. Runing/building on device/TestFlight and getting crash: Thread 1: EXC_BAD_ACCESS (code=1, address=0x10) In place where all must be right. titleLbl.attributedText = nil All variables are alive and we have access to it in console. About crash place: It's view in UICollectionViewCell and code called from prepareForReuse in mainThread. Everything must be ok. But... If i comment this line, we'll crash in another place with label and attr string. And etc. On XC12 all works fine on iOS 14/15. No issues. Attaching screen and parts of code from trace. Can anyone help me with this? Please. Shorted path of call - only main points: # - 1  override func layoutSubviews() {             reload_fromLayout = true             super.layoutSubviews() ... } # - 2 collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) .... # - 3 override func prepareForReuse() {         super.prepareForReuse()         content.prepareForReuse()     } # - 4 - final crash point func prepareForReuse() {         storeView.prepareForReuse()         giftView.prepareForReuse()         marker_data = nil     } # - 5 func prepareForReuse() {         store_data = nil         imageView.image = nil         titleLbl.attributedText = nil         distanceView.prepareForReuse()     } code-block
5
0
8.1k
Feb ’23
Confusion in command line tools
I know about GCC and G++. GCC is for compiling C programs, and G++ is for compiling C++ programs, both created and are part of GNU. But I have three misunderstandings. 1, I don't know what is the difference between clang-llvm and clang. 2, I have heard about GPP as well, and I am confused about the difference between G++ and GPP, please explain to me like I'm a child. 3, I know a few compilers: the first one is GCC, the second is Clang, and the third is MSVC. Now here is when the confusion kindles, I heard that apple have created their own compiler, and if I wanted to install GCC and G++, I don't know how to install it, if I install command line tools, I am sure it will install Apple's compilers, but the things is that GCC and G++ are not made by Apple.
3
0
1.5k
Feb ’23
CoreFoundation/CFString.h missing
Hello, I am trying to compile a different version of ruby using RVM but I keep getting the error message that &lt;CoreFoundation/CFString.h&gt; is missing. I've been searching for almost a week for a solution to this problem. Please reply with what information would be helpful so I can provide more information.I have triedxcode-select --installI am on Mojave 10.14.4I am using homebrew, and here is what happens when I type brew config:ORIGIN: https://github.com/Homebrew/brewHEAD: 1337da0f891aebb85accb094d63e401da1b53cbaLast commit: 6 days agoCore tap ORIGIN: https://github.com/Homebrew/homebrew-coreCore tap HEAD: 893d2b0451b482af8ed944e04577d6e8a590f8f8Core tap last commit: 9 hours agoHOMEBREW_PREFIX: /usr/localHOMEBREW_LOGS: /Users/nfgallimore/Library/Logs/HomebrewCPU: dodeca-core 64-bit kabylakeHomebrew Ruby: 2.3.7 =&gt; /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/rubyClang: 10.0 build 1000Git: 2.17.2 =&gt; /Applications/Xcode.app/Contents/Developer/usr/bin/gitCurl: 7.54.0 =&gt; /usr/bin/curlJava: 10.0.2, 1.6.0_65-b14-468macOS: 10.14.4-x86_64CLT: 10.2.0.0.1.1552586384Xcode: 10.1CLT headers: 10.2.0.0.1.1552586384This is my stackoverflow post:https://stackoverflow.com/questions/55525660/installing-ruby-2-3-1-on-mojave-osx-with-rbenv-or-rvm/55526292#55526292The error occurs when I typervm install 2.3.7Here is the make_log:[2019-04-10 12:50:20] __rvm_make__rvm_make (){ \make "$@" || return $?}current path: /Users/nfgallimore/.rvm/src/ruby-2.3.7PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/sbin:/usr/local/opt/ruby/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/nfgallimore/bin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/nfgallimore/.rvm/bincommand(2): __rvm_make -j12++ make -j12 CC = gcc LD = ld LDSHARED = gcc -dynamiclib CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin18 -I./include -I. DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/nfgallimore/.rvm/rubies/ruby-2.3.7/lib/libruby.2.3.0.dylib -compatibility_version 2.3 -current_version 2.3.7 -fstack-protector -Wl,-u,_objc_msgSend -framework Foundation -fstack-protector -Wl,-u,_objc_msgSend -framework Foundation SOLIBS = -lpthread -lgmp -ldl -lobjcConfigured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1Apple LLVM version 10.0.0 (clang-1000.11.45.5)Target: x86_64-apple-darwin18.5.0Thread model: posixInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bintranslating probes probes.dcompiling main.ccompiling dmydln.ccompiling miniinit.ccompiling dmyext.ccompiling miniprelude.ccompiling bignum.ccompiling class.ccompiling compar.ccompiling complex.ccompiling dir.ccompiling dln_find.ccompiling encoding.ccompiling enum.c. ./vm_opts.hcompiling enumerator.ccompiling error.ccompiling eval.ccompiling load.ccompiling proc.ccompiling file.cfile.c:23:10: fatal error: 'CoreFoundation/CFString.h' file not found#include &lt;CoreFoundation/CFString.h&gt; ^~~~~~~~~~~~~~~~~~~~~~~~~~~eval.c:776:8: warning: unused variable 'mid' [-Wunused-variable] ID mid = me-&gt;called_id; ^1 error generated.make: *** [file.o] Error 1make: *** Waiting for unfinished jobs....1 warning generated.++ return 2
2
0
3.6k
Jan ’23
New compile error in Xcode 14.3: "Mixing declarations and code is incompatible with standards before C99"
Hi, This is a weird one: We have a iOS project that has CorePlot as a sub-project that builds it's .a file that are linked with our binary. Everything worked fine on Xcode 14.2 but building the projects with 14.3 I get a massive amount of errors of this kind: "Mixing declarations and code is incompatible with standards before C99" That relates to declarations that are not at the top a functions and that has been normal for as long as I have written Obj-C. It only happen in the CorePlot files not in our own. I can't find any special differences between the sub-project and the enclosing projects settings. Since it's has worked for years in all older versions of Xcode, I suspect this is something related to 14.3 and perhaps some older project formats? Any ideas to try? I've already messed with the compiler version settings, but both projects had GNU99 set, and changing it would did nothing...
Replies
2
Boosts
0
Views
5.2k
Activity
May ’23
LLVM Profile Error: Runtime and instrumentation version mismatch : expected 4, but get 5
While running the unit tests of our iOS project, we encounter the error I mentioned below. We tried with different iOS versions in XCode 13.4.1 and 14 versions, but the result did not change. Because of this error, Coverage.profdata file cannot be created and we cannot obtain coverage data. Has anyone ever encountered such an error or does anyone know how to solve it? We would be glad if you help. Test Suite 'All tests' passed at 2022-10-07 11:25:19.487. Executed 2110 tests, with 0 failures (0 unexpected) in 7.292 (10.705) seconds LLVM Profile Error: Runtime and instrumentation version mismatch : expected 4, but get 5 Failed to merge raw profiles in directory /Users/*** /Build/Intermediates.noindex/CodeCoverage/ProfileData/7FFCA33C-01FF-46BE-923D-A1A0CCF11A16 to destination /Users/*** /Build/Intermediates.noindex/CodeCoverage/ProfileData/7FFCA33C-01FF-46BE-923D-A1A0CCF11A16/Coverage.profdata: Aggregation tool '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-profdata' failed with exit code 1: warning: /Users/*** /Build/Intermediates.noindex/CodeCoverage/ProfileData/7FFCA33C-01FF-46BE-923D-A1A0CCF11A16/B5268FD3-2A23-4CA3-BE5F-AEFA9869C8ED-14839.profraw: failed to uncompress data (zlib) error: no profile can be merged
Replies
2
Boosts
0
Views
2.1k
Activity
Apr ’23
"failed to emit precompiled header" error
I'm using the newest Xcode(v9.2) and getting this error&lt;unknown&gt;:0: error: failed to emit precompiled header '/Users/me/Library/Developer/Xcode/DerivedData/Fresh2-eugsmsynpsltschevftirypojuqv/Build/Intermediates.noindex/PrecompiledHeaders/Bridge-swift_ZYI7U6U05XJ7-clang_53GTILGSD4G9.pch' for bridging header '/Users/me/Documents/xcode/Fresh2/Bridge.h'I've tried reinstalling xcode and starting an entirely new project with the same code pasted but that didn't improve the issue. I have no idea what is causing this issue; I've tried the suggestions on this pagehttps://stackoverflow.com/questions/46293028/xcode-9-failed-to-emit-precompiled-header?noredirect=1&amp;lq=1but that didn't improve the situation.I would really appreciate any support.
Replies
4
Boosts
0
Views
22k
Activity
Apr ’23
Clang defaults override user-specified warning flags
Clang apparently adds some default flags to every run, and sometimes these take precedence over user-specified flags. For example, I compiled the following program with clang -Wgnu main.c: /* main.c */ int main(int argc, char *argv[]) { const int foo = 42; switch (argc) { case foo: return 5; } return 0; } Using foo in the switch case is illegal because it isn't a constant expression, but gcc has a feature so that it is. The -Wgnu flag enables warnings when any of these GNU features are used, including the one being used here: constant folding (-Wgnu-folding-constant). I expected to see the warning, "expression is not an integer constant expression; folding it to a constant is a GNU extension". However, I don't see any warning at all, despite passing the -Wgnu flag. Even with the -Weverything flag, the warning still does not show. Only when explicitly specifying the -Wgnu-folding-constant flag does the warning show, which sort of defeats the purpose of having -Wgnu at all. Running clang with the verbose flag (-v) sheds more light on the issue (large portions of uninteresting output elided): $ clang -v -Wgnu main.c Apple clang version 13.1.6 (clang-1316.0.21.2.3) Target: arm64-apple-darwin21.4.0 ... "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx12.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all ... -v ... -Wgnu -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant ... -x c main.c ... The output above shows the final command being passed to the frontend. You can find the -v and -Wgnu injected amidst a bunch of ceremony, and you'll also notice that eventually following the -Wgnu is a -Wno-gnu-folding-constant, the culprit for why this particular warning is hidden. If you specify -Wgnu-folding-constant, the disable mysteriously disappears from the end of the command. I'd like to know where these default flags are coming from, and how to disable them if possible.
Replies
3
Boosts
0
Views
2.1k
Activity
Apr ’23
Type UITextField has no member padding
Expected to connect to ContentView which is my View module with the code below. What can I get rid of, add, or edit? import Foundation import SwiftUI struct ContentView: View { @State private var searchQuery = "" @State private var searchResult: SearchResult? var body: some View { VStack { UITextField .padding() .background(Color.gray.opacity(0.2)) .cornerRadius(10) .padding() Button(action: { Task { do { let resultData = try await queryAPI(for: searchQuery) searchResult = try JSONDecoder().decode(SearchResult.self, from: resultData) } catch { print("Error: \(error)") } } }) { Text("Search") .padding() .foregroundColor(.white) .background(Color.blue) .cornerRadius(10) } if let result = searchResult { Text(result.answer) .padding() } } } func queryAPI(for query: String) async throws -> Data { let url = URL(string: "https://example.com/search?q=\(query)")! let (data, _) = try await URLSession.shared.data(from: url) return data } } struct SearchResult: Codable { let query: String let answer: String }
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’23
Getting (arm64) could not find object file symbol for every symbol in static library
Hi! I've recently upgraded to XCode 14.3RC and am getting the warning (arm64) could not find object file symbol for symbol for virtually every symbol found in my C++ static library linked to my app. For the C++ lib compilation and app build I haven't changed anything, this seems to be coming with the new XCode version. I've searched literally everything on the web regarding this issue, however nothing was useful: tried comparing the .o file paths in both versions of my built C++ lib (the one compiled with apple clang 14.0.0 and the one compiled with 14.0.3) Dumped the debug info with dwarfdump, the debug symbols seem to be there Tried pre-linking the object files Nothing seemed to work so far, still trying to find the difference(s) between the two versions ... I target arm64 btw. Did something change in Apple Clang with the new XCode regarding the compilation? Am I missing something? Thanks! Edit: I forgot to mention I upgraded from XCode 14.0.1 and was using Apple Clang 14.0.0 when compiling the static lib.
Replies
6
Boosts
5
Views
4k
Activity
Mar ’23
Xcode App build succeed but suddenly closed when launch app
I just use for M2 Macbook recently. But when app launch automacally closed this app, and I don't any no idea what is trouble for xcode of simulator or Apple silicon. Ref video is below here. https://www.facebook.com/100027753875559/videos/1645964632513492/ Any people came up same issue?? What's the problem??
Replies
0
Boosts
0
Views
705
Activity
Mar ’23
C++14 integer literal separator causes AppleClang error
On AppleClang 14.0.0, this code... #include <iostream> #define EXPECT_EQ(x, y) int main() { const int foo = 6'765; std::cout << foo << '\n'; EXPECT_EQ(6'765, 6'765); } ...causes a compile error: test/src/main.cpp:8:19: warning: missing terminating ' character [-Winvalid-pp-token] const int foo = 6'765; ^ test/src/main.cpp:8:19: error: expected ';' at end of declaration const int foo = 6'765; ^ ; test/src/main.cpp:10:24: error: too few arguments provided to function-like macro invocation EXPECT_EQ(6'765, 6'765); ^ test/src/main.cpp:5:9: note: macro 'EXPECT_EQ' defined here #define EXPECT_EQ(x, y) ^ test/src/main.cpp:10:2: error: use of undeclared identifier 'EXPECT_EQ' EXPECT_EQ(6'765, 6'765); ^ With clang-16 out, clang-format now supports IntegerLiteralSeparator, which actively adds these digit separators on a codebase: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#integerliteralseparator By the way, according to cppreference.com, AppleClang should be supporting this: https://en.cppreference.com/w/cpp/compiler_support/14 Is this issue just for me, or does AppleClang really not work with these integer literal separators at the moment?
Replies
1
Boosts
1
Views
1.1k
Activity
Mar ’23
Compilation Issues with Xcode 14 for <vector> <map> <iostream> etc.
I'm trying to compile with a brand new install of Xcode 14. A very simple .cpp and .h for testing. The .h has: #include "mcut.h" #include <stdio.h> #include <stdlib.h> The .cpp has: #include "MCut_Wrapper.hpp" #include <iostream> I know this doesn't do anything.... but with the #include When I compile I suddenly get: No member named 'memcpy' in namespace 'std::__1'; did you mean simply 'memcpy'? No member named 'memmove' in namespace 'std::1'; did you mean simply 'memmove'?_ etc. without the #include everything compiles without any errors. The same errors show up for any #includes such as etc. I've also tried adding using namespace std; But that doesn't work. I've tried a simple hello world program like this: #include "MCut_Wrapper.hpp" #include <iostream> #include <vector> #include <string> using namespace std; int main() { vector<string> msg{"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"}; for (const string& word : msg) { cout << word << " "; } cout << endl; } But it also throws out the same error. Any and all assistance to get this working would be appreciated. I'm attempting to make a bundle with Xcode 14 on a machine with an M2 Max Chip (if that makes any difference). Cheers
Replies
1
Boosts
0
Views
2.5k
Activity
Mar ’23
Enable C++23 features in latest Xcode beta
I notice new C++ 23 features such as the multi subscript operator overload mentioned in Xcode beta release notes, but I don’t see a way to enable C++ 23 in the build flags. What is the correct flag, or is C++ 23 unusable in Apple Clang?
Replies
1
Boosts
0
Views
2.1k
Activity
Mar ’23
strip not stripping certain symbols
I'm a bit confused with a static library that I'm using... Consider this code : static ContentManager& getInstance() { static ContentManager cm; return cm; } Now I have told Xcode to strip "Non-Global Symbols." But if I run nm on the library (piped through c++filt) I'll see various versions of: 000000000001b900 D ContentManager::getInstance()::cm ...in files which call ContentManager::getInstance. cm should be non-global, so it should be stripped, right? Or am I missing something? My only thought is that optimization may inlining that somehow, but if I turn off optimization (-O0) it still shows up. This is in Xcode 14.1 but I believe we had a similar issue with Xcode 12-ish.
Replies
0
Boosts
0
Views
891
Activity
Mar ’23
How to enable BFloat16 data type?
When compile source with __bf16 variable, it throw exception, "__bf16 is not supported on this target". The compiler is xcode build-in clang-1400.0.29.202. Is Apple silicon support bf16 type?
Replies
2
Boosts
0
Views
3.1k
Activity
Mar ’23
Cannot figure out a very basic issue...
Hello everyone. I've been dealing with this issue for over a month on my M1 MBP. I'm using CLion for C++. I cannot get any program I write to compile with g++/gcc. I have taken the following steps to remedy the issue: Update CLion, Reinstall CLion, Update and Reinstall CommandLineTools, Reinstall MacOS, reset the computer to default. I've tried everything I can think of to get this to behave how it was originally. The issue started when I updated to MacOS Ventura. I deeply, deeply regret upgrading at this point but have no way of going back. This is a very basic program I've written to demonstrate the issue. int main() { welcome(); } void welcome(){ std::cout << "Hello world"; } void welcome(); Very, very basic. The issue is that every single time I try to do g++ main.cpp, I get the following error. "welcome()", referenced from: _main in main-fbb48c.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Replies
2
Boosts
0
Views
1.5k
Activity
Mar ’23
How to report bug on Apple clang ?
Hello, How would you report bugs on the Apple clang compiler on macOS? I have a found an invalid code generation bug with clang on arm64e platform. Code generation bugs are particularly dangerous (well, this one crashes the application and you can spot it quite rapidly). I initially reported it to the LLVM open source team here: https://github.com/llvm/llvm-project/issues/60239 But the team refused to take Apple-related topics and the report was closed. They said to go to https://developer.apple.com/bug-reporting/ Now, this link just redirects to the "Apple Feedback" utility. So, I re-entered the report in this utility (report #FB11965434) two weeks ago. But I have no response, no news, not even some automatic acknowledgement in any form. Since the "Apple Feedback" utility seems more end-user oriented ("hey, this button has the wrong color"), I wonder if the report will simply fall into oblivion. Any alternative or more technical way of reporting compiler bugs? Thanks -Thierry
Replies
4
Boosts
1
Views
1.3k
Activity
Feb ’23
ld: unsupported tapi file type '!tapi-tbd' in YAML file
I'm trying to compile a fortran code on macOS Ventura v 13.1 (22C65) on my MacBook pro (M1) using gfortran. However, I get the following error when linking: ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libSystem.tbd' for architecture arm64 collect2: error: ld returned 1 exit status I have tried brew upgrade llvm brew upgrade gcc sudo rm -rf /Library/Developer/CommandLineTools xcode-select --install and also to install a downgrade version from https://developer.apple.com/download/more/, but nothing seems to work. Any suggestions?
Replies
4
Boosts
6
Views
7.5k
Activity
Feb ’23
Xcode 14 update has bugs and my code in c++ is not compiling with memory issues.
Earlier my C++ was working on Xcode 13 versions but when updated to Xcode 14 it is now returning various errors (seems memory errors). The same code is compiling on other platforms such as windows and in online compilers. Error:- 0 0x1029141a0 __assert_rtn + 140 1 0x10279ba8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x10276dd38 mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148 3 0x1027d64ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468 4 0x1027d9360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56 5 0x188b381f4 _dispatch_client_callout2 + 20 6 0x188b4b954 _dispatch_apply_invoke + 224 7 0x188b381b4 _dispatch_client_callout + 20 8 0x188b49a04 _dispatch_root_queue_drain + 680 9 0x188b4a104 _dispatch_worker_thread2 + 164 10 0x188cf8324 _pthread_wqthread + 228 A linker snapshot was created at: /tmp/solution-2022-09-14-105028.ld-snapshot ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061. collect2: error: ld returned 1 exit status Code : #include<bits/stdc++.h> using namespace std; #define int long long int #define vi vector<int> #define pii pair<int,int> #define fast() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define all(x) begin(x),end(x) #define rep(x,a,b) for(int x = a;x<(b+1);x++) #define F first #define S second const long long inf = 1e18, mod = 1e9 + 7; int pw(int x, int y, int p = mod) { if (y == 0) return 1; if (y == 1) return x; int res = pw(x, y / 2); if (y & 1) return ((res * res) % p * x) % p; return (res * res) % p; } int nu(vi & suff, int l, int r){ int n = suff.size(); int ans = suff[l] - ((r<n-1)?suff[r+1]:0); int di = pw(10, n-r-1); ans = (ans*pw(di, mod-2))%mod; return ans; } void test_case() { string s; cin>>s; int n = s.size(); int w,m; cin>>w>>m; vi suff(n+1,0); suff[n] = s[n-1]-'0'; for(int i = n-2;i>=0;i--){ suff[i+1] = ((s[i]-'0')*pw(10,n-i-1) + suff[i+2])%mod; } map<int, pii> mp; for(int i = n-w+1;i>0;i--){ int t = nu(suff, i, i+w-1)%9; mp[t] = {i, (mp.count(t)>0?mp[t].F:0)}; } while(m--){ int l,r,k; cin>>l>>r>>k; int ans1 = inf, ans2 = inf; rep(j,0,8){ int l1 = mp[j].F; int v = nu(suff, l, r); int p = (j*v)%9; int x = (k-p+9)%9; int l2 = mp[x].F; if(l2==l1) l2 = mp[x].S; if(l1>0 and l2>0){ if(l1<ans1){ ans1 = l1; ans2 = l2; }else if(l1==ans1){ ans2 = min(ans2, l2); } } } if(ans1<inf and ans2<inf){ cout<<ans1<<" "<<ans2<<endl; } else cout<<"-1 -1"<<endl; } } int32_t main() { fast(); int tt = 1; cin >> tt; for(int i = 1;i<=tt;i++) { // cout<<"Case #"<<i<<": "; test_case(); } return 0; } Give input to code: 5 1003004 4 1 1 2 1 179572007 4 2 2 7 3 2 7 4 111 2 1 2 2 6 0000 1 2 1 4 0 1 4 1 484 1 5 2 2 0 2 3 7 1 2 5 3 3 8 2 2 6
Replies
20
Boosts
3
Views
9.3k
Activity
Feb ’23
-fmodules prevents building against private copy of ncurses
Ventura, Xcode 14.2 + CLTs The macOS SDK currently ships ncurses 5. If you want to build your project against a private copy of ncurses 6, and also use modules, that seems to be impossible. Here's a reduced test case that illustrates the problem. Create a file named moduletest.c: #include &lt;ncurses.h&gt; int main(void) { beep(); return 0; } Install ncurses 6 headers into a directory alongside, called ncurses6/include. Compile like so: clang -c -fmodules -I./ncurses6/include moduletest.c This results in a number of errors like this: In file included from moduletest.c:1: ./ncurses6/include/ncurses.h:684:45: error: conflicting types for 'keyname' extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);              /* implemented */                                             ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ncurses.h:598:45: note: previous declaration is here extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);              /* implemented */                                             ^ This seems to be happening because when ./ncurses6/include/ncurses.h includes some standard C headers, having modules enabled somehow causes /usr/include/ncurses.h to be included as well. Building without -fmodules works fine. Building without -I./ncurses6/include also works fine for this simple test case, of course, because you just get the system ncurses. I've also seen basically the opposite problem, where importing system frameworks like Cocoa will indirectly include /usr/include/ncurses.h, and that will then include ./ncurses6/include/unctrl.h instead of /usr/include/unctrl.h, which of course also results in errors. I haven't been able to come up with a reduced test case to repro the latter yet. These seem like they must be bugs in the SDK or clang. What's the best way to get progress on a fix started? Open an issue at llvm.org? Apple Feedback report? Paid developer support incident? Anyone know a good workaround in the meantime?
Replies
0
Boosts
0
Views
974
Activity
Feb ’23
XCode 13 issue - Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
Good day everyone. Have problems with xcode 13 (worst update i've ever seen). On xcode 12.5.1 all works fine and run with no issues on real devices iOS 14/15. But on xcode 13.0 i faced strange things. Runing/building on device/TestFlight and getting crash: Thread 1: EXC_BAD_ACCESS (code=1, address=0x10) In place where all must be right. titleLbl.attributedText = nil All variables are alive and we have access to it in console. About crash place: It's view in UICollectionViewCell and code called from prepareForReuse in mainThread. Everything must be ok. But... If i comment this line, we'll crash in another place with label and attr string. And etc. On XC12 all works fine on iOS 14/15. No issues. Attaching screen and parts of code from trace. Can anyone help me with this? Please. Shorted path of call - only main points: # - 1  override func layoutSubviews() {             reload_fromLayout = true             super.layoutSubviews() ... } # - 2 collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) .... # - 3 override func prepareForReuse() {         super.prepareForReuse()         content.prepareForReuse()     } # - 4 - final crash point func prepareForReuse() {         storeView.prepareForReuse()         giftView.prepareForReuse()         marker_data = nil     } # - 5 func prepareForReuse() {         store_data = nil         imageView.image = nil         titleLbl.attributedText = nil         distanceView.prepareForReuse()     } code-block
Replies
5
Boosts
0
Views
8.1k
Activity
Feb ’23
Confusion in command line tools
I know about GCC and G++. GCC is for compiling C programs, and G++ is for compiling C++ programs, both created and are part of GNU. But I have three misunderstandings. 1, I don't know what is the difference between clang-llvm and clang. 2, I have heard about GPP as well, and I am confused about the difference between G++ and GPP, please explain to me like I'm a child. 3, I know a few compilers: the first one is GCC, the second is Clang, and the third is MSVC. Now here is when the confusion kindles, I heard that apple have created their own compiler, and if I wanted to install GCC and G++, I don't know how to install it, if I install command line tools, I am sure it will install Apple's compilers, but the things is that GCC and G++ are not made by Apple.
Replies
3
Boosts
0
Views
1.5k
Activity
Feb ’23
CoreFoundation/CFString.h missing
Hello, I am trying to compile a different version of ruby using RVM but I keep getting the error message that &lt;CoreFoundation/CFString.h&gt; is missing. I've been searching for almost a week for a solution to this problem. Please reply with what information would be helpful so I can provide more information.I have triedxcode-select --installI am on Mojave 10.14.4I am using homebrew, and here is what happens when I type brew config:ORIGIN: https://github.com/Homebrew/brewHEAD: 1337da0f891aebb85accb094d63e401da1b53cbaLast commit: 6 days agoCore tap ORIGIN: https://github.com/Homebrew/homebrew-coreCore tap HEAD: 893d2b0451b482af8ed944e04577d6e8a590f8f8Core tap last commit: 9 hours agoHOMEBREW_PREFIX: /usr/localHOMEBREW_LOGS: /Users/nfgallimore/Library/Logs/HomebrewCPU: dodeca-core 64-bit kabylakeHomebrew Ruby: 2.3.7 =&gt; /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/rubyClang: 10.0 build 1000Git: 2.17.2 =&gt; /Applications/Xcode.app/Contents/Developer/usr/bin/gitCurl: 7.54.0 =&gt; /usr/bin/curlJava: 10.0.2, 1.6.0_65-b14-468macOS: 10.14.4-x86_64CLT: 10.2.0.0.1.1552586384Xcode: 10.1CLT headers: 10.2.0.0.1.1552586384This is my stackoverflow post:https://stackoverflow.com/questions/55525660/installing-ruby-2-3-1-on-mojave-osx-with-rbenv-or-rvm/55526292#55526292The error occurs when I typervm install 2.3.7Here is the make_log:[2019-04-10 12:50:20] __rvm_make__rvm_make (){ \make "$@" || return $?}current path: /Users/nfgallimore/.rvm/src/ruby-2.3.7PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/sbin:/usr/local/opt/ruby/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/nfgallimore/bin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/nfgallimore/.rvm/bincommand(2): __rvm_make -j12++ make -j12 CC = gcc LD = ld LDSHARED = gcc -dynamiclib CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin18 -I./include -I. DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/nfgallimore/.rvm/rubies/ruby-2.3.7/lib/libruby.2.3.0.dylib -compatibility_version 2.3 -current_version 2.3.7 -fstack-protector -Wl,-u,_objc_msgSend -framework Foundation -fstack-protector -Wl,-u,_objc_msgSend -framework Foundation SOLIBS = -lpthread -lgmp -ldl -lobjcConfigured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1Apple LLVM version 10.0.0 (clang-1000.11.45.5)Target: x86_64-apple-darwin18.5.0Thread model: posixInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bintranslating probes probes.dcompiling main.ccompiling dmydln.ccompiling miniinit.ccompiling dmyext.ccompiling miniprelude.ccompiling bignum.ccompiling class.ccompiling compar.ccompiling complex.ccompiling dir.ccompiling dln_find.ccompiling encoding.ccompiling enum.c. ./vm_opts.hcompiling enumerator.ccompiling error.ccompiling eval.ccompiling load.ccompiling proc.ccompiling file.cfile.c:23:10: fatal error: 'CoreFoundation/CFString.h' file not found#include &lt;CoreFoundation/CFString.h&gt; ^~~~~~~~~~~~~~~~~~~~~~~~~~~eval.c:776:8: warning: unused variable 'mid' [-Wunused-variable] ID mid = me-&gt;called_id; ^1 error generated.make: *** [file.o] Error 1make: *** Waiting for unfinished jobs....1 warning generated.++ return 2
Replies
2
Boosts
0
Views
3.6k
Activity
Jan ’23