Undefined reference C++

后端 未结 2 1174
清酒与你
清酒与你 2020-12-01 23:42

I\'m trying to compile my first legit program that I\'m converting from Java (I ran a test hello world type program to check my compiler and it works). There are three files

2条回答
  •  执笔经年
    2020-12-02 00:33

    Not sure if this is the problem, but it appears you're prototyping the function twice.

    The double getSkewNormal(double skewValue, double x); line need only be in the header, not in main.cpp as well (since main.cpp includes skewNormal.h). Having it appear twice in a prototype form seems likely to confuse the compiler. You only need it to be visible to the code once, and usually that should be in a header (not a code file).

    Try removing that line from main.cpp and recompile. :)

提交回复
热议问题