i am currently trying to develop an pd external on linux. I took the helloworld example and inserted it into an eclipse project called spectrometer. The m_pd.h file is included and can be found by the compiler. Currently, Eclipse prints errors at the linking step, references to pd functions can not be resolved.
The command which gets executed is 'gcc -o "spectrometer" ./src/spectrometer.o' . I asked someone who is more familiar with c programming and he told me, there is probably a library missing, containing the code for the headers. But i couldn't find further information about that. Does anyone know what's the problem here?
Thanks in advance.
Linking of PD external causes unresolved reference errors
could you give more info? such as: what kind of errors? are you including the path to m_pd.h somewhere? what makefile do you use?
you should have a command more like this:
gcc -export_dynamic -shared -lc -lm -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC
-Wall -W -Wshadow -Wstrict-prototypes
-Wno-unused -Wno-parentheses -Wno-switch -I$(PDSRCDIR) -ldns_sd -o $.pd_linux $.c
strip --strip-unneeded $*.pd_linux
(copied from the makefile below)
where PDSRCDIR is where m_pd.h lives
here's the makefile I use sometimes, for reference: makefile
Here is the makefile eclipse generates: makefile
I do include m_pd.h, and it can also be found by gcc and eclipse ( if i type a wrong name, an error gets thrown).
The following output appears during building (Sorry for the german error logs, don"t know how to change gcc's localization settings): eclipse_error
I hoped to be able to configure Eclipse in a way, that it's generatin valid make files out of the project settings. But thanks anyway for the reference make file, i will try to use this if it doesn"t work out with eclipse.
I don't know much about eclipse but it's sure to be 1 of 2 things: either dynamic linking flags (making a dynamic shared library) aren't right, or m_pd.h can't be found. I'm guessing that it's the former from what you describe. (perhaps -export_dynamic ?)