WinMain is not needed even if it is a Win32 GUI project. /zoiper-free-download.html. – chris Nov 16 '13 at 16:05 show 2 more comments 7 Answers 7. Undefined reference Put simply, the “undefined reference” error means you have a reference (nothing to do with the C reference type) to a name (function, variable, constant etc.) in your program that the linker cannot find a definition for when it looks through all the object files and libraries that make up your project. Jun 19, 2010 Linker error undefined reference to `WinMain@16' ld returned 1 exit status: 2. I don't know how dev c works, but there is probably a way to. I am getting a Linker Error undefined reference to 'WinMain@16' and I am unable to fix the issue. I am using Dev-C - In my project settings 'Win32 Console' is selected as I want it to be a console application. Example Header (Test.h). APIs and reference; Dev centers. VC treats main, wmain, WinMain and wWinMain as special, it explicitly looks out for these and makes sure that they. Linker Error Undefined Reference To Winmain 16 is the error name that contains the details of the error, including why it occurred, which system component or application malfunctioned to cause this error along with some other information.
Undefined Reference To Winmain@16' Dev C++
Undefined Reference To Winmain 16 Dev C++ Full
P: 14
Hi everyone, I'm new to programming with C++ and I'm using Code::Blocks as my compiler. I keep getting the error 'undefined reference to WinMain@16' and I have no idea how to fix it. My code is supposed to do different things with fractions, but anyway here is my code:(all code is in a project) myFracDr.cpp
#include 'frac.h'
#include 'gcd.h'
#include <iostream>
using namespace std;
int main()
{
int x,y;
cout << 'Enter positive integer x: ';
cin >> x;
cout << 'Enter positive integer y: ';
cin >> y;
cout << FractionType::Initialize(x,y) << endl;
system('pause'); //keeps window open
return 0;
}
myFrac.cpp
#include 'frac.h'
#include 'gcd.h'
void FractionType::Initialize(int numerator, int denominator)
// Function: Initialize the fraction
// Pre: None
// Post: numerator is stored in num; denominator is stored in
// denom
{
num = numerator;
denom = denominator;
int cfactor = gcd(num, denom); // finds commom factor
num = num/cfactor; //reduces numerator
denom = denom/cfactor; //reduces denominator
}
int FractionType::NumeratorIs()
// Function: Returns the value of the numerator
// Pre: Fraction has been initialized
// Post: numerator is returned
{
return num;
}
int FractionType::DenominatorIs()
// Function: Returns the value of the denominator
// Pre: Reaction has been initialized
// Post: denominator is returned
{
return denom;
}
bool FractionType::IsZero()
// Function: Determines if fraction is zero
// Pre: Fraction has been initialized
// Post: Returns true if numerator is zero
{
return (num 0);
}
bool FractionType::IsNotProper()
// Function: Determines if fraction is a proper fraction
// Pre: Fraction has been initialized
// Post: Returns true if num is greater than or equal to denom
{
return (num >= denom);
}
int FractionType::ConvertToProper()
// Function: Converts the fraction to a whole number and a
// fractional part
// Pre: Fraction has been initialized, is in reduced form, and
// is not a proper fraction
// Post: Returns num divided by denom
// num is original num % denom; denom is not changed
{
int result;
result = num / denom;
num = num % denom;
return result;
}
gcd.cpp (finds greatest common divisor)
int gcd(int x, int y)
{
if (y0)
{
return x;
}
else
{
while (y>0)
{
int step1 = x%y;
x = y;
y = step1;
if (x%y0)
{
return y;
}
}
}
return 0;
}
then I just have to two header files (frac.h and gcd.h)that I know are correct Thank you for looking!