9 Replies Latest reply on Jan 18, 2015 5:31 PM by Rob Roberts

    Can't compile with Rhodes 5/Xcode 6

    Rob Roberts

      When trying to build at the command line for iphone simulator 7.1 or 8.1 with rhodes 5.0.25 (or 5.0.2) and Xcode 6.1.1 I get these errors:

       

      Undefined symbols for architecture i386:

        "_Init_Extensions", referenced from:

            rho::common::CRhodesApp::RhoJsStart() in libRhodes.a(RhodesApp.o)

            _RhoRubyStart in libRhodes.a(rhoruby.o)

        "_get_app_build_config_item", referenced from:

            -[SimpleMainView init:webView:frame:bar_info:web_bkg_color:] in libRhodes.a(SimpleMainView.o)

            _rho_native_rhopath in libRhodes.a(AppManager.o)

            _rho_native_rhouserpath in libRhodes.a(AppManager.o)

            _rho_native_rhodbpath in libRhodes.a(AppManager.o)

            -[Rhodes doStartUp] in libRhodes.a(Rhodes.o)

            _updateViewRect in libRhodes.a(SplittedMainView.o)

            _rho_rhodesapp_canstartapp in libRhodes.a(RhodesApp.o)

            ...

      ld: symbol(s) not found for architecture i386

       

      Can anyone help on fixing this?

       

      Thanks!

      -- Rob Roberts

        • Re: Can't compile with Rhodes 5/Xcode 6
          Jon Tara

          FWIW, I don't get these errors.

           

          Are you updating from a previous version of either Rhodes or Xcode?

           

          Keep in mind that Rhodes still requires that Xcode be called Xcode.app, even though it does partially use the Xcode path. I've written a little script that does this automatically when you build (in case you have some projects using Xcode 5.1.1 and some using Xcode 6.1.1, but you can do it by hand (if inconveniently).

           

          I renamed unused Xcode versions with their version number, and the active one Xcode.app. Then also go into Xcode menu (or use commad-line code-select) to select the Xcode version to use for command-line build.

            • Re: Can't compile with Rhodes 5/Xcode 6
              Jon Tara

              Did you try with a brand-new, default project?

               

              It might help isolate the problem.

               

              I always do this routinely when testing a new version of Rhodes. For one, it is useful to compare the default generated project from the previous version.

               

              In this case, it would be useful to know if a minimal project builds successfully. Then, you can try to isolate.

                • Re: Can't compile with Rhodes 5/Xcode 6
                  Rob Roberts

                  Hi Jon, thanks for the reply.

                   

                  Yes, I'm upgrading from Rhodes 4.1.1 and Xcode 5.1.1. I've also tried rhodes 5.0.2 and 5.0.25 with Xcode 5.1.1 (for iphone simulator 7.1), and I get the same errors as with Xcode 6.1.1. Everything always worked fine with rhodes 4.1.1 and Xcode 5.1.1 (and earlier versions of both).

                   

                  I did try the rhodes-system-api-samples app with rhodes 5.0.25 and Xcode 6.1.1, and it compiled and came up in the simulator just fine. So that's encouraging! I just need to figure out what's different about my app now...

                   

                  --Rob Roberts

                    • Re: Can't compile with Rhodes 5/Xcode 6
                      Jon Tara

                      That is strange. I can build with any combo of Rhodes 5.0.2, 5.0.25, Xcode 5.1.1/iphone 7.1 Xcode 6.1.1/iPhone 7.1/8.1

                       

                      Caveats:

                       

                      - I do not use either RhoStudio build or Xcode GUI build (which I understand is not currently supported in Rhodes 5.x?). Only command-line build. e.g.

                       

                      rake run:iphone or

                      rake device:iphone:production

                       

                      - The required Xcode is in /Applications and is named XCode.app. (Other version(s) are renamed like Xcode-5.1.1.app, etc.)

                      - You've used either Xcode Settings or xcode-select to choose the required Xcode version for command-line build

                       

                      (I think the build scripts are "almost" there to follow xcode-select setting properly, but there seems to still be some dependency that it be named Xcode.app and perhaps also must be in /Applications).

                       

                      The OS X desktop may give some strange results when you switch the Xcode's around. And similar, more misleading results when you install/re-install multiple versions of Xcode. It might show the "sparkles" indicating a new app on the wrong icon. In fact, it may even temporarily mislabel the icons. You click on, say, Xcode 5.1.1. It runs 6.1.1.  It won't be right until the next reboot, or at least log out/log in.

                       

                      It is easy to corrupt Xcode when installing new versions in parallel. As far as I know, when they release a new version and you install it from the App Store, it will always overwrite the previous "app store" version. Then you need to go download the previous version that the app Store just wiped-out. I haven't found a reliable way other than just letting the App Store version overwrite, and then download and re-install the previous. I would recommend a re-install at this point.

                       

                      e.g. new Xcode, say, 7.0 comes out. Accept the upgrade from the App Store. It will overwrite your Xcode 6.1.1. Now go download 6.1.1 from the developer portal and re-install, of course give it a different name. Sigh, yes it's stupid. Pretty sure you can change the file name during the install, don't recall - if not, then rename or move your Xcode 7.0 temporarily, install 6.1.1, then rename. Then rename or move back 7.0.

                       

                      Now, when, say Xcode 7.1 comes out, you will have to then go download and re-install 7.0. But your 6.1.1 install should be OK. Once installed from the portal site download, it is "forever".

                       

                      It is a pain in the butt. Search for "install multiple Xcode versions". There are various approaches besides mine. Others prefer, for example, to keep each Xcode version in a separate directory. (Then you can keep it called XCode.App) But I think I tried this and ran afoul of some Rhodes requirement that XCode must be found in /Applicaitons.

                       

                      It is all because App Store installs are quite different from normal installs, and there is just no concept of maintaining previous versions of App Store installs.

                        • Re: Can't compile with Rhodes 5/Xcode 6
                          Rob Roberts

                          Thanks for the tips, Jon. I also don't use Rhostudio. I normally compile at the command line using the rake tasks, but after not being able to get that to work with Rhodes 5 I tried compiling in Xcode. (Which also doesn't work, as you mentioned.) I handle new Xcode versions in pretty much the exact way you described. (I didn't know about xcode-select, though, Thanks for mentioning it.) When I want to compile with an older version, say 5.1.1, I temporarily rename the current Xcode.app to something like Xcode_6_1_1 and rename the old version to Xcode.app, and then rename them back again when I'm done. Maybe I've managed to corrupt my Xcode. (But as I mentioned, I get the same compile errors with both Xcode 6.1.1 and 5.1.1.)

                           

                          --Rob Roberts

                  • Re: Can't compile with Rhodes 5/Xcode 6
                    Nicolas Hinze

                    I have had similar link issues. What has fixed this is adding an empty "empty.mm" file to the XCode project. See my answer at bottom of thread here for more detail:

                     

                    Re: Unable to set Deployment Target to iOS 7.0

                    • Re: Can't compile with Rhodes 5/Xcode 6

                      Hi,

                      It looks like your has old iOS project in application folder.

                      Please try to remove [your application folder]/project/iphone/ completely and rebuild application again.