probs compiling in xcode

Jul 27, 2011 at 12:36pm

probs compiling in xcode

hello!
i’m quite new in making externals for max with xcode.
i installed xcode and the sdk things correctly i think.
then i have opened an existing project to see if i can build an external object (.mxo). i’ve added all the frameworks too.
in one of the uploaded pictures you can see which files are in my projects.
but when i click build xcode creates a file with the extension .mxo but it is only 4kb big. and i can’t open it in max (as you can see it in another picture)
all the messages from xcode and max are attached as well.
i really don’t know what to do now that xcode builds up a correct mxo file.
maybe some of you know what to do.
it would be really amazing if someone could help me.
thank you very much!
moali

[attachment=167504,2472] [attachment=167504,2473] [attachment=167504,2474]

Attachments:
  1. 3.png
#58208
Jul 27, 2011 at 1:03pm

The line ‘pbxcp: st: No such file or directory’ suggest that there’s some reference to something called ‘st’ somewhere in your settings. AFAIK pbxcp is an internal stuff of XCode that copies referenced files into the bundle, so for some reason it thinks that you have a file called ‘st’ which, in fact, you don’t have.

#209032
Jul 27, 2011 at 2:24pm

thanks for your reply!
but i don’t really know where i can find this file “st”.
i have looked in the settings but can’t find anything.
would it help to add a picture of my settings?
thanks a lot!

#209033
Jul 27, 2011 at 11:22pm

hey!
i've choosen another way.
i created a project exactly like this post:
http://cycling74.com/2005/10/05/writing-externals-with-xcode-22/
but i get the following errors: see picture!
the only difference is that i am using xcode 3.0
i'm trying to compile a mxo file now for 3 days but without success.
it would be amazing if somebody could help me out.
thank you!
moali

[attachment=167543,2476]

Attachments:
  1. 4.png
#209034
Jul 28, 2011 at 5:30am

Hello,

“symbol(s) not found”

- have you properly add the MaxAPI.frameworks ?

“Framework Search Paths”
“User Header Search Path”
“Library Search Path”

HTH

#209035
Jul 28, 2011 at 11:01am

Hi,

the post you’ve linked is from 2005. Did you try just downloading the most recent SDK and the most recent documentation (which AFAIK is included in the SDK), and just trying to compile one of the example projects that you can find in the SDK? If not, please make sure that you’re able to compile at least one of the example projects that came with the SDK (you should be able to compile these without any modification). If you succeed with that, you should copy one of the example projects and replace the example code with your own.

Best,
Ádám

#209036
Jul 28, 2011 at 1:55pm

hey ádám!
i’ve downloaded sdk 5.1.7. i think this should be the latest version
but what is afaik? do i need that?
i tell you what i did for the external setup.
i copied the c74support folder into /Library/Frameworks/c74support
i also copied the folder MaxAPI.framework into /Library/Frameworks/
because for now i’m really confused where to put that stuff in.
but i think this should be the right directory.
then i have the whole sdk-5.1.7. folder on my desktop from where i’m opening the example patches. but i’m always getting a lot of errors.
for example i opened the simplemax xcodeproject. no file in the project is red marked so i think everything should be fine. but when i want to compile that i get 11 errors and 1 warning. (the errors are like the picture from my last post)
i think the problem is’nt that big but for now i don’t really know which path or which file i should change. maybe you know what to do.
thanks a lot for your help!
moali

#209037
Jul 28, 2011 at 2:15pm
#209038
Jul 28, 2011 at 2:23pm

Hello,

do NOT move NOTHING from the maxSDK folder (c74support’s folder for instance) and build.

#209039
Jul 28, 2011 at 2:23pm

oops.

#209040
Jul 28, 2011 at 2:54pm

i don’t really understand the sentense with not and nothing.
but it doesn’t depend on that where the framework is located.
or what do you mean?
fact is, that xcode recognizes the maxapiframework but i still get the errors mentioned in the 4.png file some post above.

