Apr 23, 2006 Which library does a Dev-C compiled program have to link with to resolve the following Linker error: undefined reference to 'WinMain@16' ld.
hay I am using dev c++ and I am having these errors.
[Linker error] undefined reference to `point::point(double, double)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::point(double, double)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::point(point const&)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::operator=(point const&)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::x() const'
[Linker error] undefined reference to `point::y() const'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
32:2 C:Dev-Cppincludec++3.4.2backwardbackward_warning.h more undefined references to `point::~point()' follow
32:2 C:Dev-Cppincludec++3.4.2backwardbackward_warning.h ld returned 1 exit status
and my program is:
// program
#include<string.h>
using namespace std;
class point
{
public:
point(double=0.0,double=0.0);
point(const point&);
~point();
point& operator=(const point&);
double x() const;
double y() const;
string tostring() const;
protected:
double _x, _y;
};
int main()
{
point p0;
cout << 'p0 = ' << p0.tostring() << endl;
point p1(5,-2);
cout << 'p1 = ' << p1.tostring() << endl;
point p2=p1;
cout << 'p2 = ' << p2.tostring() << endl;
p0=p1;
cout << 'p0 = ' << p0.tostring() << endl;
cout << 'p0.x() = ' << p0.x() << endl;
cout << 'p0.y() = ' << p0.y() << endl;
system('pause');
}
// Please help me out of these errors.
// please donot refer me to any other post at all. I have read all of the post might be there would be answer in those posts but I am unable to understand that since I am a biggner. Please help me.
[Linker error] undefined reference to `point::point(double, double)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::point(double, double)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::point(point const&)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::operator=(point const&)'
[Linker error] undefined reference to `point::tostring() const'
[Linker error] undefined reference to `point::x() const'
[Linker error] undefined reference to `point::y() const'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
[Linker error] undefined reference to `point::~point()'
32:2 C:Dev-Cppincludec++3.4.2backwardbackward_warning.h more undefined references to `point::~point()' follow
32:2 C:Dev-Cppincludec++3.4.2backwardbackward_warning.h ld returned 1 exit status
and my program is:
// program
#include<string.h>
using namespace std;
class point
{
public:
point(double=0.0,double=0.0);
point(const point&);
~point();
point& operator=(const point&);
double x() const;
double y() const;
string tostring() const;
protected:
double _x, _y;
};
int main()
{
point p0;
cout << 'p0 = ' << p0.tostring() << endl;
point p1(5,-2);
cout << 'p1 = ' << p1.tostring() << endl;
point p2=p1;
cout << 'p2 = ' << p2.tostring() << endl;
p0=p1;
cout << 'p0 = ' << p0.tostring() << endl;
cout << 'p0.x() = ' << p0.x() << endl;
cout << 'p0.y() = ' << p0.y() << endl;
system('pause');
}
// Please help me out of these errors.
// please donot refer me to any other post at all. I have read all of the post might be there would be answer in those posts but I am unable to understand that since I am a biggner. Please help me.
Linker Error Dev C Download
Jun 05, 2012 Linker errorundefined reference to 'ibdev@24' Linker errorundefined reference to 'ibwrt@12' Linker errorundefined reference to 'ibrd@12' Linker errorundefined reference to 'ibcntl' and a host of other undefined references to functions defined in the header file mentioned above. It means that you have not enabled the graphics library for linking. By default this setting is OFF when you install Turbo C version 3.0. All you need to do is, from turbo c menu, goto Options - Linker - Libraries. And check the Graphics Library option. The solution: i rename the c: mingw folder and everything start working. Coding ALL How-tos Win 10 Win 8 Win 7 Win XP Win Vista Win 95/98 Win NT Win Me Win 2000 Win 2012 Win 2008 Win 2003 Win 3.1 E-Home Office PC Games Con Games Drivers Linux Websites E-Photo Hardware Security Coding PDAs Networks iPhone Android Database CPUs Solaris Novell.