RIOT-Makers / YaCoAP

A small CoAP implementation for microcontrollers
MIT License
5 stars 6 forks source link

Can't compile sources at /tests #1

Open bsmelo opened 8 years ago

bsmelo commented 8 years ago

Hello!

First of all, I'm sorry if this is not the right place for this question/issue - since the lib is really new and all, I suppose there isn't another place though.

I can't compile the sources at /tests directory (I was able to compile and run the sample at /examples though).

First issue I found was:

[  5:16PM ]  [ bruno@lain:~/coap-apps/YaCoAP/tests(master✔) ]
 $ make
cc -std=c99 -Wall -Wextra -Werror -O2 -I../.   -c -o piggyback.o piggyback.c
piggyback.c: In function ‘handle_get_well_known_core’:
piggyback.c:22:48: error: ‘RIOT_BOARD’ undeclared (first use in this function)
                               (const uint8_t *)RIOT_BOARD, strlen(RIOT_BOARD),

So, I have to ask: is the lib dependent on RIOT-OS?

Anyway, I made an ugly hack of adding a #define RIOT_BOARD "native" inside piggyback.c and new errors just followed; so, I guess I'm doing something wrong. Are the directions at the README.md for just running make inside /tests complete/enough? Or should I do something like compiling the lib to get libyacoap.so and add its path to LD_LIBRARY_PATH or some other thing?

Thanks!

smlng commented 8 years ago

@bsmelo thanks for testing the code. I fixed the piggyback test, it was actually some copy/paste error - I use this library mostly for IoT projects with RIOT.

I have to admit that the build system is not at its best 😬 However, compiling examples and tests should work as they do not use the lib but integrate the required code directly.

Hope this helps ...