Atte André Jensen wrote:
I took the code found here
http://iem.kug.ac.at/pd/externals-HOWTO/node3.html#SECTION000360000000000000...
placed it in a file helloworld.c, but got:
atte@ajstrup:~/music/synth/pd/externals/atte$ gcc helloworld.c /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function
_start': ../sysdeps/i386/elf/start.S:115: undefined reference to
main'
Because you need to tell gcc to build a dynamic library instead of a standalone: Add -export_dynamic and -shared to the command line Also add -ohelloworld.pd_linux to get the correct output file name.
/tmp/ccuN3zCm.o: In function
helloworld_bang': helloworld.c:(.text+0xe): undefined reference to
post'
You need to #include <m_pd.h> in the source file. If you have #include "m_pd.h" then m_pd.h has to be in the same directory as the source file.
Martin
martin.peach@sympatico.ca wrote:
/tmp/ccuN3zCm.o: In function
helloworld_bang': helloworld.c:(.text+0xe): undefined reference to
post'
the given error was a linker error rather than a compiler error.
You need to #include <m_pd.h> in the source file. If you have #include "m_pd.h" then m_pd.h has to be in the same directory as the source file.
not quite true.
in my understanding "m_pd.h" will be searched for in all paths given via the "-I" compiler-flag, whereas <m_pd.h> will only be searched for in "standard" paths.
some stats: a quick search in the externals-folder of the CVS revealed: "m_pd.h" is uncluded 889 times <m_pd.h> is included 107 times
i doubt that all of the 889 occurences of "m_pd.h" have the m_pd.h in the same directory as the source files.
fgmasdr. IOhannes
Some additional personal understanding:
I haven't looked it up, but as far i remember <m_pd.h> is searched
for standard paths and -I defined paths, whereas "m_pd.h" is searched
for those plus the source folder.
Otherwise many of my programs would probably not work....
greetings, Thomas
Am 05.09.2007 um 09:23 schrieb IOhannes m zmoelnig:
martin.peach@sympatico.ca wrote:
/tmp/ccuN3zCm.o: In function
helloworld_bang': helloworld.c:(.text+0xe): undefined reference to
post'the given error was a linker error rather than a compiler error.
You need to #include <m_pd.h> in the source file. If you have #include "m_pd.h" then m_pd.h has to be in the same
directory as the source file.not quite true.
in my understanding "m_pd.h" will be searched for in all paths
given via the "-I" compiler-flag, whereas <m_pd.h> will only be searched for in "standard" paths.some stats: a quick search in the externals-folder of the CVS
revealed: "m_pd.h" is uncluded 889 times <m_pd.h> is included 107 timesi doubt that all of the 889 occurences of "m_pd.h" have the m_pd.h in the same directory as the source files.
fgmasdr. IOhannes
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Thomas Grill wrote:
Some additional personal understanding: I haven't looked it up, but as far i remember <m_pd.h> is searched
for standard paths and -I defined paths, whereas "m_pd.h" is searched
for those plus the source folder.
so it basically makes the "-I." obsolete. so much magic in computers....
dmsfa.se
IOhannes
Am 05.09.2007 um 11:39 schrieb IOhannes m zmoelnig:
Thomas Grill wrote:
Some additional personal understanding: I haven't looked it up, but as far i remember <m_pd.h> is
searched for standard paths and -I defined paths, whereas
"m_pd.h" is searched for those plus the source folder.so it basically makes the "-I." obsolete. so much magic in computers....
The true magic lies in the order.... the source folder is searched
first, before any other paths.
but i think that's pretty much it greetings, T