Undefined Reference To Winmain 16 Dev C%2b%2b

Posted on by
  1. Undefined Reference To Winmain@16' Dev C++
  2. Undefined Reference To Winmain 16 Dev C++ Full

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
  1. #include 'frac.h'
  2. #include 'gcd.h'
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int x,y;
  8. cout << 'Enter positive integer x: ';
  9. cin >> x;
  10. cout << 'Enter positive integer y: ';
  11. cin >> y;
  12. cout << FractionType::Initialize(x,y) << endl;
  13. system('pause'); //keeps window open
  14. return 0;
  15. }
myFrac.cpp
  1. #include 'frac.h'
  2. #include 'gcd.h'
  3. void FractionType::Initialize(int numerator, int denominator)
  4. // Function: Initialize the fraction
  5. // Pre: None
  6. // Post: numerator is stored in num; denominator is stored in
  7. // denom
  8. {
  9. num = numerator;
  10. denom = denominator;
  11. int cfactor = gcd(num, denom); // finds commom factor
  12. num = num/cfactor; //reduces numerator
  13. denom = denom/cfactor; //reduces denominator
  14. }
  15. int FractionType::NumeratorIs()
  16. // Function: Returns the value of the numerator
  17. // Pre: Fraction has been initialized
  18. // Post: numerator is returned
  19. {
  20. return num;
  21. }
  22. int FractionType::DenominatorIs()
  23. // Function: Returns the value of the denominator
  24. // Pre: Reaction has been initialized
  25. // Post: denominator is returned
  26. {
  27. return denom;
  28. }
  29. bool FractionType::IsZero()
  30. // Function: Determines if fraction is zero
  31. // Pre: Fraction has been initialized
  32. // Post: Returns true if numerator is zero
  33. {
  34. return (num 0);
  35. }
  36. bool FractionType::IsNotProper()
  37. // Function: Determines if fraction is a proper fraction
  38. // Pre: Fraction has been initialized
  39. // Post: Returns true if num is greater than or equal to denom
  40. {
  41. return (num >= denom);
  42. }
  43. int FractionType::ConvertToProper()
  44. // Function: Converts the fraction to a whole number and a
  45. // fractional part
  46. // Pre: Fraction has been initialized, is in reduced form, and
  47. // is not a proper fraction
  48. // Post: Returns num divided by denom
  49. // num is original num % denom; denom is not changed
  50. {
  51. int result;
  52. result = num / denom;
  53. num = num % denom;
  54. return result;
  55. }
gcd.cpp (finds greatest common divisor)
  1. int gcd(int x, int y)
  2. {
  3. if (y0)
  4. {
  5. return x;
  6. }
  7. else
  8. {
  9. while (y>0)
  10. {
  11. int step1 = x%y;
  12. x = y;
  13. y = step1;
  14. if (x%y0)
  15. {
  16. return y;
  17. }
  18. }
  19. }
  20. return 0;
  21. }
then I just have to two header files (frac.h and gcd.h)that I know are correct
Thank you for looking!