C function of double type sometimes works when declared in certain headers





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have this weird problem where sometimes this function not always work, and only works if it's declared in the same headers where it is called... It's a really strange thing because the compiler it seems even ignores if the files containing the function are included or not...



double mapRange(double value, double r1, double r2, double n1, double n2)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
return res;
}


as you can see when it prints the value it is correct however when I print the returned value from another function like main I get garbage numbers...
Worst thing is I tested it on a file by itself and it worked flawlessly, I know this seems like an error from my part but I really can't find an explanation for this... Has someone encountered something like that? Is my compiler broken? Is there any limits in C that I'm not aware of? I know too that I don't have much more code to offer than this which kind of makes it difficult for a diagnosis but it's from a rather not-so-small project for uni...



EDIT 1:
OK so



// main.c



 #ifndef UTIL_H
#define UTIL_H
#include "util.h"
#endif /*UTIL_H*/

int main(int argc, char *argv) {
Matrix* volcan = readVolcano("test.txt");
double t;
mapRange(7.0, 1.0, 9.0, 0.0, 1.0,&t);
printf("%fn..n", t);
mat_printinfo(volcan);
mat_printmat(volcan, NULL);
weighted_volcano(volcan, NULL, NULL, NULL);
mat_free(volcan);
return 0;
}


// util.c



#include "util.h"


/*
Retorna una transformacion de value que esta entre r1 y r2 a un valor que esta
entre n1 y n2, con tal que tenga la misma relacion con el rango [n1, n2] como
value tenga con el rango [r1, r2]
*/


double mapRange(double value, double r1, double r2, double n1, double n2, double* result)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
if(result!=NULL)
*result = res;
return res;
}


I'm absolutely sure there's not a duplicate in definition, I've also rebuilt the project many times...



D:CodeCvolcancc1.exe    [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanmain.c In function 'main':
52 19 D:CodeCvolcanmain.c [Warning] initialization makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'open_volcano':
91 7 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'test_volcano':
119 13 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanvolcantobmp.c In function 'weighted_volcano':
38 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
40 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C


the output of the IDE



EDIT 2:
So it seems the problem was here



// util.h



#include "headers.h"


it was empty...










share|improve this question




















  • 1





    Do you have another function named mapRange that takes different parameters? Do you have a prototype for this function that is visible everywhere it is called? Do you have the warnings turned up on your compiler, and do you see any when you compile?

    – Retired Ninja
    Nov 27 '18 at 1:34











  • when you import this function from another file, post your code. show your usage and how you are importing/declaring

    – HappyKeyboard
    Nov 27 '18 at 1:35











  • Sounds like this function mapRange is defined in one C source file, and the calling function (like main) is defined in another. So the question is, when main is being compiled, how does the compiler know that mapRange returns a dounle? The answer is, the compiler needs to be able to see an external prototype declaration for mapRange. Typically you put this in a header file, maybe maprange.h. Then you use #include to pull maprange.h in to both source files as they are being compiled.

    – Steve Summit
    Nov 27 '18 at 1:41













  • But if this isn't making sense, you'll want to find a tutorial on separate compilation, which can be confusing at first.

    – Steve Summit
    Nov 27 '18 at 1:42











  • You missed the most important file. util.h, and those warnings don't match the code you've posted. You might want to make a Minimal, Complete, and Verifiable example to highlight just the issue you're asking about. Given the warnings you posted I'm not surprised you have issues, but none of them seem to relate to this particular one.

    – Retired Ninja
    Nov 27 '18 at 1:47




















0















I have this weird problem where sometimes this function not always work, and only works if it's declared in the same headers where it is called... It's a really strange thing because the compiler it seems even ignores if the files containing the function are included or not...



double mapRange(double value, double r1, double r2, double n1, double n2)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
return res;
}


as you can see when it prints the value it is correct however when I print the returned value from another function like main I get garbage numbers...
Worst thing is I tested it on a file by itself and it worked flawlessly, I know this seems like an error from my part but I really can't find an explanation for this... Has someone encountered something like that? Is my compiler broken? Is there any limits in C that I'm not aware of? I know too that I don't have much more code to offer than this which kind of makes it difficult for a diagnosis but it's from a rather not-so-small project for uni...



EDIT 1:
OK so



// main.c



 #ifndef UTIL_H
#define UTIL_H
#include "util.h"
#endif /*UTIL_H*/