#209041
Jul 28, 2011 at 3:45pm

Hello,

i mean that after downloaded the SDK you don’t have any folder to move to build examples inside ;

because, in the “maxmspsdk.xconfig” file you can read :

C74SUPPORT = $(SRCROOT)/../../c74support
HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon “$(C74SUPPORT)/max-includes” “$(C74SUPPORT)/msp-includes”
FRAMEWORK_SEARCH_PATHS = “$(C74SUPPORT)/max-includes” “$(C74SUPPORT)/msp-includes”
DSTROOT = $(SRCROOT)/../../sdk-build

so if you move “c74support” folder, you will have to change accordingly search path in the
“Build/Edit Active Target …” settings.

HTH

#209042
Jul 28, 2011 at 11:02pm

so the thing is that i just have to download the sdk and put the folder wherever i want?
and i don’t have to change any paths or stuff like that?
and especially the line: HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon “$(C74SUPPORT)/max-includes” “$(C74SUPPORT)/msp-includes”
in this folder on my computer there are no header files or do i have to ignore this line.
and don’t you know what my errors mean in the file 4.png?
i’m really sorry that i’m so lame but i’m relly becoming desperate because i’m repeating this process on and on.
thanks for your help! i really really appreciate that!

#209043
Jul 29, 2011 at 5:34am

Hello,

So the thing is that i just have to download the sdk and put the folder wherever i want?
and i don’t have to change any paths or stuff like that?
and especially the line: HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon “$(C74SUPPORT)/max-includes” “$(C74SUPPORT)/msp-includes”

Yes.

In this folder on my computer there are no header files or do i have to ignore this line.

Ignore everything as long as it works ;-)

Are you speaking about /Developer/Headers/FlatCarbon ?

Don’t you know what my errors mean in the file 4.png?

- most of time look at just the end of the error log ;
- here : “symbol(s) not found” ; AFAIK : means that the linker doesn’t find “proper compiled functions to assemble the stuff” ;
- type “class_new” or “obex_object_store” in your finder search engine ; do not care about “.c” files but only “.h” files ; (on my computer : “ext_obex.h” “jit.common.h” “ftmext.h”) ; opening “ext_obex.h” you see that all missing symbols referred to this file.
- so why maxMSP headers are not in your project search path ? You should have moved something.

A/ maybe it’s time to download again the sdk and try to build an exemple without changing anything. If you still have any problem … see you on the forum ;-)
B/ move back “c74support” folder in “MaxSDK-5.1.7″ folder.
C/ manually add the path of “max-includes” folder to your project search path (be sure to change the proper settings -Debug/Release- -Edit Project Settings/Edit Active Target-).

Post scriptum : i’m Xcode 2.5

#209044
Jul 29, 2011 at 5:12pm

hey!
it seems that i have just some something wrong in my paths.
i found the file “ext_obex.h” and changed a little bit in the paths.
exactly i only changed the symbol ” before and after the path and then i only got 1 error left (in the picture 6.png)
i also posted a little picture of my project settings: maybe it's easier to find the mistake on that way (5.png)
thank you so much for your patience so far!
moali

[attachment=167686,2484] [attachment=167686,2485]

Attachments:
  1. 6.png
#209045
Jul 29, 2011 at 5:39pm

Hello,

just 1 error, but a big one : “framework not found” ;-)

1. what is the filepath for the “c74support” folder in your computer ?

2. have a try with “maxSDK-5.1.7″ NOT on the desktop in case of.

(You often get headache quickly with search path problems …)

HTH

#209046
Jul 29, 2011 at 5:46pm

Hello again,

3. maybe it’s time to throw everything and download the SDK again ;-)

#209047
Jul 30, 2011 at 10:17pm

hey!
i did what you said. downloaded the sdk again and placed it directly on the hard drive. AND…it works. i don’t receive any errors.
i just opened an example xcodeproject and built the project.
a mxo-file has been generated but it has only 4kb.
and when i include all the examples in the file path in max and want to add an object the max window says: no such object.
when i looked at the size of the thresh.mxo file fore example. this file has 41kb on my computer. but the external i built just 4kb.
so another problem but i think the success can’t be that far away.
thanks so much for your help so far!
moali

