Questions tagged [winmain]

WinMain is the user provided entry point for graphical Windows based applications.

WinMain is the user provided entry point for graphical Windows based applications. It is used as an entry point in every such Windows application. WinMain is used to initialize the application, display its main window, and enter a message retrieval-and-dispatch loop that is the top-level control structure for the remainder of the application's execution.

125 questions
0
votes
0 answers

error : undefined reference to winmain sur codeblocks /(sdl install)

To install SDL2 with codeblocks , i recieve when i compile the error : "undefined reference to winmain " I added -L mingw32 -L SDL2 -L SDL2main -mwindows but still the same problem anyone can help me please ?
wissal
  • 1
0
votes
0 answers

i cant C++ run vscode

I need help. I installed Visual Studio Code, then I installed the latest version of MingW for C++ programming. When I try to run the program, I got an error: "cc1plus is not detected". I tried to fix it on my own by putting the directory in the…
0
votes
0 answers

undefined reference to `WinMain@16' collect2: error: ld returned 1 exit status

I'm trying to follow an online course for ethical hacking from this video:https://www.youtube.com/watch?v=6Dc8i1NQhCM and I receive and error when I try to compile the backdoor. I am compiling it in Kali Linux with i686-w-64-mingw32-gcc…
0
votes
0 answers

undefined reference to `WinMain@16' in VS Code

I was running a simple linear search program on VS Code using the MinGW compiler for cpp, Here is the code: #include using namespace std; int main() { int a[10]={01,56,38,29,50,45,38,92,67,53}; int item,loc=NULL; cout<<"Enter the number…
Aditya Johorey
  • 53
  • 1
  • 1
  • 4
0
votes
1 answer

Compile error with winmain and simple code, "Previous decleration of WinMain"

#include #include int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { return(0); } I'm new to C. The above code returns the following error when I try to compile: main.c:3:5: error:…
0
votes
1 answer

'Undefined reference to `WinMain' ' error on minimal script, Dev-C++

I'm new to C and programming. I'm on Windows 10, I just installed Dev-C++ and I'm learning how to call functions from other files: i wrote this function to sum two numbers, and I call it from the main script. The problem is that when i compile the…
JuliusC
  • 1
  • 2
0
votes
0 answers

Problem when compiling in c++ : "undefined reference to 'WinMain'. Coding a game for mastermind

I'm currently working on an entry level C++ project to code the game mastermind (a secret code is generated and the user tries to crack it). We are just learning the basics of C++ (OOP, arrays and vectors, etc.), so the code seems to work fine.…
parzival
  • 23
  • 4
0
votes
4 answers

winmain@16 error

i found this code online and im trying to compile it, but gcc keeps on telling me that there is a undefined reference to WinMain@16. i have no idea where it is coming from, so im going to post the entire code. after searching online, i have only…
calccrypto
  • 8,583
  • 21
  • 68
  • 99
0
votes
1 answer

Does my main window receive edit controls upon creation or when I click on the update region?

I am very new to Win32 so please be gentle as I am surely not describing my question well at all, but am extremely serious about learning more. So, I have modified my main window to include the option to edit, both write and delete, text, but in…
viracocha
  • 111
  • 1
  • 6
0
votes
1 answer

Error message in codeblocks: Undefined reference to 'WinMain@16'

I want to run the following code in Codeblocks 20.03, but I get the error message: Undefined reference to 'WinMain@16'. Code: std::string countSheep(int number) { std::string res; std::string s = " sheep..."; for (int i = 1; i <= number;…
Syzygy
  • 31
  • 2
0
votes
1 answer

Piping console output from WinMain when running from a console

I'm trying to pipe standard output from a WinMain function i a VCL forms application, from a console. In particular, I need to do this in a console: mywinprogram.exe -v > toMyFile.txt where the -v stands for version. The information passed on is…
Totte Karlsson
  • 1,261
  • 1
  • 20
  • 55
0
votes
0 answers

Error using SDL2, SDL2_image with Cmake CLion on Windows

I've been trying to set up SDL2 and SDL2_image (developer packs) on Clion Windows. After trying to compile my compiler throws error: C:/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference…
J B-Sz
  • 1
0
votes
2 answers

WINAPI application closes when I press either ALT, why?

I had practised winapi apps before, but never got this problem. I have tried making a custom WindowProc to override default behaviour for WM_QUIT/WM_CLOSE/WM_DESTROY messages to do nothing, but the window still closes when I press ALT! This is the…
KijeviGombooc
  • 304
  • 2
  • 13
0
votes
0 answers

Simple program compiling in visual studio but not in clion

I tried to compile a simple win32 API program. And for some reason that I can't seem to get fixed, I get a compilation error in the Clion IDE which I usually use for coding. But the same code run perfectly fine with the visual studio IDE. Now I…
BenGababy
  • 11
  • 2
0
votes
1 answer

Why __tmainCRTStartup call WinMain when _UNICODE defined?

You can try this right now. Define both WinMain and wWinMain abd compile it as a static library. Make a new project for executable file exe. Set character set setting UNICODE system.(define _UNICODE) Link the static library just made. Then your…
ssss
  • 41
  • 1
  • 4
1 2 3
8 9