int main(int argc, char *argv) {
Matrix* volcan = readVolcano("test.txt");
double t;
mapRange(7.0, 1.0, 9.0, 0.0, 1.0,&t);
printf("%fn..n", t);
mat_printinfo(volcan);
mat_printmat(volcan, NULL);
weighted_volcano(volcan, NULL, NULL, NULL);
mat_free(volcan);
return 0;
}


// util.c



#include "util.h"


/*
Retorna una transformacion de value que esta entre r1 y r2 a un valor que esta
entre n1 y n2, con tal que tenga la misma relacion con el rango [n1, n2] como
value tenga con el rango [r1, r2]
*/


double mapRange(double value, double r1, double r2, double n1, double n2, double* result)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
if(result!=NULL)
*result = res;
return res;
}


I'm absolutely sure there's not a duplicate in definition, I've also rebuilt the project many times...



D:CodeCvolcancc1.exe    [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanmain.c In function 'main':
52 19 D:CodeCvolcanmain.c [Warning] initialization makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'open_volcano':
91 7 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'test_volcano':
119 13 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanvolcantobmp.c In function 'weighted_volcano':
38 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
40 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C


the output of the IDE



EDIT 2:
So it seems the problem was here



// util.h



#include "headers.h"


it was empty...










share|improve this question




















  • 1





    Do you have another function named mapRange that takes different parameters? Do you have a prototype for this function that is visible everywhere it is called? Do you have the warnings turned up on your compiler, and do you see any when you compile?

    – Retired Ninja
    Nov 27 '18 at 1:34











  • when you import this function from another file, post your code. show your usage and how you are importing/declaring

    – HappyKeyboard
    Nov 27 '18 at 1:35











  • Sounds like this function mapRange is defined in one C source file, and the calling function (like main) is defined in another. So the question is, when main is being compiled, how does the compiler know that mapRange returns a dounle? The answer is, the compiler needs to be able to see an external prototype declaration for mapRange. Typically you put this in a header file, maybe maprange.h. Then you use #include to pull maprange.h in to both source files as they are being compiled.

    – Steve Summit
    Nov 27 '18 at 1:41













  • But if this isn't making sense, you'll want to find a tutorial on separate compilation, which can be confusing at first.

    – Steve Summit
    Nov 27 '18 at 1:42











  • You missed the most important file. util.h, and those warnings don't match the code you've posted. You might want to make a Minimal, Complete, and Verifiable example to highlight just the issue you're asking about. Given the warnings you posted I'm not surprised you have issues, but none of them seem to relate to this particular one.

    – Retired Ninja
    Nov 27 '18 at 1:47
















0












0








0








I have this weird problem where sometimes this function not always work, and only works if it's declared in the same headers where it is called... It's a really strange thing because the compiler it seems even ignores if the files containing the function are included or not...



double mapRange(double value, double r1, double r2, double n1, double n2)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
return res;
}


as you can see when it prints the value it is correct however when I print the returned value from another function like main I get garbage numbers...
Worst thing is I tested it on a file by itself and it worked flawlessly, I know this seems like an error from my part but I really can't find an explanation for this... Has someone encountered something like that? Is my compiler broken? Is there any limits in C that I'm not aware of? I know too that I don't have much more code to offer than this which kind of makes it difficult for a diagnosis but it's from a rather not-so-small project for uni...



EDIT 1:
OK so



// main.c



 #ifndef UTIL_H
#define UTIL_H
#include "util.h"
#endif /*UTIL_H*/

int main(int argc, char *argv) {
Matrix* volcan = readVolcano("test.txt");
double t;
mapRange(7.0, 1.0, 9.0, 0.0, 1.0,&t);
printf("%fn..n", t);
mat_printinfo(volcan);
mat_printmat(volcan, NULL);
weighted_volcano(volcan, NULL, NULL, NULL);
mat_free(volcan);
return 0;
}


// util.c



#include "util.h"


/*
Retorna una transformacion de value que esta entre r1 y r2 a un valor que esta
entre n1 y n2, con tal que tenga la misma relacion con el rango [n1, n2] como
value tenga con el rango [r1, r2]
*/


double mapRange(double value, double r1, double r2, double n1, double n2, double* result)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
if(result!=NULL)
*result = res;
return res;
}


