Xcode 5 crashes when open external project

hideyuki's icon

Hi all,

Xcode 5 is released today, so I tried to build example projects in SDK 6.1.3.
But, Xcode crashes always when I try to open any projects.
Someone has same issue or any solutions?
Here, I'll attach the crash log.

Thanks.

log.txt
txt
Emmanuel Jourdan's icon

I haven't tested on 10.8 but that looks like the same crash I've with the sea lion. For now you will have to keep using Xcode 4.x.

csaudiodesign's icon

It seems to me that the C74_SYM_LINKER_FLAGS variable in the xcodeconfig gets XCode 5 crashed. Could it be that the maximum length of this config variables changed? There is a lot of data in this variable, I wonder if this could be organized somehow more efficiently ("Flags to enforce some build-time checks for the symbols used while not actually performing a hard link").

Emmanuel Jourdan's icon

That's correct. We'll look into it.

jbm's icon

Any word on this? I seem to be having the same issue (same info in crash log), Xcode 5, external project...

csaudiodesign's icon

The simplest way around the Problem that works for me is to build the project without the additional linker flags (remove them from the configuration), and write the missing links from the error log into the C74_SYM_LINKER_FLAGS configuration variable. Depending on your setup you will need to remove the contents of C74_SYM_LINKER_FLAGS in the MaxMSP SDK distribution. I have my own xcconfig file that overwrites the one from the SDK (specifically this variable).

Luigi Castelli's icon

Has anybody managed to build a Max/MSP example project with Xcode 5?
I did remove C74_SYM_LINKER_FLAGS and now I can open a project without crashing, however I cannot build it. I keep getting this linker error:

Undefined symbols for architecture x86_64:
"_object_method_imp", referenced from:
_main in myobject.o

Has anybody already encountered this issue?
I am on MacOS 10.8.5 using Max/MSP SDK 6.1.3

- Luigi

Emmanuel Jourdan's icon

We have an update SDK coming up soon. In the meantime, if you put the flags in a text file and set the C74_SYM_LINKER_FLAGS to point to that file, you should be able to open Xcode without crashing and even building ;-)

Luigi Castelli's icon

Thanks for your reply Emmanuel,

I did what you suggested. The project opens but it still doesn't compile.
Now the linker cannot find all of the functions specified in the file as flags.

If you have a .xcodeproj file that you can post, that could be of help.
Otherwise I will wait for the release of the new SDK.

Thanks again for your help

- Luigi

Emmanuel Jourdan's icon

You should be able to set the compiler to use Apple LLVM 5.0 and probably mess with the deployment target (you can't build for 10.6 for instance).

csaudiodesign's icon

Hey Luigi,
in the solution I suggested in #266925, you will have to write the missing linker flags (which are reported in the error log after building) into the C74_SYM_LINKER_FLAGS variable, i.e. like this:

C74_SYM_LINKER_FLAGS = -Wl,-U,_atom_getfloat,-U,_atom_getlong,-U,_atom_getsym,-U,_atom_setfloat,-U,_atom_setlong,-U,_atom_setsym and so on

basically you type -U,[name of the symbol that should be linked to],

In the attached xcconfig-file you see another example in the last few lines. Don't just copy the file, it's customized and might not work for your project :)

Cheers

csaudiodesign's icon

For security reasons, I'm not allowed to upload an xcconfig-file... The interesting part of this file looks like this:

C74_SYM_LINKER_FLAGS = -Wl,-U,_atom_getfloat,-U,_atom_getlong,-U,_atom_getsym,-U,_atom_setfloat,-U,_atom_setlong,-U,_atom_setsym,-U,_class_addmethod,-U,_class_new,-U,_class_register,-U,_defer,-U,_error,-U,_gensym,-U,_listout,-U,_locatefile_extended,-U,_object_alloc,-U,_object_error,-U,_object_free,-U,_object_method,-U,_object_post,-U,_object_warn,-U,_open_dialog,-U,_outlet_anything,-U,_outlet_list,-U,_path_toabsolutesystempath,-U,_path_topathname,-U,_qelem_free,-U,_qelem_new,-U,_qelem_set,-U,_systhread_create,-U,_systhread_exit,-U,_systhread_join,-U,_systhread_mutex_free,-U,_systhread_mutex_lock,-U,_systhread_mutex_new,-U,_systhread_mutex_unlock,-U,_object_method_impOTHER_LDFLAGS = "$(C74_SYM_LINKER_FLAGS)"

Cheers

Luigi Castelli's icon

ok, changing the deployment target to 10.8 and adding the missing linker flags did the trick.
Now the project opens and compiles perfectly. Thank you EJ and CSAudioDesign for your help.

Best

- Luigi

Timothy Place's icon

SDK update for Xcode 5 compatibility is now available:
https://cycling74.com/download/MaxSDK-6.1.4.zip
- .. --

jbm's icon

I've updated to the new SDK and although I can now open my older projects without crashing, I can no longer build my projects. I changed my user-defined C74_SYM_LINKER_FLAGS build setting to point to the c74_linker_flags.txt file (my project is an obj-c framework that is "wrapped" by a max external), but Xcode (v5.0.1) complains that the "file was built for unsupported file format"… I don't imagine this should be particularly hard to fix, but I'm a bit stumped. Other than the linker flags build setting, nothing else should have changed in the project, which worked fine in Xcode 4.6.3.

ld: warning: ignoring file /Users/jbmaxwell/Documents/xcode/rubato_git/MusiCog_(optimized)/MusiCog/../../MaxSDK-6.1.1/c74support/max-includes/c74_linker_flags.txt, file was built for unsupported file format ( 0x27 0x2D 0x57 0x6C 0x2C 0x2D 0x55 0x2C 0x5F 0x61 0x64 0x64 0x62 0x61 0x6E 0x67 ) which is not the architecture being linked (x86_64): /Users/jbmaxwell/Documents/xcode/rubato_git/MusiCog_(optimized)/MusiCog/../../MaxSDK-6.1.1/c74support/max-includes/c74_linker_flags.txt
Undefined symbols for architecture x86_64:
"_object_method_imp", referenced from:
-[mcMusiCogController logToMax:] in mcMusiCogController.o
-[mcMusiCogController sendOutputEvent] in mcMusiCogController.o
-[mcMusiCogController finishBang] in mcMusiCogController.o
ld: symbol(s) not found for architecture x86_64

It seems to think I'm trying to link to 32-bit max, but I can't understand why...

Any thoughts appreciated.

J.

Luigi Castelli's icon

@JBM:
If I remember correctly this made somehow the difference in my tests:
C74_SYM_LINKER_FLAGS = @$(C74SUPPORT)/max-includes/c74_linker_flags.txt

Remember to include the @ character before the dollar sign or you will see that error...

- Luigi

jbm's icon

Ah, thanks Luigi. That got me much closer (my framework now compiles!).

However, I'm now getting errors trying to build the external: 'MacTypes.h' file not found.
I've seen the various threads on this, and it seemed to be related to older Carbon stuff, and was purported to be solved by building with the 10.7 base SDK. I didn't have that option in my Xcode 5 install, so I copied over the one from Xcode 4.6.3. It does show up in Xcode, and I can select it, but the build error remains! (Well, that's not entirely true; the error shifted slightly from 'Files.h' not found to 'MacTypes.h' not found… ugh…)

Any idea what else I might try?

jbm's icon

Ugh… okay, I've descended to new levels of hackishness and copied my FlatCarbon folder (from 10.7 sdk) into max-includes. It compiles, and the external works, but any thoughts about avoiding this kind of ugliness in future would still be appreciated.

J.