| 
| What is "resolving _WinMain@16 by linking to _WinMain" [message #1833377] | Sun, 11 October 2020 20:36  |  | 
| Eclipse User  |  |  |  |  | I'm still pretty new at c++ so don't be too harsh but when I was compiling, this warning happened: 
 c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _WinMain@16 by linking to _WinMain
 
 and here is my code if you all are wondering:
 
 #include <iostream>
 #include <cmath>
 #include <SDL.h>
 using namespace std;
 
 double power(double base, int exponent)
 {
 double result = 1;
 
 for(int i = 0; i < exponent; i++)
 {
 result = result * base;
 }
 return result;
 }
 
 int WinMain()
 
 {
 
 bool ttrue = true;
 cout << "Hello would you like to use the Exponent Calculator? Type yes to continue.";
 string answer;
 cin >> answer;
 
 if(answer == "yes")
 {
 ttrue = 1;
 cout << "That's great! We'll need to find out a few stuff from you first. ";
 }
 
 else if(answer != "yes")
 {
 ttrue = false;
 cout << "Then what are you doing here? Get out!";
 }
 
 
 if(ttrue == 1)
 {
 int base, exponent;
 cout << "What is the base?: ";
 cin >> base;
 cout << "What is the exponent?: ";
 cin >> exponent;
 double myPower = power(base,exponent);
 cout << "Your final answer is " << myPower << "!";
 
 }
 
 return 0;
 
 }
 
 as you can see, I am using WinMain because one of the libraries, SDL, requires the use of it. Changing WinMain to regular main will cause an error instead of a warning. Obviously, I want a warning-free compilation so any ideas?
 |  |  |  | 
|  | 
Powered by 
FUDForum. Page generated in 0.03459 seconds