Note that there are some explanatory texts on larger screens.

plurals
  1. POcmath functions generating compiler error
    primarykey
    data
    text
    <p>I've written a small program that utilizes the Fast Light Toolkit and for some reason a compiler error is generated when trying to access the functions in the cmath header.</p> <p>Such as error ::acos has not been declared.</p> <p>This goes on for pretty much every function it tries to use in the header. What could I be missing?</p> <p>The header files I have included are</p> <pre><code>Simple_window.h Graph.h </code></pre> <p>both of which are part of the FLTK.</p> <p>The code is this:</p> <pre><code> #include "Simple_window.h" // get access to our windows library #include "Graph.h" // get access to graphics library facilities int main() { using namespace Graph_lib; // our graphics facilities are in Graph_lib Point tl(100,100); // to become top left corner of window Simple_window win(tl,600,400,"Canvas"); // make a simple window Polygon poly; // make a shape (a polygon) poly.add(Point(300,200)); // add a point poly.add(Point(350,100)); // add another point poly.add(Point(400,200)); // add a third point poly.set_color(Color::red); // adjust properties of poly win.attach(poly); // connect poly to the window win.wait_for_button(); // give control to display engine } </code></pre> <p>Edit: Here is example code of when the compiler error is generated. This is inside the cmath header.</p> <pre><code>namespace std { // Forward declaration of a helper function. This really should be // an `exported' forward declaration. template&lt;typename _Tp&gt; _Tp __cmath_power(_Tp, unsigned int); inline double abs(double __x) { return __builtin_fabs(__x); } inline float abs(float __x) { return __builtin_fabsf(__x); } inline long double abs(long double __x) { return __builtin_fabsl(__x); } using ::acos; //ERROR HERE inline float acos(float __x) { return __builtin_acosf(__x); } inline long double acos(long double __x) { return __builtin_acosl(__x); } template&lt;typename _Tp&gt; inline typename __enable_if&lt;double, __is_integer&lt;_Tp&gt;::_M_type&gt;::_M_type acos(_Tp __x) { return __builtin_acos(__x); } </code></pre> <p>Edit: Code::blocks is saving files as C files....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload