Compiler

RSS for tag

Discuss the various compiler and toolchain technologies used in development.

Posts under Compiler tag

93 Posts
Sort by:
Post not yet marked as solved
1 Replies
57 Views
I have a playground with multiple sources in a Sources directory in addition to the main Contents.swift. I have been unable to compile & run the playground from the command line. The compiler is unable to resolve any items located in the separate sources and gives multiple error such as contents.swift:8:26: error: cannot find 'JSON' in scope print("JSON rawdata\n\n\(JSON)\n")                          ^~~~ The playground executes successfully from the IDE so the constants & functions etc are declared correctly as Public I have tried swiftc Contents.swift Sources/JSON.swift Sources/Filemanager.swift etc but with no success Where am I going wrong?
Posted
by CSantavy.
Last updated
.
Post not yet marked as solved
2 Replies
312 Views
Hello, I have recently downloaded xcode 14.0 and have attempted to compile applications which were previously compiling in xcode 13. I am encountering a large number of 'circular reference' errors during compilation, but am not being given any further information from xcode than the file they supposedly are occuring in. The 'through reference here' log is attached to line 0, and build logs are offering nothing extra. Many of the files reporting a circular reference are simple structs or files where there is almost definitely no actual circular reference. I have tried restarted my laptop, redownloaded xcode, deleted derived data and cleaned the build, but the errors persist. I have also tried switching the SWFT_COMPILATION_MODE to whole module. The issues are also occuring on another laptop. I am interested in hearing if anyone else is encountering this issue, or if there is anything else worth trying.
Posted
by esmeputt.
Last updated
.
Post not yet marked as solved
5 Replies
5k Views
ARCHIVE FAILED The following build commands failed: CompileC /Users/ankitk/Library/Developer/Xcode/DerivedData/jitsi-meet-ferllufkkwhoynapkghzgrlqsqpx/Build/Intermediates.noindex/ArchiveIntermediates/JitsiMeet/IntermediateBuildFilesPath/app.build/Release-iphoneos/JitsiMeet.build/Objects-normal/arm64/FIRUtilities.o /Users/manishk/Desktop/naya28/jitsi-meet/ios/app/src/FIRUtilities.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
Posted
by mk_manish.
Last updated
.
Post not yet marked as solved
1 Replies
147 Views
Hi, I have some code that relies on CLT for Xcode 13.4. After MacOS pushed the update to CLT for Xcode 14, my compilation routine broke and it took some time to realise that it was due to this recent update. I managed to downgrade CLT to the previous version, but I had to disable automatic updates to avoid the new version being installed again. So the question is, is it possible to stop updates to CLT for Xcode 13.4? Alternatively, is there a way to install two versions of CLT in two separate folders and then use xcode-select -s for the one I need? Thanks! I assume yes (why would we have the option -s then), but I could not find a way to have two different folders though.
Posted
by A5kar.
Last updated
.
Post not yet marked as solved
1 Replies
173 Views
There are quite a few features a C function acquires when defined inside of the @implementation block of an Objective-C class, e.g. it can be accessed before declared: @implementation TDWClass - (void)method { bar(); // the function is accessible here despite not being declared in the code before } void bar(void) { NSLog(@"Test"); } @end Plus it is granted access to the private ivars of the class: @implementation TDWClass { @private int _var; } - (void)foo { bar(self); } void bar(TDWClass *self) { self->_var += 2; // a private instance variable accessed } @end Some sources also say that static variables inside of @implementantion section had special meaning (unlike C static they were private to the enclosing class, not the compilation unit), however I could not reproduce this on my end. Having that said, almost all such features were either deduced or found on third-party sources. I wonder if anything like that is/had ever been documented anywhere, so i can read through full list or special meanings of C statements inside of Objective-C class sections?
Posted Last updated
.
Post not yet marked as solved
0 Replies
143 Views
Hello, I am trying to compile Mathh::Random::MT perl module on my macos Monterey, but it seems that the makefile can't get hold on the sys/types.h file. As I don't have a /usr/include folder I believe that it should look at the /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/sys folder but I don't know how to change it so it compiles correctly (If my hypothesis is right). Any help is much appreciated. Najoua
Posted
by LGPH.
Last updated
.
Post not yet marked as solved
0 Replies
196 Views
I'm writing a simple Command line application on macOS with code using C++, using a API called 'std::to_chars' from charconv void foo(void) {   if (__builtin_available(macOS 10.15, *))   {     char buffer[10];     std::to_chars_result tcr = std::to_chars( buffer, buffer+5, 5 ); #pragma unused (tcr)   }else{     return;   }     } Since Xcode complains main.cpp:19:41: error build: 'to_chars<int, 0>' is unavailable: introduced in macOS 10.15 I wrapped the code with an availability check API in C++, __builtin_available(macOS 10.15, *)) But even with this availability check API, Xcode still failed to compile. Anyone knows why?
Posted Last updated
.
Post not yet marked as solved
18 Replies
1k Views
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
Posted
by fanick.
Last updated
.
Post not yet marked as solved
0 Replies
146 Views
I uploaded my project on Google Drive, now it doesn't compile anymore Hello to all, I hope you are well. I code on a virtual machine (remote use) and I had to put the project in my Google Drive. I downloaded it earlier and I try to compile the file but it shows me these two errors. I read this solution on stack overflow( https://stackoverflow.com/questions/41545658/could-not-determine-generated-file-paths-for-coredata-code-generation ) but I really don't understand it, I'm a beginner, can someone help me please? and I don't know why it tells me that it can't find 'Google Mobile Ads' when I installed it earlier. Please I need help urgently. The application should be ready this Friday.
Posted Last updated
.
Post not yet marked as solved
0 Replies
216 Views
I have a number of performance-intensive tasks that I need to run regularly, such as compiling and linking large programs, and I'd like to see if superpages are of help here. I've had great long-term success with low-level changes to other aspects of the programs, such as the malloc default zone, and would like to see if changing the page size can provide similarly fruitful results. There is some evidence that that may be the case (https://easyperf.net/blog/2022/09/01/Utilizing-Huge-Pages-For-Code#option2-remap-the-code-section-at-runtime and https://xmrig.com/docs/miner/hugepages). However, when I try, mmap(NULL, 2 * 1024 * 1024, PROT_READ, MAP_ANON | MAP_PRIVATE, VM_FLAGS_SUPERPAGE_SIZE_2MB, 0) for example, it always fails. Is there any way to use superpages?
Posted
by meiselsc.
Last updated
.
Post marked as solved
5 Replies
1.4k Views
With the rising amount of assets in the iOS app, the time to compile them is also growing. Is it possible to speed up asset catalog compilation for development purposes only? E.g. perhaps there are shortcuts or build settings to only copy the assets instead of compressing &amp; optimizing them for debug / developer builds.
Posted
by jblahunka.
Last updated
.
Post not yet marked as solved
1 Replies
517 Views
Say I have a MacBook with MacOS Catalina. Could I use it to compile/build apps for newer versions of the operating system like Big Sur? And if so, how far does that go back? For example, could I still use a machine running MacOS X Cheetah (10.0)? My specific problem is concerning the compiling and wrapping of jar files into native .app executables, but I imagine there is a sort of general answer.
Posted
by Cegredev.
Last updated
.
Post not yet marked as solved
1 Replies
732 Views
Hi all ! Just received a brand new mac M1 (macOs Monterey 12.4) with Apple chip. I tried to install some python packages using pip, which always failed when the package need to be compiled. For example, running "pip install python-rapidjson" failed with error message: "ERROR: Failed building wheel for python-rapidjson". Also, there are lots of warnings, such as "warning: type nullability specifier '_Nullable' is a Clang extension [-Wnullability-extension]" (not sure if relevant). I already tried the following steps: reinstall gcc. reinstall xCode and update to the last version (clang version 13.1.6). updating everything installed using brew. Love for your help, Eylon
Posted
by eylonk.
Last updated
.
Post not yet marked as solved
2 Replies
2.4k Views
Hello, I am doing a cross-platform project that uses C++ and OpenGL ( I know I should be using MoltenVK or Metal, but OpenGL is nice and simple for starting out and is cross platform). I am also doing most of my development on a M1 Macbook Pro, which supports up to OpenGL 4.1. The M1 also only supports up to 16 active fragment shader samplers ( maximum number of supported image units) I am currently working on a batch rendering system that uses an array of textures thats uploaded to the GPU and the shader can switch based off of the index into a sampler array. Heres the shader that I am using ( the vertex and fragment shaders are combined, but the program parses them separately) : #type vertex #version 410 core layout(location = 0) in vec3 a_Position; layout(location = 1) in vec4 a_Color; layout(location = 2) in vec2 a_TexCoord; layout(location = 3) in float a_TexIndex; layout(location = 4) in float a_TilingFactor; uniform mat4 u_ViewProjection; out vec4 v_Color; out vec2 v_TexCoord; out float v_TexIndex; out float v_TilingFactor; void main() { v_Color = a_Color; v_TexCoord = a_TexCoord; v_TexIndex = a_TexIndex; v_TilingFactor = a_TilingFactor; gl_Position = u_ViewProjection * vec4(a_Position, 1.0); } #type fragment #version 410 core layout(location = 0) out vec4 color; in vec4 v_Color; in vec2 v_TexCoord; in float v_TexIndex; in float v_TilingFactor; uniform sampler2D u_Textures[16]; void main() { color = texture(u_Textures[int(v_TexIndex)], v_TexCoord * v_TilingFactor) * v_Color; } However, when the program runs I get this message: UNSUPPORTED (log once): POSSIBLE ISSUE: unit 2 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable I double and triple checked my code and im binding everything correctly to the shader (if im not feel free to point it out :), and the only thing I found on the web relating to this error was saying that it was an error within the GLSL compiler on the new M1s. Is this true? Or is it a code issue? Thanks side note: I am using EMACS to run Cmake and do C++ development, so if you try and test my project on Xcode and it doesnt include the shaders its most likely a Cmake/Xcode copy issue.
Posted
by trzroy.
Last updated
.
Post not yet marked as solved
0 Replies
317 Views
Hello My XCode was automatically updated to the version 14.0 and now I can't seem to build my app in any way. I've cleaned every cache possible, I've deleted everything and started clean. I've tried basically everything. To describe my app: It's a main app with a ShareExtension (simply this), built UIKit and SwiftUI. The full error is the following: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/lib/swift/AVFoundation.swiftmodule/arm64-apple-ios.swiftinterface:1:1: error build: Failed to build module 'AVFoundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7 (swiftlang-5.7.0.121.3 clang-1400.0.29)', while this compiler is 'Apple Swift version 5.7 (swiftlang-5.7.0.122.7 clang-1400.0.29)'). Please select a toolchain which matches the SDK. I can't move away from this. Is XCode shipping with outdated binaries? Thank you
Posted Last updated
.
Post marked as solved
5 Replies
15k Views
I had many swift compiler errors of this type : "Cannot find type 'className' in scope" after passing from Xcode 12.5 to Xcode 13. And the error is always referred to Objective-C classes. The project is for an iOS 11 app for iPad. The bridging-header is correctly set and the project with the same build-settings has never given this error before Xcode 13. I'll try to clean the derived data folder without success. the strange thing is project compile successfully and I can run on simulator as well but after few second from a successful compilation on any swift files that use objective-c class is fired the swift compiler error. Any idea? thanks
Posted
by mrcdev.
Last updated
.
Post not yet marked as solved
1 Replies
276 Views
I have a sample code to test c++ virtual deconstructor like below: #include <iostream> class CA { public:   virtual ~CA() {     std::cout<< "~CA" << std::endl;   } }; class CB :public CA {    public:   virtual ~CB() {     std::cout<< "~CB" << std::endl;   } }; int main(int argc, const char * argv[]) {       CA *pb = new CB[3];   delete []pb;       return 0; } in xcode this code print out result is : ~CA ~CA ~CA but in other compilers like visual studio C++ and gcc the print out result is: ~CB ~CA ~CB ~CA ~CB ~CA I think this is a dynamic delete array object with virtual deconstructor bug in xcode compiler 。 because the print result is not conform to C++ form。
Posted Last updated
.
Post not yet marked as solved
0 Replies
432 Views
Hello, I am new to writing Xcode applications. I am trying to add a few frameworks and libraries into Xcode. as mentioned in the following document: https://docs.baslerweb.com/pylonapi/cpp/pylon_programmingguide#common-settings-for-building-applications-with-pylon-macos When I am trying to run the code, the following error appears, the same type of error is also appearing when I am trying to run opencv applications by adding those libraries into my Xcode. Kindly help me with how can I resolve this error as quickly as possible. Library not loaded: @rpath/pylon.framework/Versions/A/pylon   Referenced from: /Users/Username/Library/Developer/Xcode/DerivedData/Pylon_code-abcnbtqdoxsiwldjlsuzgzbiiehb/Build/Products/Debug/Pylon_code   Reason: tried: '/Users/username/Library/Developer/Xcode/DerivedData/Pylon_code-abcnbtqdoxsiwldjlsuzgzbiiehb/Build/Products/Debug/pylon.framework/Versions/A/pylon' (no such file), '/Library/Frameworks/pylon.framework/Versions/A/pylon' (code signature in &lt;8D7F01D7-33D8-33CD-9D80-5E4111B12F2D&gt; '/Library/Frameworks/pylon.framework/Versions/A/pylon' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/Library/Frameworks/pylon.framework/Versions/A/pylon' (code signature in &lt;8D7F01D7-33D8-33CD-9D80-5E4111B12F2D&gt; '/Library/Frameworks/pylon.framework/Versions/A/pylon' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/Library/Frameworks/pylon.framework/Versions/A/pylon' (code signature in &lt;8D7F01D7-33D8-33CD-9D80-5E4111B12F2D&gt; '/Library/Frameworks/pylon.framework/Versions/A/pylon' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Library/Frameworks/pylon.framework/Versions/A/pylon' (no such file) (lldb)  Also, I am facing the following error when I run opencv application in Xcode: dyld[11847]: Library not loaded: /usr/local/opt/opencv/lib/libopencv_gapi.405.dylib Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/OPENCV-gzbfcbghvwzksbemedqwzlposgfn/Build/Products/Debug/OPENCV Reason: tried: '/Users/username/Library/Developer/Xcode/DerivedData/OPENCV-gzbfcbghvwzksbemedqwzlposgfn/Build/Products/Debug/libopencv_gapi.405.dylib' (no such file), '/usr/lib/system/introspection/libopencv_gapi.405.dylib' (no such file), '/usr/local/opt/opencv/lib/libopencv_gapi.405.dylib' (code signature in '/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/lib/libopencv_gapi.405.dylib' (code signature in '/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/lib/libopencv_gapi.405.dylib' (no such file), '/Users/username/Library/Developer/Xcode/DerivedData/OPENCV-gzbfcbghvwzksbemedqwzlposgfn/Build/Products/Debug/libopencv_gapi.4.5.5.dylib' (no such file), '/usr/lib/system/introspection/libopencv_gapi.4.5.5.dylib' (no such file), '/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib' (code signature in '/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/lib/libopencv_gapi.4.5.5.dylib' (code signature in '/usr/local/Cellar/opencv/4.5.5_3/lib/libopencv_gapi.4.5.5.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/lib/libopencv_gapi.4.5.5.dylib' (no such file) Message from debugger: Terminated due to signal 6 Program ended with exit code: 6 Kindly help me with understanding what could be the root cause for such an error and how can I mitigate this.
Posted Last updated
.
Post not yet marked as solved
1 Replies
458 Views
Hello, Her's my configuration : mac os : 12.4 mc book pro m1 pro cpu 8 core 32 go ram hombrew installed : https://brew.sh/ I just wold like to try compile python3.11 https://github.com/python/cpython Here is configure line /configure --with-tcltk-includes="-I/Library/Frameworks/Tcl.framework/Headers -I/Library/Frameworks/Tk.framework/Headers" --with-tcltk-libs="/Library/Frameworks/Tcl.framework/Tcl /Library/Frameworks/Tk.framework/Tk" --enable-optimizations --with-pydebug --build=aarch64-apple-darwin20.2.0 --enable-shared problem : when i run make i get this message : Undefined symbols for architecture arm64:  "_libintl_bindtextdomain", referenced from:    __locale_bindtextdomain_impl in _localemodule.o  "_libintl_dcgettext", referenced from:    __locale_dcgettext_impl in _localemodule.o  "_libintl_dgettext", referenced from:    __locale_dgettext_impl in _localemodule.o  "_libintl_gettext", referenced from:    __locale_gettext_impl in _localemodule.o  "_libintl_setlocale", referenced from:    __locale_setlocale_impl in _localemodule.o    _locale_decode_monetary in _localemodule.o  "_libintl_textdomain", referenced from:    __locale_textdomain_impl in _localemodule.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [Programs/_freeze_module] Error 1 make[2]: *** [build_all_generate_profile] Error 2 make[1]: *** [profile-gen-stamp] Error 2 make: *** [profile-run-stamp] Error 2 clang -arch arm64 -Xlinker -v @(#)PROGRAM:ld PROJECT:ld64-764 BUILD 11:29:07 May 17 2022 configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em Library search paths: /usr/local/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib Framework search paths: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ Undefined symbols for architecture arm64:  "_main", referenced from:    implicit entry/start for main executable ld: symbol(s) not found for architecture arm64 clang: error: linker Could you help me plese to fix this issus Best reagards Battant
Posted
by Battant.
Last updated
.
Post not yet marked as solved
1 Replies
290 Views
Hello, I want to build mobile application for my website https://www.grouptoall.com. I want to ask where or how to start developing application for my website? Which IDE software is best for iPhone app development? Can i develop flutter app? I am new to mobile app development. Please guide me. Thanks
Posted Last updated
.