Trying to include httpclient.h inside ldebug.c is causing an error during compilation












0















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?










share|improve this question























  • 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











  • 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
















0















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?










share|improve this question























  • 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











  • 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














0












0








0








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 3 at 18:15









CptnKrunchCptnKrunch

4110




4110













  • 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











  • 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











  • @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












1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer
























  • 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












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
});


}
});














draft saved

draft discarded


















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









1














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.






share|improve this answer
























  • 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
















1














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.






share|improve this answer
























  • 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














1












1








1







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 4 at 1:27









John RomkeyJohn Romkey

1,059176




1,059176













  • 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

















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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'