[flext] Setting up xcode for flext!

Thomas Grill gr at grrrr.org
Mon Dec 17 17:00:52 CET 2012


Any sane C/C++ will not produce a binary with syntax errors in the source code.
My guess is that you had a package.txt with a different source file defined in it, so that source file and resulting shared lib didn't correspond, which explains the type of error on object instantiation in Pd.
Attached is the package.txt i just used for compiling your code.
gr~~~



Am 17.12.2012 um 16:55 schrieb Òscar Martínez Carmona:

> Actually it did surprised me a lot when it build, I really didn't expected to have it right cause I wrote the code without any code completion tools or stuff, but the thing is I got a pd_darwin dynamic library file after building! Can the buildsystem build the extern without beeing a propper code on it? cause when I tried that I was expectting to get no file but a lot of errors so I could start mending my code!
> 
> 
> On Mon, Dec 17, 2012 at 4:41 PM, Thomas Grill <gr at grrrr.org> wrote:
> Oh yes, these things are all completely unrelated to flext, rather to C/C++ programming - flext-wise your object is ok ;-)
> gr~~~
> 
> Am 17.12.2012 um 16:40 schrieb Thomas Grill:
> 
>> Hi Oscar,
>> it's no wonder that your object does not instantiate, since it can never have compiled.
>> There are number of syntax errors, misspelled names, missing header, undefined variables etc. in it. Haven't you seen the list of errors on the compilation output?
>> Below there's a diff correcting all the thing, syntactically that is - i haven't checked the program logic.
>> gr~~~
>> 
>> 
>> --- huikey~.ori.cpp	2012-12-17 16:22:56.000000000 +0100
>> +++ huikey~.cpp	2012-12-17 16:36:27.000000000 +0100
>> @@ -1,5 +1,6 @@
>>  #include <flext.h>	//needed for the flext implementations
>>  #include <fstream>	//needed for dealing with files in the constructor
>> +#include <cmath>
>>  
>>  #if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400)
>>  #error You need at least flext version 0.4.0
>> @@ -9,7 +10,7 @@
>>  	public flext_dsp	//inherittance from flext_dsp base class
>>  {
>>  
>> -    FLEXT_HEADER_S(huikey,flext_dsp);	
>> +    FLEXT_HEADER(huikey,flext_dsp);	
>>      
>>  	public:
>>  
>> @@ -25,11 +26,11 @@
>>  		buffer = new float[size];
>>  		ptr = 0;
>>  				
>> -		FLEXT_ADDMETHOD(1, setAzimuth);
>> -		FLEXT_ADDMETHOD(2, setElevation);
>> +		FLEXT_ADDMETHOD(1, setAzim);
>> +		FLEXT_ADDMETHOD(2, setElev);
>>  		
>> -		string filename = "databaseHrirREDUX.txt";
>> -		ifstream fin;
>> +		std::string filename = "databaseHrirREDUX.txt";
>> +		std::ifstream fin;
>>  		fin.open(filename.c_str());
>>  		
>>  		if (fin.is_open()){
>> @@ -108,17 +109,18 @@
>>  	
>>  	getHrir();
>>  	
>> +    int i,j;
>>  	for(i=0; i<n; i++){
>>  		buffer[ptr] = ins[i];
>>  		accleft = 0;
>> -		accrigth = 0;
>> +		accright = 0;
>>  		
>>  		for(j=0; j<=ptr; j++){
>>  			accleft += hrir_L[j]*buffer[ptr-j];
>>  			accright += hrir_R[j]*buffer[ptr-j];
>>  		}
>>  		
>> -		for(j=1; j<(size-ptr); k++){
>> +		for(j=1; j<(size-ptr); j++){
>>  			accleft += hrir_L[j+ptr] * buffer[size-j];
>>  			accright += hrir_R[j+ptr] * buffer[size-j];
>>  		}
>> @@ -139,11 +141,11 @@
>>  	int correc = 0;    
>>  	int index;            
>>  
>> -	elev = round(elev/15)*15; 
>> +	int elev = round(elev/15)*15; 
>>  
>> -	if (elev >= 60) && (elev < 75) incAzim = 30;             
>> +	if (elev >= 60 && elev < 75) incAzim = 30;             
>>  
>> -	if (elev >= 75) && (elev < 90){ 
>> +	if (elev >= 75 && elev < 90){ 
>>  		incAzim = 60;               
>>  		correc = 12;
>>  	}
>> 
>> 
>> 
>> 
>> Am 17.12.2012 um 14:28 schrieb Òscar Martínez Carmona:
>> 
>>> hey Thomas,
>>> First of all I have to thank your replies!
>>> Here's the screen shot:
>>> <Imagen 1.png>
>>> 
>>> I also attach the code!
>>> 
>>> Thanx so much again!
>>> 
>>> 
>>> On Sun, Dec 16, 2012 at 9:49 PM, Thomas Grill <gr at grrrr.org> wrote:
>>> Hi Oscar,
>>> the fact that you "can't get any instance" can have several reasons. Again, a screenshot or the PD console with the -verbose option on startup would be helpful.
>>> As for debugging of an external: this is indeed where i fire up xcode.
>>> gr~~~
>>> 
>>> Am 15.12.2012 um 16:48 schrieb Òscar Martínez Carmona:
>>> 
>>>> Hey, me again, 
>>>> Finally I got the flext buildsystem working and compiled some of the examples succesfully. Now I'm trying to compile an external "of my own" (not really mine, actually it's a ripoff of someother guy (a nicer one)). The thing is that I got it compiled but when I call it from pd (after putting the dylib on the extra folder) I can't get any instance!
>>>> What could I be doing wrong? There's any way for debugging the external?? 
>>>> Thanx!
>>>> 
>>>> 
>>>> On Wed, Dec 12, 2012 at 11:26 PM, Òscar Martínez Carmona <xamps23 at gmail.com> wrote:
>>>> Yeah. Now it's working, I changed the path into /Developer and restarted the whole thing again following the steps and now I have built one of the examples,  got it running on PD, so I guess now it works fine!!
>>>> Thanx!
>>>> 
>>>> 
>>>> On Wed, Dec 12, 2012 at 11:04 PM, Thomas Grill <gr at grrrr.org> wrote:
>>>> So, have you run "bash build.sh pd gcc" before trying to install it?
>>>> gr~~~
>>>> 
>>>> Am 12.12.2012 um 22:36 schrieb Òscar Martínez Carmona:
>>>> 
>>>>> So true, here it goes:
>>>>> 
>>>>> XmP-s-MAC-289:flext xmp$ sudo bash build.sh pd gcc install
>>>>> make -f ./buildsys/gnumake-sub.mak  PLATFORM=mac RTSYS=pd COMPILER=gcc BUILDPATH=./buildsys/ PKGINFO=package.txt BUILDCLASS=flext USRCONFIG=config.txt USRMAKE=build/gnumake-mac-gcc.inc TARGETMODE=release TARGETTYPE=single _install_
>>>>> buildsys/mac/gnumake-gcc-targets.inc:22: warning: overriding commands for target `pd-darwin/release-single'
>>>>> buildsys/mac/gnumake-gcc-targets.inc:18: warning: ignoring old commands for target `pd-darwin/release-single'
>>>>> install pd-darwin/release-single/libflext-pd_s.0.5.2.a /usr/local/lib
>>>>> install: pd-darwin/release-single/libflext-pd_s.0.5.2.a: No such file or directory
>>>>> make[1]: *** [_install_] Error 71
>>>>> make: *** [install-release-single] Error 2
>>>>> 
>>>>> Hope this helps!
>>>>> Thanx so much!
>>>>> 
>>>>> 
>>>>> 
>>>>> On Wed, Dec 12, 2012 at 7:23 PM, Thomas Grill <gr at grrrr.org> wrote:
>>>>> Hi Oscar, without knowing what your errors are (console output), it's absolutely impossible to help you.
>>>>> gr~~~
>>>>> 
>>>>> Am 12.12.2012 um 19:12 schrieb Òscar Martínez Carmona:
>>>>> 
>>>>>> Hey, I'm trying the flext build system but not succesfully. I got stuck when I try to build flext, seems that I'm making some mistake when I build it  entering "bash build.sh pd gcc" i got some errors (2) so I guess that why it doesn't let me installing it afterwards.
>>>>>> Any suggestion? Could be possible to use flext into Eclipse IDE?
>>>>>> Thanx!
>>>>>> 
>>>>>> 
>>>>>> On Wed, Dec 12, 2012 at 4:25 PM, Òscar Martínez Carmona <xamps23 at gmail.com> wrote:
>>>>>> Hey Thomas, 
>>>>>> Sincerely I haven't done that. I started with the xcode template that was in the package I got from flext site. I've written some silly externs in C following the tutorial on pd's site, and it was fairly easy with xcode, so I thougth that with flext could be similar. I'll try what you suggest, thanx for the advice!
>>>>>> I'll right back with more questions, no doubt about it!! 
>>>>>> 
>>>>>> 
>>>>>> On Tue, Dec 11, 2012 at 8:42 PM, Thomas Grill <gr at grrrr.org> wrote:
>>>>>> Hi Oscar,
>>>>>> using xcode is certainly not the easiest way to use flext.
>>>>>> Have you tried the flext build system after reading through flext/readme.txt and flext/build.txt?
>>>>>> gr~~~
>>>>>> 
>>>>>> Am 11.12.2012 um 19:43 schrieb Òscar Martínez Carmona:
>>>>>> 
>>>>>> > Hi list!
>>>>>> > I'm a newby to flext and by now I've written some simple external test based on the tutorials in "flext Intro" stuff.
>>>>>> > The thing is I can't achieve its compilation cause I haven't setup propperly the whole thing.
>>>>>> > I'm looking for some "idiot-proof" tutorial on that subject or maybe some "retard-oriented" advice!
>>>>>> > I really need some step-to-step explanation on setting Xcode and all the stuff.
>>>>>> > Thanx so much!
>>>>>> >
>>>>>> > --
>>>>>> > Òscar Martínez Carmona
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > http://grrrr.org/ext/flext
>>>>>> >
>>>>>> > flext mailing list
>>>>>> > flext at grrrr.org
>>>>>> > http://grrrr.org/cgi-bin/mailman/listinfo/flext
>>>>>> 
>>>>>> --
>>>>>> Thomas Grill
>>>>>> http://grrrr.org
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> Òscar Martínez Carmona
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> Òscar Martínez Carmona
>>>>>> 
>>>>> 
>>>>> --
>>>>> Thomas Grill
>>>>> http://grrrr.org
>>>>> +43 699 19715543
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> -- 
>>>>> Òscar Martínez Carmona
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> Thomas Grill
>>>> http://grrrr.org
>>>> +43 699 19715543
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Òscar Martínez Carmona
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Òscar Martínez Carmona
>>>> 
>>> 
>>> 
>>> --
>>> Thomas Grill
>>> http://grrrr.org
>>> +43 699 19715543
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Òscar Martínez Carmona
>>> 
>>> <huikey~.cpp>
>> 
>> --
>> Thomas Grill
>> http://grrrr.org
>> +43 699 19715543
>> 
>> _______________________________________________
>> http://grrrr.org/ext/flext
>> 
>> flext mailing list
>> flext at grrrr.org
>> http://grrrr.org/cgi-bin/mailman/listinfo/flext
> 
> 
> 
> --
> Thomas Grill
> http://grrrr.org
> +43 699 19715543
> 
> 
> 
> 
> -- 
> Òscar Martínez Carmona
> 

--
Thomas Grill
http://grrrr.org
+43 699 19715543

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20121217/e38a9c06/attachment-0002.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: package.txt
URL: <http://grrrr.org/pipermail/flext/attachments/20121217/e38a9c06/attachment-0001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20121217/e38a9c06/attachment-0003.htm>


More information about the flext mailing list