hello again,
now i tried to compile the helloworld example of the howto from johannes zmölning.
i'll explain my done steps:
i use dev-c++ for compiling the code.
first i copied the text from the tutorial into a file and named it helloworld.cpp i included it in a project, the m_pd.h, too.
then i pressed compile.
after that i got the errormessages :
In function void helloworld_setup()': invalid conversion from
int' to t_atomtype' initializing argument 6 of
_class* class_new(t_symbol*, void*(*)(), void (*)(), size_t, int, t_atomtype, ...)'
[Build Error] [obj1.o] Error 1
than i thougth i'll do a casting and put (t_atomtype) before the last argument.
after that the messages were:
[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...
what kind of project do i have to choose? dll? console? should i do it better in visual c++?
as you see, i'm not in the know what i'm doing. sorry for wasting you time...
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 togensym' [Linker error] undefined reference to
class_new' [Linker error] undefined reference to `class_addbang' ld returned 1 exit status [Build Error] [obj.dll] Error 1i 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..