- From: Sándor István <si331_at_hszk.bme.hu>
- Date: Wed, 15 Aug 2007 21:41:30 +0200 (MEST)
On Wed, 15 Aug 2007, Dimitris Xydas wrote: > Hi! > I've been using comedi for a while but can't seem to > compile any demo programs that include the > "examples.h" header. For the simple first two > tutorials everything is ok (cc -o tut1 tut1.c -lcomedi > -lm), but for others I get undefined reference errors. > For example, compiling the info demo (same way): > > /tmp/ccCVbhm0.o: In function `main': > info.c:(.text+0x52): undefined reference to > `init_parsed_options' > info.c:(.text+0x6a): undefined reference to > `parse_options' > /tmp/ccCVbhm0.o: In function `get_command_stuff': > info.c:(.text+0x4c5): undefined reference to `cmd_src' > info.c:(.text+0x4ec): undefined reference to `cmd_src' > info.c:(.text+0x513): undefined reference to `cmd_src' > info.c:(.text+0x53a): undefined reference to `cmd_src' > info.c:(.text+0x561): undefined reference to `cmd_src' > /tmp/ccCVbhm0.o:info.c:(.text+0x5eb): more undefined > references to `cmd_src' follow > collect2: ld returned 1 exit status Your problem here is, that the demo source is spread over multiple .c files. I guess you should be compiling the source with 'make', you can read the steps in the INSTALL file in the root dir of your source. (comedilib-XXXX/INSTALL) This could also help: http://users.actcom.co.il/~choo/lupg/tutorials/c-on-unix/c-on-unix.html#compilation_steps Or try to google for "compiling c programs" bye Istvan
Received on 2007-08-15Z18:41:30