I'm absolutely sure there's not a duplicate in definition, I've also rebuilt the project many times...



D:CodeCvolcancc1.exe    [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanmain.c In function 'main':
52 19 D:CodeCvolcanmain.c [Warning] initialization makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'open_volcano':
91 7 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'test_volcano':
119 13 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanvolcantobmp.c In function 'weighted_volcano':
38 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
40 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C


the output of the IDE



EDIT 2:
So it seems the problem was here



// util.h



#include "headers.h"


it was empty...










share|improve this question
















I have this weird problem where sometimes this function not always work, and only works if it's declared in the same headers where it is called... It's a really strange thing because the compiler it seems even ignores if the files containing the function are included or not...



double mapRange(double value, double r1, double r2, double n1, double n2)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
return res;
}


as you can see when it prints the value it is correct however when I print the returned value from another function like main I get garbage numbers...
Worst thing is I tested it on a file by itself and it worked flawlessly, I know this seems like an error from my part but I really can't find an explanation for this... Has someone encountered something like that? Is my compiler broken? Is there any limits in C that I'm not aware of? I know too that I don't have much more code to offer than this which kind of makes it difficult for a diagnosis but it's from a rather not-so-small project for uni...



EDIT 1:
OK so



// main.c



 #ifndef UTIL_H
#define UTIL_H
#include "util.h"
#endif /*UTIL_H*/

int main(int argc, char *argv) {
Matrix* volcan = readVolcano("test.txt");
double t;
mapRange(7.0, 1.0, 9.0, 0.0, 1.0,&t);
printf("%fn..n", t);
mat_printinfo(volcan);
mat_printmat(volcan, NULL);
weighted_volcano(volcan, NULL, NULL, NULL);
mat_free(volcan);
return 0;
}


// util.c



#include "util.h"


/*
Retorna una transformacion de value que esta entre r1 y r2 a un valor que esta
entre n1 y n2, con tal que tenga la misma relacion con el rango [n1, n2] como
value tenga con el rango [r1, r2]
*/


double mapRange(double value, double r1, double r2, double n1, double n2, double* result)
{
double res = n1+(value-r1)*((n2-n1)/(r2-r1));
printf("dividingby: %f", res);putchar('n');
if(result!=NULL)
*result = res;
return res;
}


I'm absolutely sure there's not a duplicate in definition, I've also rebuilt the project many times...



