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

Hello world,

Greetings!PyCharm is an IDE I'm quite familiar with, so when (again) starting with C/C it was only natural to take a peek at CLion (nice timing to pushing out the 1.0 btw).But I'm running into tr.


compiling the minimal example ( http://wiki.wxwidgets.org/wiki.pl?Hello_World ) brings the following output:
---
-I'f:/Dev-Cpp/include/c++/backward' -I'f:/Dev-Cpp/include' -I'D:/wx242/wxWindows-2.4.2/include' -I'D:/wx242/wxWindows-2.4.2/wxbuild/lib/wx/include/msw-2.4' -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -DHAVE_W32API_H -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -Os -fno-rtti -fno-exceptions -pg -g3
g++.exe -D__DEBUG__ HelloWorldApp.o -o 'test.exe' -L'f:/Dev-Cpp/lib' -L'D:/msys/1.0/local/lib' -mwindows -Wl,--subsystem,windows -mwindows D:/msys/1.0/local/lib/libwxmsw242.a -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid -s -lgmon -pg -g3 Undefined Reference To Winmain 16 Dev C%2b%2b
d:/dev-cpp/bin/../lib/gcc-lib/mingw32/3.3.1/../../../libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `[email protected]'Undefined Reference To Winmain 16 Dev C%2b%2b
mingw32-make.exe: *** [test.exe] Error 1

Undefined Reference To Winmain 16 Dev C++ Test


Undefined Reference To Winmain@16' C++

---
Google says: http://www.bloodshed.net/faq.html#3
What the heck is going on here? Does anybody know how to fix this? Wxwidgets doesn't have any main function
Regards,
Undefined Reference To Winmain 16 Dev C%2b%2bOliver
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!