[PD] compiling helloworld on winXP

cdr ix at replic.net
Thu Mar 9 23:35:34 CET 2006


On Thu Mar 09, 2006 at 11:26:27PM +0100, .: monsular :. wrote:
> ok, thanks a lot cdr!
> 
> i could now compile the project. but(!)..
> 
> the outputted file was a helloworld.dll
> 
> i now tried to import the .dll with 
>     "pd.ex -lib c:/path/to/external/helloworld" (tried wit and without file extesion .dll)
> 
> but, what else .... this error followed in pd:
> 
> -: can't load library
> load_object: Symbol "helloworld_setup" not found
> c:/path/to/external/helloworld: can't load library
> 
> and now?
> 
> the helloworld setup function is in the sourcefile.
> may this cause by a wrong compiled dll?
> or did i do something wrong at the importing?

try just 'pd -lib helloworld'. and make sure helloworld is in PD's search path. if you compiled with MSVC you have to do somethign to export helloworld_setup too. check the archives for that..


> 
> 
>     
> 
> top error snipped, but be sure to send -DNT (or -DMSW) to the preprocessor
> 
> > [Linker error] undefined reference to `post' 
> >   [Linker error] undefined reference to `pd_new' 
> >   [Linker error] undefined reference to `gensym' 
> >   [Linker error] undefined reference to `class_new' 
> >   [Linker error] undefined reference to `class_addbang' 
> >   ld returned 1 exit status 
> >  [Build Error]  [obj.dll] Error 1 
> > 
> > i don't know what i can do next...
> 
> the linker needs some hints to find libpd, aka pd.dll (or pd.lib with MSVC).  you could rename it libpd.dll, then -lpd would work (with GCC), or simply add the path to pd.dll to the linker arguments (absolute path, or relative if you did  -Lbin/)
> 
> > 
> > what kind of project do i have to choose? dll? console? 
> 
> dll.. 
> 
> > should i do it better in visual c++?
> 
> if you are using MSVC you additionally have to -DPD_EXTERNAL and weird tricks with declspec(dllimport) or something, so GCC is definitely simpler from a user standpoint..and if you are using GCC, add -mms-bitfields to the compiler flags so your external wont segfault when running in a MSVC-compiled host..
> 
> goodluck, looking forward to yer externals..
> 
> _______________________________________________
>  mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list





More information about the Pd-list mailing list