D:CodeCvolcancc1.exe    [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanmain.c In function 'main':
52 19 D:CodeCvolcanmain.c [Warning] initialization makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'open_volcano':
91 7 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcanmain.c In function 'test_volcano':
119 13 D:CodeCvolcanmain.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C
D:CodeCvolcanvolcantobmp.c In function 'weighted_volcano':
38 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
40 6 D:CodeCvolcanvolcantobmp.c [Warning] assignment makes pointer from integer without a cast
D:CodeCvolcancc1.exe [Warning] command line option '-std=c++11' is valid for C++/ObjC++ but not for C


the output of the IDE



EDIT 2:
So it seems the problem was here



// util.h



#include "headers.h"


it was empty...







c function double






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 2:01









Keith Thompson

195k26290484




195k26290484










asked Nov 27 '18 at 1:30









KurinokuKurinoku

12




12








  • 1





    Do you have another function named mapRange that takes different parameters? Do you have a prototype for this function that is visible everywhere it is called? Do you have the warnings turned up on your compiler, and do you see any when you compile?

    – Retired Ninja
    Nov 27 '18 at 1:34











  • when you import this function from another file, post your code. show your usage and how you are importing/declaring

    – HappyKeyboard
    Nov 27 '18 at 1:35











  • Sounds like this function mapRange is defined in one C source file, and the calling function (like main) is defined in another. So the question is, when main is being compiled, how does the compiler know that mapRange returns a dounle? The answer is, the compiler needs to be able to see an external prototype declaration for mapRange. Typically you put this in a header file, maybe maprange.h. Then you use #include to pull maprange.h in to both source files as they are being compiled.

    – Steve Summit
    Nov 27 '18 at 1:41













  • But if this isn't making sense, you'll want to find a tutorial on separate compilation, which can be confusing at first.

    – Steve Summit
    Nov 27 '18 at 1:42











  • You missed the most important file. util.h, and those warnings don't match the code you've posted. You might want to make a Minimal, Complete, and Verifiable example to highlight just the issue you're asking about. Given the warnings you posted I'm not surprised you have issues, but none of them seem to relate to this particular one.

    – Retired Ninja
    Nov 27 '18 at 1:47
















  • 1





    Do you have another function named mapRange that takes different parameters? Do you have a prototype for this function that is visible everywhere it is called? Do you have the warnings turned up on your compiler, and do you see any when you compile?

    – Retired Ninja
    Nov 27 '18 at 1:34











  • when you import this function from another file, post your code. show your usage and how you are importing/declaring

    – HappyKeyboard
    Nov 27 '18 at 1:35











  • Sounds like this function mapRange is defined in one C source file, and the calling function (like main) is defined in another. So the question is, when main is being compiled, how does the compiler know that mapRange returns a dounle? The answer is, the compiler needs to be able to see an external prototype declaration for mapRange. Typically you put this in a header file, maybe maprange.h. Then you use #include to pull maprange.h in to both source files as they are being compiled.

    – Steve Summit
    Nov 27 '18 at 1:41













  • But if this isn't making sense, you'll want to find a tutorial on separate compilation, which can be confusing at first.

    – Steve Summit
    Nov 27 '18 at 1:42











  • You missed the most important file. util.h, and those warnings don't match the code you've posted. You might want to make a Minimal, Complete, and Verifiable example to highlight just the issue you're asking about. Given the warnings you posted I'm not surprised you have issues, but none of them seem to relate to this particular one.

    – Retired Ninja
    Nov 27 '18 at 1:47










1




1





Do you have another function named mapRange that takes different parameters? Do you have a prototype for this function that is visible everywhere it is called? Do you have the warnings turned up on your compiler, and do you see any when you compile?

– Retired Ninja
Nov 27 '18 at 1:34





Do you have another function named mapRange that takes different parameters? Do you have a prototype for this function that is visible everywhere it is called? Do you have the warnings turned up on your compiler, and do you see any when you compile?

– Retired Ninja
Nov 27 '18 at 1:34













when you import this function from another file, post your code. show your usage and how you are importing/declaring

– HappyKeyboard
Nov 27 '18 at 1:35





when you import this function from another file, post your code. show your usage and how you are importing/declaring

– HappyKeyboard
Nov 27 '18 at 1:35













Sounds like this function mapRange is defined in one C source file, and the calling function (like main) is defined in another. So the question is, when main is being compiled, how does the compiler know that mapRange returns a dounle? The answer is, the compiler needs to be able to see an external prototype declaration for mapRange. Typically you put this in a header file, maybe maprange.h. Then you use #include to pull maprange.h in to both source files as they are being compiled.

– Steve Summit
Nov 27 '18 at 1:41







Sounds like this function mapRange is defined in one C source file, and the calling function (like main) is defined in another. So the question is, when main is being compiled, how does the compiler know that mapRange returns a dounle? The answer is, the compiler needs to be able to see an external prototype declaration for mapRange. Typically you put this in a header file, maybe maprange.h. Then you use #include to pull maprange.h in to both source files as they are being compiled.

– Steve Summit
Nov 27 '18 at 1:41















But if this isn't making sense, you'll want to find a tutorial on separate compilation, which can be confusing at first.

– Steve Summit
Nov 27 '18 at 1:42





But if this isn't making sense, you'll want to find a tutorial on separate compilation, which can be confusing at first.

– Steve Summit
Nov 27 '18 at 1:42













You missed the most important file. util.h, and those warnings don't match the code you've posted. You might want to make a Minimal, Complete, and Verifiable example to highlight just the issue you're asking about. Given the warnings you posted I'm not surprised you have issues, but none of them seem to relate to this particular one.

– Retired Ninja
Nov 27 '18 at 1:47







You missed the most important file. util.h, and those warnings don't match the code you've posted. You might want to make a Minimal, Complete, and Verifiable example to highlight just the issue you're asking about. Given the warnings you posted I'm not surprised you have issues, but none of them seem to relate to this particular one.

– Retired Ninja
Nov 27 '18 at 1:47














2 Answers
2






active

oldest

votes


















0














Based on your description, it is most likely that there is another "mapRange" function somewhere in your "code base".



Just to isolate the problem, I recommend renaming your "mapRange" function to something unique like appending today's date (mapRange_20181127) leaving mapRange call in main(). If your "code base" contains another function with name "mapRange", you will not face any error as linker would find the "other" mapRange.



If this is the case, choosing another meaningful name would solve your issue.



Hope this helps!



Update:
I guess while I'm typing, you posted more details and you got your answer :).






share|improve this answer


























  • yes thank you either way for taking your time and trying to help, i really apreciate it

    – Kurinoku
    Nov 27 '18 at 1:55





















0














@SteveSummit gave me the solution it needed a prototype declaration for the function in util.h






share|improve this answer
























    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%2f53491499%2fc-function-of-double-type-sometimes-works-when-declared-in-certain-headers%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Based on your description, it is most likely that there is another "mapRange" function somewhere in your "code base".



    Just to isolate the problem, I recommend renaming your "mapRange" function to something unique like appending today's date (mapRange_20181127) leaving mapRange call in main(). If your "code base" contains another function with name "mapRange", you will not face any error as linker would find the "other" mapRange.



    If this is the case, choosing another meaningful name would solve your issue.



    Hope this helps!



    Update:
    I guess while I'm typing, you posted more details and you got your answer :).






    share|improve this answer


























    • yes thank you either way for taking your time and trying to help, i really apreciate it

      – Kurinoku
      Nov 27 '18 at 1:55


















    0














    Based on your description, it is most likely that there is another "mapRange" function somewhere in your "code base".



    Just to isolate the problem, I recommend renaming your "mapRange" function to something unique like appending today's date (mapRange_20181127) leaving mapRange call in main(). If your "code base" contains another function with name "mapRange", you will not face any error as linker would find the "other" mapRange.



    If this is the case, choosing another meaningful name would solve your issue.



    Hope this helps!



    Update:
    I guess while I'm typing, you posted more details and you got your answer :).






    share|improve this answer


























    • yes thank you either way for taking your time and trying to help, i really apreciate it

      – Kurinoku
      Nov 27 '18 at 1:55
















    0












    0








    0







    Based on your description, it is most likely that there is another "mapRange" function somewhere in your "code base".



    Just to isolate the problem, I recommend renaming your "mapRange" function to something unique like appending today's date (mapRange_20181127) leaving mapRange call in main(). If your "code base" contains another function with name "mapRange", you will not face any error as linker would find the "other" mapRange.



    If this is the case, choosing another meaningful name would solve your issue.



    Hope this helps!



    Update:
    I guess while I'm typing, you posted more details and you got your answer :).






    share|improve this answer















    Based on your description, it is most likely that there is another "mapRange" function somewhere in your "code base".



    Just to isolate the problem, I recommend renaming your "mapRange" function to something unique like appending today's date (mapRange_20181127) leaving mapRange call in main(). If your "code base" contains another function with name "mapRange", you will not face any error as linker would find the "other" mapRange.



    If this is the case, choosing another meaningful name would solve your issue.



    Hope this helps!



    Update:
    I guess while I'm typing, you posted more details and you got your answer :).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 27 '18 at 1:55

























    answered Nov 27 '18 at 1:51









    Mohana RaoMohana Rao

    51415




    51415













    • yes thank you either way for taking your time and trying to help, i really apreciate it

      – Kurinoku
      Nov 27 '18 at 1:55





















    • yes thank you either way for taking your time and trying to help, i really apreciate it

      – Kurinoku
      Nov 27 '18 at 1:55



















    yes thank you either way for taking your time and trying to help, i really apreciate it

    – Kurinoku
    Nov 27 '18 at 1:55







    yes thank you either way for taking your time and trying to help, i really apreciate it

    – Kurinoku
    Nov 27 '18 at 1:55















    0














    @SteveSummit gave me the solution it needed a prototype declaration for the function in util.h






    share|improve this answer




























      0














      @SteveSummit gave me the solution it needed a prototype declaration for the function in util.h






      share|improve this answer


























        0












        0








        0







        @SteveSummit gave me the solution it needed a prototype declaration for the function in util.h






        share|improve this answer













        @SteveSummit gave me the solution it needed a prototype declaration for the function in util.h







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 27 '18 at 1:57









        KurinokuKurinoku

        12




        12






























            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%2f53491499%2fc-function-of-double-type-sometimes-works-when-declared-in-certain-headers%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

            To store a contact into the json file from server.js file using a class in NodeJS

            Redirect URL with Chrome Remote Debugging Android Devices

            Dieringhausen