Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

built as submodule but showing error #2

Open
anupam19 opened this issue Feb 12, 2016 · 4 comments
Open

built as submodule but showing error #2

anupam19 opened this issue Feb 12, 2016 · 4 comments
Assignees
Labels

Comments

@anupam19
Copy link

Hi, I had copied contents of libcoap-fork to coap directory of tinydtls-coap and copied tinydtls-form folder contents to dtls folder. Now built them and finally did make for tinydtls-coap. But there are many errors I am seeing here.

@nforcen
Copy link

nforcen commented Jul 2, 2016

Hi, I think I have the same problem that anupam19, I have compiled well both CoAP and TinyDTLS separately. Examples in each folder work correctly. The problem is when I try to compile the main project.
I receive many errors, could you say me what they are due to? These are the errors I receive:
root@broker-VirtualBox:~/Escritorio/coap_DTLS/tinydtls-coap-master# make
cc -c -Wall -g -O0 -o coaps-client.o coaps-client.c -DDTLSv12 -DWITH_SHA256 -DWITH_POSIX
In file included from /usr/include/syslog.h:1:0,
from coap/debug.h:23,
from coap/coap.h:17,
from coaps-client.c:43:
dtls/debug.h:32:16: error: expected identifier before numeric constant
typedef enum { LOG_EMERG=0, LOG_ALERT, LOG_CRIT, LOG_WARN,
^
In file included from coaps-client.c:46:0:
dtls/debug.h:49:0: warning: "info" redefined [enabled by default]
#define info(...) dsrv_log(LOG_INFO, VA_ARGS)
^
In file included from coap/coap.h:17:0,
from coaps-client.c:43:
coap/debug.h:53:0: note: this is the location of the previous definition
#define info(...) coap_log(LOG_INFO, VA_ARGS)
^
In file included from coaps-client.c:46:0:
dtls/debug.h:50:0: warning: "warn" redefined [enabled by default]
#define warn(...) dsrv_log(LOG_WARN, VA_ARGS)
^
In file included from coap/coap.h:17:0,
from coaps-client.c:43:
coap/debug.h:54:0: note: this is the location of the previous definition
#define warn(...) coap_log(LOG_WARNING, VA_ARGS)
^
In file included from coaps-client.c:46:0:
dtls/debug.h:51:0: warning: "debug" redefined [enabled by default]
#define debug(...) dsrv_log(LOG_DEBUG, VA_ARGS)
^
In file included from coap/coap.h:17:0,
from coaps-client.c:43:
coap/debug.h:55:0: note: this is the location of the previous definition
#define debug(...) coap_log(LOG_DEBUG, VA_ARGS)
^
coaps-client.c: In function ‘read_from_peer’:
coaps-client.c:142:4: warning: pointer targets in passing argument 1 of ‘coap_read_from_buf’ differ in signedness [-Wpointer-sign]
return coap_read_from_buf(data, len, coap_ctx, &srcAddr);
^
In file included from coap/coap.h:22:0,
from coaps-client.c:43:
coap/net.h:351:5: note: expected ‘char ’ but argument is of type ‘uint8 *’
int coap_read_from_buf(char *buf, ssize_t bytes_read, coap_context_t *context, coap_address_t *src);
^
In file included from coaps-client.c:46:0:
coaps-client.c: In function ‘cmdline_content_type’:
dtls/debug.h:50:28: error: ‘LOG_WARN’ undeclared (first use in this function)
#define warn(...) dsrv_log(LOG_WARN, VA_ARGS)
^
coaps-client.c:754:2: note: in expansion of macro ‘warn’
warn("W: unknown content-type '%s'\n",arg);
^
dtls/debug.h:50:28: note: each undeclared identifier is reported only once for each function it appears in
#define warn(...) dsrv_log(LOG_WARN, VA_ARGS)
^
coaps-client.c:754:2: note: in expansion of macro ‘warn’
warn("W: unknown content-type '%s'\n",arg);
^
coaps-client.c: In function ‘main’:
coaps-client.c:1072:21: error: ‘LOG_WARN’ undeclared (first use in this function)
log_t log_level = LOG_WARN;
^
coaps-client.c:1079:18: warning: variable ‘tv’ set but not used [-Wunused-but-set-variable]
struct timeval tv, timeout;
^
coaps-client.c: At top level:
coaps-client.c:71:23: warning: ‘proxy_port’ defined but not used [-Wunused-variable]
static unsigned short proxy_port = COAP_DEFAULT_PORT;
^
make: *
* [coaps-client.o] Error 1
I receive many compilation errors. Could you help me with this?

The error which appear are:
root@broker-VirtualBox:~/Escritorio/coap_DTLS/tinydtls-coap-master# make
cc -c -Wall -g -O0 -o coaps-client.o coaps-client.c -DDTLSv12 -DWITH_SHA256 -DWITH_POSIX
In file included from /usr/include/syslog.h:1:0,
from coap/debug.h:23,
from coap/coap.h:17,
from coaps-client.c:43:
dtls/debug.h:32:16: error: expected identifier before numeric constant
typedef enum { LOG_EMERG=0, LOG_ALERT, LOG_CRIT, LOG_WARN,
^
In file included from coaps-client.c:46:0:
dtls/debug.h:49:0: warning: "info" redefined [enabled by default]
#define info(...) dsrv_log(LOG_INFO, VA_ARGS)
^
In file included from coap/coap.h:17:0,
from coaps-client.c:43:
coap/debug.h:53:0: note: this is the location of the previous definition
#define info(...) coap_log(LOG_INFO, VA_ARGS)
^
In file included from coaps-client.c:46:0:
dtls/debug.h:50:0: warning: "warn" redefined [enabled by default]
#define warn(...) dsrv_log(LOG_WARN, VA_ARGS)
^
In file included from coap/coap.h:17:0,
from coaps-client.c:43:
coap/debug.h:54:0: note: this is the location of the previous definition
#define warn(...) coap_log(LOG_WARNING, VA_ARGS)
^
In file included from coaps-client.c:46:0:
dtls/debug.h:51:0: warning: "debug" redefined [enabled by default]
#define debug(...) dsrv_log(LOG_DEBUG, VA_ARGS)
^
In file included from coap/coap.h:17:0,
from coaps-client.c:43:
coap/debug.h:55:0: note: this is the location of the previous definition
#define debug(...) coap_log(LOG_DEBUG, VA_ARGS)
^
coaps-client.c: In function ‘read_from_peer’:
coaps-client.c:142:4: warning: pointer targets in passing argument 1 of ‘coap_read_from_buf’ differ in signedness [-Wpointer-sign]
return coap_read_from_buf(data, len, coap_ctx, &srcAddr);
^
In file included from coap/coap.h:22:0,
from coaps-client.c:43:
coap/net.h:351:5: note: expected ‘char ’ but argument is of type ‘uint8 *’
int coap_read_from_buf(char *buf, ssize_t bytes_read, coap_context_t *context, coap_address_t *src);
^
In file included from coaps-client.c:46:0:
coaps-client.c: In function ‘cmdline_content_type’:
dtls/debug.h:50:28: error: ‘LOG_WARN’ undeclared (first use in this function)
#define warn(...) dsrv_log(LOG_WARN, VA_ARGS)
^
coaps-client.c:754:2: note: in expansion of macro ‘warn’
warn("W: unknown content-type '%s'\n",arg);
^
dtls/debug.h:50:28: note: each undeclared identifier is reported only once for each function it appears in
#define warn(...) dsrv_log(LOG_WARN, VA_ARGS)
^
coaps-client.c:754:2: note: in expansion of macro ‘warn’
warn("W: unknown content-type '%s'\n",arg);
^
coaps-client.c: In function ‘main’:
coaps-client.c:1072:21: error: ‘LOG_WARN’ undeclared (first use in this function)
log_t log_level = LOG_WARN;
^
coaps-client.c:1079:18: warning: variable ‘tv’ set but not used [-Wunused-but-set-variable]
struct timeval tv, timeout;
^
coaps-client.c: At top level:
coaps-client.c:71:23: warning: ‘proxy_port’ defined but not used [-Wunused-variable]
static unsigned short proxy_port = COAP_DEFAULT_PORT;
^
make: *
* [coaps-client.o] Error 1

@ashubhatt
Copy link

Found any solution?

@anupam19
Copy link
Author

anupam19 commented Sep 8, 2016

Nope

On 08-Sep-2016 12:01 PM, "ashubhatt" [email protected] wrote:

Found any solution?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH9rtyw-B-XaAYA3Ss2vWIPKfL3JBXwKks5qn6ujgaJpZM4HY0Ci
.

@thecodemaiden
Copy link
Owner

Thanks for posting the error messages.

It looks like the debug functions/enums in coap and dtls are colliding. I pushed up changes to the submodules and to coaps-client that should fix it. Can you update your code and try again?

@thecodemaiden thecodemaiden self-assigned this Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants