0

I wrote this small programm, just for testing purposes:

#include <iostream>

using namespace std;
int formn (int x) 
{
    int k;
    k = 2*x^2-4;
    return k;

}

/*
 * 
 */
int main() {
    int x1, x0, y1, y0, a, b, res;
    std::cin >> x0;
    std::cin >> x1;
    y0 = formn(x0);
    y1 = formn(x1);
    a = y1 - y0;
    b = x1 - x0;
    res = a/b;
    cout << endl << "P0(" << x0 << "|" << y0 << ") and P1(" << x1 << "|" << y1 << ") " << res << ".\n";
    return 0;
}

but as soon as I try to compile it, it gives me a linker error:

[Linker error] undefined reference to '__dyn_tls_init_callback' [Linker error] undefined reference to '__cpu_features_init' [Linker error] undefined reference to '_setargv' Id returned 1 exit status C:\Dev-Cpp\Makefile.win [Build Error] [proj001.exe] Error 1

Could someone help me please?

I was unable to find a way to solve this problem...

Mokka
  • 1
  • 2
  • 1
    This code fails before linking. Anyway, googling your error gave me http://stackoverflow.com/questions/17098217/dev-cpp-compiler-build-error – chris Mar 18 '15 at 19:30
  • I suspect that `^` doesn't do what you want it to do. There's also a missing quotation mark. – T.C. Mar 18 '15 at 19:36

0 Answers0