Trying to include httpclient.h inside ldebug.c is causing an error during compilation
My goal is to do an http post request inside ldebug.c by including httpclient. It worked in dbg_printf.c but I'm getting compilation errors in ldebug.c.
In file included from ../ldebug.c:28:0:
../../http/httpclient.h:69:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'http_request'
void ICACHE_FLASH_ATTR http_request(const char * url, const char * method, const char * headers, const char * post_data, http_callback_t callback_handle, int redirect_follow_count);
Is there another way I can do a post request?
lua esp8266 nodemcu firmware
add a comment |
My goal is to do an http post request inside ldebug.c by including httpclient. It worked in dbg_printf.c but I'm getting compilation errors in ldebug.c.
In file included from ../ldebug.c:28:0:
../../http/httpclient.h:69:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'http_request'
void ICACHE_FLASH_ATTR http_request(const char * url, const char * method, const char * headers, const char * post_data, http_callback_t callback_handle, int redirect_follow_count);
Is there another way I can do a post request?
lua esp8266 nodemcu firmware
It seems thatICACHE_FLASH_ATTRis not defined. Perhaps you need to include some other header file as well.
– lhf
Jan 3 at 18:40
@lhf I included httpclient.h in dbg_printf and didn't get any errors. Why would the linker suddenly not know what ICACHE_FLASH_ATTR means?
– CptnKrunch
Jan 3 at 19:34
It's not a linker error, it's a compiler error. It doesn't work in ldebug.c because the symbol ICACHE_FLASH_ATTR isn't defined in the header files that file includes.
– John Romkey
Jan 4 at 1:22
add a comment |
My goal is to do an http post request inside ldebug.c by including httpclient. It worked in dbg_printf.c but I'm getting compilation errors in ldebug.c.
In file included from ../ldebug.c:28:0:
../../http/httpclient.h:69:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'http_request'
void ICACHE_FLASH_ATTR http_request(const char * url, const char * method, const char * headers, const char * post_data, http_callback_t callback_handle, int redirect_follow_count);
Is there another way I can do a post request?
lua esp8266 nodemcu firmware
My goal is to do an http post request inside ldebug.c by including httpclient. It worked in dbg_printf.c but I'm getting compilation errors in ldebug.c.
In file included from ../ldebug.c:28:0:
../../http/httpclient.h:69:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'http_request'
void ICACHE_FLASH_ATTR http_request(const char * url, const char * method, const char * headers, const char * post_data, http_callback_t callback_handle, int redirect_follow_count);
Is there another way I can do a post request?
lua esp8266 nodemcu firmware
lua esp8266 nodemcu firmware
asked Jan 3 at 18:15
CptnKrunchCptnKrunch
4110
4110
It seems thatICACHE_FLASH_ATTRis not defined. Perhaps you need to include some other header file as well.
– lhf
Jan 3 at 18:40
@lhf I included httpclient.h in dbg_printf and didn't get any errors. Why would the linker suddenly not know what ICACHE_FLASH_ATTR means?
– CptnKrunch
Jan 3 at 19:34
It's not a linker error, it's a compiler error. It doesn't work in ldebug.c because the symbol ICACHE_FLASH_ATTR isn't defined in the header files that file includes.
– John Romkey
Jan 4 at 1:22
add a comment |
It seems thatICACHE_FLASH_ATTRis not defined. Perhaps you need to include some other header file as well.
– lhf
Jan 3 at 18:40
@lhf I included httpclient.h in dbg_printf and didn't get any errors. Why would the linker suddenly not know what ICACHE_FLASH_ATTR means?
– CptnKrunch
Jan 3 at 19:34
It's not a linker error, it's a compiler error. It doesn't work in ldebug.c because the symbol ICACHE_FLASH_ATTR isn't defined in the header files that file includes.
– John Romkey
Jan 4 at 1:22
It seems that
ICACHE_FLASH_ATTR is not defined. Perhaps you need to include some other header file as well.– lhf
Jan 3 at 18:40
It seems that
ICACHE_FLASH_ATTR is not defined. Perhaps you need to include some other header file as well.– lhf
Jan 3 at 18:40
@lhf I included httpclient.h in dbg_printf and didn't get any errors. Why would the linker suddenly not know what ICACHE_FLASH_ATTR means?
– CptnKrunch
Jan 3 at 19:34
@lhf I included httpclient.h in dbg_printf and didn't get any errors. Why would the linker suddenly not know what ICACHE_FLASH_ATTR means?
– CptnKrunch
Jan 3 at 19:34
It's not a linker error, it's a compiler error. It doesn't work in ldebug.c because the symbol ICACHE_FLASH_ATTR isn't defined in the header files that file includes.
– John Romkey
Jan 4 at 1:22
It's not a linker error, it's a compiler error. It doesn't work in ldebug.c because the symbol ICACHE_FLASH_ATTR isn't defined in the header files that file includes.
– John Romkey
Jan 4 at 1:22
add a comment |
1 Answer
1
active
oldest
votes
ICACHE_FLASH_ATTR is a macro defined in the file c_types.h
There are two reasons that it wouldn't be defined.
First, ldebug.c may not include c_types.h or include a file which #includes c_types.h. This is easy to fix - edit ldebug.c and add
#include <c_types.h>
before #include <httpclient.h>
The other possibility is that the symbol ICACHE_FLASH is not defined when ldebug.c gets compiled. The file c_types.h only defines ICACHE_FLASH_ATTR if ICACHE_FLASH is #define'd. If the first fix doesn't work, you'll need to make sure that you #define ICACHE_FLASH when you compile ldebug.c
The easiest way to do this is to add
#define ICACHE_FLASH 1
as the very first line of ldebug.c
Or you can make sure that you set -DICACHE_FLASH=1 as a compiler flag in whatever your development environment is. Changing ldebug.c is almost certainly the easier way to do this.
Thanks for the tips! What ended up working was copying the entireICACHE_FLASHdefinition fromc_types.hintoldebug.c.
– CptnKrunch
Jan 7 at 3:53
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54027663%2ftrying-to-include-httpclient-h-inside-ldebug-c-is-causing-an-error-during-compil%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
ICACHE_FLASH_ATTR is a macro defined in the file c_types.h
There are two reasons that it wouldn't be defined.
First, ldebug.c may not include c_types.h or include a file which #includes c_types.h. This is easy to fix - edit ldebug.c and add
#include <c_types.h>
before #include <httpclient.h>
The other possibility is that the symbol ICACHE_FLASH is not defined when ldebug.c gets compiled. The file c_types.h only defines ICACHE_FLASH_ATTR if ICACHE_FLASH is #define'd. If the first fix doesn't work, you'll need to make sure that you #define ICACHE_FLASH when you compile ldebug.c
The easiest way to do this is to add
#define ICACHE_FLASH 1
as the very first line of ldebug.c
Or you can make sure that you set -DICACHE_FLASH=1 as a compiler flag in whatever your development environment is. Changing ldebug.c is almost certainly the easier way to do this.
Thanks for the tips! What ended up working was copying the entireICACHE_FLASHdefinition fromc_types.hintoldebug.c.
– CptnKrunch
Jan 7 at 3:53
add a comment |
ICACHE_FLASH_ATTR is a macro defined in the file c_types.h
There are two reasons that it wouldn't be defined.
First, ldebug.c may not include c_types.h or include a file which #includes c_types.h. This is easy to fix - edit ldebug.c and add
#include <c_types.h>
before #include <httpclient.h>
The other possibility is that the symbol ICACHE_FLASH is not defined when ldebug.c gets compiled. The file c_types.h only defines ICACHE_FLASH_ATTR if ICACHE_FLASH is #define'd. If the first fix doesn't work, you'll need to make sure that you #define ICACHE_FLASH when you compile ldebug.c
The easiest way to do this is to add
#define ICACHE_FLASH 1
as the very first line of ldebug.c
Or you can make sure that you set -DICACHE_FLASH=1 as a compiler flag in whatever your development environment is. Changing ldebug.c is almost certainly the easier way to do this.
Thanks for the tips! What ended up working was copying the entireICACHE_FLASHdefinition fromc_types.hintoldebug.c.
– CptnKrunch
Jan 7 at 3:53
add a comment |
ICACHE_FLASH_ATTR is a macro defined in the file c_types.h
There are two reasons that it wouldn't be defined.
First, ldebug.c may not include c_types.h or include a file which #includes c_types.h. This is easy to fix - edit ldebug.c and add
#include <c_types.h>
before #include <httpclient.h>
The other possibility is that the symbol ICACHE_FLASH is not defined when ldebug.c gets compiled. The file c_types.h only defines ICACHE_FLASH_ATTR if ICACHE_FLASH is #define'd. If the first fix doesn't work, you'll need to make sure that you #define ICACHE_FLASH when you compile ldebug.c
The easiest way to do this is to add
#define ICACHE_FLASH 1
as the very first line of ldebug.c
Or you can make sure that you set -DICACHE_FLASH=1 as a compiler flag in whatever your development environment is. Changing ldebug.c is almost certainly the easier way to do this.
ICACHE_FLASH_ATTR is a macro defined in the file c_types.h
There are two reasons that it wouldn't be defined.
First, ldebug.c may not include c_types.h or include a file which #includes c_types.h. This is easy to fix - edit ldebug.c and add
#include <c_types.h>
before #include <httpclient.h>
The other possibility is that the symbol ICACHE_FLASH is not defined when ldebug.c gets compiled. The file c_types.h only defines ICACHE_FLASH_ATTR if ICACHE_FLASH is #define'd. If the first fix doesn't work, you'll need to make sure that you #define ICACHE_FLASH when you compile ldebug.c
The easiest way to do this is to add
#define ICACHE_FLASH 1
as the very first line of ldebug.c
Or you can make sure that you set -DICACHE_FLASH=1 as a compiler flag in whatever your development environment is. Changing ldebug.c is almost certainly the easier way to do this.
answered Jan 4 at 1:27
John RomkeyJohn Romkey
1,059176
1,059176
Thanks for the tips! What ended up working was copying the entireICACHE_FLASHdefinition fromc_types.hintoldebug.c.
– CptnKrunch
Jan 7 at 3:53
add a comment |
Thanks for the tips! What ended up working was copying the entireICACHE_FLASHdefinition fromc_types.hintoldebug.c.
– CptnKrunch
Jan 7 at 3:53
Thanks for the tips! What ended up working was copying the entire
ICACHE_FLASH definition from c_types.h into ldebug.c.– CptnKrunch
Jan 7 at 3:53
Thanks for the tips! What ended up working was copying the entire
ICACHE_FLASH definition from c_types.h into ldebug.c.– CptnKrunch
Jan 7 at 3:53
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54027663%2ftrying-to-include-httpclient-h-inside-ldebug-c-is-causing-an-error-during-compil%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It seems that
ICACHE_FLASH_ATTRis not defined. Perhaps you need to include some other header file as well.– lhf
Jan 3 at 18:40
@lhf I included httpclient.h in dbg_printf and didn't get any errors. Why would the linker suddenly not know what ICACHE_FLASH_ATTR means?
– CptnKrunch
Jan 3 at 19:34
It's not a linker error, it's a compiler error. It doesn't work in ldebug.c because the symbol ICACHE_FLASH_ATTR isn't defined in the header files that file includes.
– John Romkey
Jan 4 at 1:22