• <legend id='ALR0A'><style id='ALR0A'><dir id='ALR0A'><q id='ALR0A'></q></dir></style></legend>

    <tfoot id='ALR0A'></tfoot>
      <bdo id='ALR0A'></bdo><ul id='ALR0A'></ul>
    <i id='ALR0A'><tr id='ALR0A'><dt id='ALR0A'><q id='ALR0A'><span id='ALR0A'><b id='ALR0A'><form id='ALR0A'><ins id='ALR0A'></ins><ul id='ALR0A'></ul><sub id='ALR0A'></sub></form><legend id='ALR0A'></legend><bdo id='ALR0A'><pre id='ALR0A'><center id='ALR0A'></center></pre></bdo></b><th id='ALR0A'></th></span></q></dt></tr></i><div id='ALR0A'><tfoot id='ALR0A'></tfoot><dl id='ALR0A'><fieldset id='ALR0A'></fieldset></dl></div>

        <small id='ALR0A'></small><noframes id='ALR0A'>

      1. 在 Xcode 4.2 和 iOS SDK 5.0 中使用 gcc 4.2

        时间:2023-05-18
        • <bdo id='PZ7q5'></bdo><ul id='PZ7q5'></ul>
            <tbody id='PZ7q5'></tbody>

            <i id='PZ7q5'><tr id='PZ7q5'><dt id='PZ7q5'><q id='PZ7q5'><span id='PZ7q5'><b id='PZ7q5'><form id='PZ7q5'><ins id='PZ7q5'></ins><ul id='PZ7q5'></ul><sub id='PZ7q5'></sub></form><legend id='PZ7q5'></legend><bdo id='PZ7q5'><pre id='PZ7q5'><center id='PZ7q5'></center></pre></bdo></b><th id='PZ7q5'></th></span></q></dt></tr></i><div id='PZ7q5'><tfoot id='PZ7q5'></tfoot><dl id='PZ7q5'><fieldset id='PZ7q5'></fieldset></dl></div>
            <legend id='PZ7q5'><style id='PZ7q5'><dir id='PZ7q5'><q id='PZ7q5'></q></dir></style></legend>

            • <tfoot id='PZ7q5'></tfoot>

              <small id='PZ7q5'></small><noframes id='PZ7q5'>

                1. 本文介绍了在 Xcode 4.2 和 iOS SDK 5.0 中使用 gcc 4.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我今天早些时候刚刚升级到 Xcode 4.2 和 iOS SDK 5.但新编译器似乎一切都不同了.

                  现在有两个Compiler for C/C++/Objective-C"选项,Apple LLVM compiler 3.0"和LLVM GCC 4.2".缺少 GCC 4.2.

                  Apple LLVM 编译器 3.0,构建速度非常快(我喜欢这样),给我 999 多个警告,我的游戏无法再运行.看起来内存有一些差异,并且在加载我们的游戏脚本时会崩溃.

                  LLVM GCC 4.2 太慢了,我仍然无法在 i7 机器上完成一个构建.

                  另外,我们的引擎使用 gcc 命令行来构建(而不是 xcode).

                  那么,这就引出了一个问题,我如何在 Xcode 4.2 中使用 gcc 4.2?这可能吗?

                  解决方案

                  这是一种在 xcode 4.2 中启用 gcc 4.2 编译的方法.其中大部分是通过命令行完成的,所以当你看到这样的行时:[ 15:30 jon@MacBookPro/]$,你需要打开一个 Terminal 并运行$ 之后的命令.

                  <块引用>

                  在这个过程中没有removeddeleted文件或目录,所以如果你以后需要用LLVM编译,很容易撤消.

                  1. 下载 - 但安装 -

                    <小时>

                    [1] 如果从命令行打开(使用类似 viemacsnano、等)确保将路径括在引号 "/long path/with spaces/in it/file.xcspec" 或转义空格 /some/long path/with spaces/in it/file.xcspec

                    [2] 这是必要的,因为 iPhoneOS.platform SDK 有自己单独的 /usr/lib 目录,但 iPhoneSimulator.platform SDK 没有

                    I just upgraded to Xcode 4.2 and iOS SDK 5 earlier today. But everything seems different with new compilers.

                    There are two "Compiler for C/C++/Objective-C" options now, "Apple LLVM compiler 3.0" and "LLVM GCC 4.2". GCC 4.2 is missing.

                    Apple LLVM compiler 3.0, builds really fast(I like that), gives me 999+ warnings, and my game can no longer run. It looks like there's some differences on memory, and it crashes when loading our game's scripts.

                    LLVM GCC 4.2 is so god damn slow, I still cannot finish one build after hours on my i7 machine.

                    And, one more thing is our engine uses gcc command lines to build(instead of xcode).

                    So, it leads to one question, how can I use gcc 4.2 in Xcode 4.2? Is that even possible?

                    解决方案

                    Here is a way to enable compiling with gcc 4.2 in xcode 4.2. Most of this is done via command line so when you see lines like this: [ 15:30 jon@MacBookPro / ]$, you need to open up a Terminal and run the command after the $.

                    No files or directories are removed or deleted in this process, so it is easy to undo if you need to compile with LLVM in the future.

                    1. Download - but do not install yet - xcode_4.1_for_lion.dmg or xcode_4.1_for_snow_leopard.dmg

                    2. Now, follow these steps to install Xcode 4.1 into /Developer-4.1:

                      1. Backup the working /Developer directory (where Xcode 4.2 is installed)

                      2. [ 15:30 jon@MacBookPro / ]$ sudo mv -v /Developer /Developer-4.2
                        

                      3. Run the Xcode 4.1 installer using the default install location (/Developer)

                      4. Move the new Xcode 4.1 installation to /Developer-4.1:

                        [ 15:30 jon@MacBookPro / ]$ sudo mv -v /Developer /Developer-4.1
                        

                      5. Move the Xcode 4.2 developer directory back to /Developer:

                        [ 15:30 jon@MacBookPro / ]$ sudo mv -v /Developer-4.2 /Developer
                        

                    3. Edit the Xcode 4.2 GCC 4.2.xcspec file to get gcc 4.2 to show in the list of compiler options [1]:

                      [ 15:30 jon@MacBookPro / ]$ sudo vi "/Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2 (Plausible Blocks).xcplugin/Contents/Resources/GCC 4.2.xcspec"
                      

                      • Change lines 41 and 42 from this:

                        ShowInCompilerSelectionPopup = NO;
                        IsNoLongerSupported = YES;
                        

                      • To This:

                        ShowInCompilerSelectionPopup = YES; 
                        IsNoLongerSupported = NO;
                        

                    4. Backup the Xcode 4.2 iOS/Simulator Framework usr directories:

                      [ 15:30 jon@MacBookPro / ]$ sudo mv -v /Developer/Platforms/iPhoneOS.platform/Developer/usr /Developer/Platforms/iPhoneOS.platform/Developer/usr.backup
                      [ 15:30 jon@MacBookPro / ]$ sudo mv -v /Developer/Platforms/iPhoneSimulator.platform/Developer/usr /Developer/Platforms/iPhoneSimulator.platform/Developer/usr.backup
                      

                    5. Copy Xcode 4.1 iOS/Simulator Framework usr directories to Xcode 4.2:

                      [ 15:30 jon@MacBookPro / ]$ sudo cp -rv /Developer-4.1/Platforms/iPhoneOS.platform/Developer/usr /Developer/Platforms/iPhoneOS.platform/Developer/usr
                      [ 15:30 jon@MacBookPro / ]$ sudo cp -rv /Developer-4.1/usr /Developer/Platforms/iPhoneSimulator.platform/Developer/usr
                      

                    6. Copy the gcc and info iOS SDK library directories from Xcode 4.1 to Xcode 4.2 [2]:

                      [ 15:30 jon@MacBookPro / ]$ sudo cp -rv /Developer-4.1/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/gcc /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/gcc
                      [ 15:30 jon@MacBookPro / ]$ sudo cp -rv /Developer-4.1/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/info /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/info
                      

                    7. Compile using gcc-4.2!


                    This is a blog post I've written with a little more info about this process. Feel free to leave a comment on the blog if you run into any issues or have any questions.


                    [1] If opening from a command line (using something like vi, emacs, nano, etc) make sure to either enclose the path in quotes "/long path/with spaces/in it/file.xcspec" or escape the spaces /some/long path/with spaces/in it/file.xcspec

                    [2] This is necessary because the iPhoneOS.platform SDK has its own seperate /usr/lib directories but the iPhoneSimulator.platform SDK does not

                    这篇关于在 Xcode 4.2 和 iOS SDK 5.0 中使用 gcc 4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:xcode LLVM 5.1 clang 错误 下一篇:XCode 编译器错误:ld:找不到 -loauth 的库

                  相关文章

                  <legend id='OhQ3R'><style id='OhQ3R'><dir id='OhQ3R'><q id='OhQ3R'></q></dir></style></legend>

                  <small id='OhQ3R'></small><noframes id='OhQ3R'>

                      <bdo id='OhQ3R'></bdo><ul id='OhQ3R'></ul>
                    <tfoot id='OhQ3R'></tfoot>
                    1. <i id='OhQ3R'><tr id='OhQ3R'><dt id='OhQ3R'><q id='OhQ3R'><span id='OhQ3R'><b id='OhQ3R'><form id='OhQ3R'><ins id='OhQ3R'></ins><ul id='OhQ3R'></ul><sub id='OhQ3R'></sub></form><legend id='OhQ3R'></legend><bdo id='OhQ3R'><pre id='OhQ3R'><center id='OhQ3R'></center></pre></bdo></b><th id='OhQ3R'></th></span></q></dt></tr></i><div id='OhQ3R'><tfoot id='OhQ3R'></tfoot><dl id='OhQ3R'><fieldset id='OhQ3R'></fieldset></dl></div>