#209048
Jul 31, 2011 at 5:20am

Hello moali,

In Xcode there is an “Installation Directory” setting to choose the folder where to put build product ; for instance create a folder “sdk-build” in “maxSDK-5.1.7″ and just set the file path to “/” ; as it you can include only this folder in maxMSP searchPath ; indeed not very important, but good to know ;-)

#209049
Jul 31, 2011 at 9:50am

hey!
that’ what i already did.
when i type in the first letters in max, max gives me a preview of which objects begin with these letters so i think max can find the object but cannot load it.
as is said i think the problem is inside xcode. because the built external is only 4kb big and not for instace 41kb when i look at the thresh.mxo file in my original max folder which comes with the original max.
so maybe there is something wrong in xcode. but when i build it i get no errors
hope you know what i mean.
thank you!

#209050
Jul 31, 2011 at 11:04am

Hello,

very strange never happened for me …
… while i’m a bug expert ;-)

1. which version of Xcode do you use ?

2. are you used with “Terminal.app” ?
- Yes : maybe use “nm” to have a clue.
- No : zip and post your 4kb .mxo !

HTH.

#209051
Jul 31, 2011 at 12:04pm

hey!
my version of xcode is 3.0
and i’m not that used with the terminal so here is my zip file:
thanks!

Attachments:
  1. fftinfo.mxo.zip
#209052
Jul 31, 2011 at 2:27pm

Hello,

file you send me is an “alias” ;

a. it is a mistake ; so post the good file.

b. it is not a mistake and you really think that this file is the external : NO it is NOT ; the good one is somewhere in another folder (where it is supposed to be as defined in “Installation Directory” – as i said before -) ; and 4 Ko is a normal size for an “alias” ; and “no such object” is normal behavior when external is not in the maxMSP search path.

HTH.

#209053
Jul 31, 2011 at 3:30pm

oh ok.
i found the folder where the built objects are in.
now my file is 25kb big (attached rock.mxo.zip)
and i have included the folder where the project is in (rock.zip)
when i include this folder to max file paths and want to add this object is is marked red but the max window doesn’t give me an error.

#209054
Jul 31, 2011 at 3:31pm

files…

Attachments:
  1. rock.zip
#209055
Jul 31, 2011 at 4:20pm

Hello moali,

when i said “download the SDK and do nothing”, it is : DO NOTHING ;-)

Correct me if i’m wrong, but it seems you are using the “minimum.c” code after changing the name project to “rock”; but you can not do that, as you obtain conflicts between the name of your class object and the name of your external …

IMHO :

It tooks me a long time to understand all (at least a little) the subtleties of coding externals for maxMSP ; so you should start the process by the beginning, and go step by step …

… never believe that we already know something ;-)

First step : download and do nothing ; it is working ?
Second step : make a [flop] external : not easy at all to configure the project ; good luck !

Attachments:
  1. flop.c
#209056
Jul 31, 2011 at 9:09pm

hey!
you were right! i’m sorry!
everything was working as long as i changed the name of the c file.
i should have know that this can’t be working as long as i don’t change anything in the code.
so i tried to compile an example and include it. and it is working.
everything is fine now!
THANK YOU so much for your help and your patience!
i think the main problem was the path thing with the search files. so i completely became hysterical of these small problems.
hope to meet you again in this forum for “real” problems.
THANK YOU!
moali

#209057
Aug 1, 2011 at 5:25am

Hello moali,

“hope to meet you again in this forum for “real” problems.”

With many librairies and frameworks search path is sometimes a “real” problem ; to understand what does the linker and more generally Xcode/Gcc during compilation : http://www.lurklurk.org/linkers/linkers.html

HTH

#209058

You must be logged in to reply to this topic.