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
1
vote
2 answers

Undefined reference to WinMain@16 in C++

i was taking the MSDN lesson for programming windows with C++ so i tried their code: #ifndef UNICODE #define UNICODE #endif #include LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); int WINAPI…
Maurice Rodriguez
  • 663
  • 2
  • 7
  • 17
1
vote
1 answer

Convert Win32 Application to Object

I'm pretty new to WinAPI programming, and have written a Win32 application for screen capture. When I run the program, the cursor immediately changes to a crosshair and I can click and drag to capture a portion of the screen and save it to…
1
vote
1 answer

C++ Linked List Class -> header file

Possible Duplicate: undefined reference to `WinMain@16' Ive been working on a circular, double linked list. Decided to create a class and use a header. I'm new to C++ so i checked to see how to implement it. I'm not sure if i correctly…
George
  • 337
  • 2
  • 7
  • 16
1
vote
1 answer

_tWinMain in static lib LNK2019

I try put main(WinMain) in static library: #include #include int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {...} but I got: MSVCRTD.lib(crtexew.obj) : error LNK2019:…
Ivan
  • 673
  • 7
  • 15
1
vote
1 answer

undefined reference to `_WinMain@16' with cygwin and mingw in openssl

I kind of am struggling with OpenSSL over here. I downloaded the current release 1.0.1 and the compilation itself works. I can even call ./apps/openssl.exe. But when I get to the linking process the linker…
javex
  • 7,198
  • 7
  • 41
  • 60
0
votes
1 answer

Hiding the winmain() function

is there any way to hide the WinMain() function inside a class? Thank you.
Anon
  • 1,274
  • 4
  • 17
  • 44
0
votes
1 answer

Winmain Cant Display Message in Autostart

I have a win32 program, when run manually, it display a message in WinMain, but when I put the same program under registry (Run) so that when the PC reboots, it will run automatically, the message will never appear (but the program run…
Clement
  • 3
  • 1
0
votes
0 answers

Undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status error

I'am trying to compile my code using a Makefile, but when I type make in the terminal this error occures: " g++ -I/mingw64/include/ncurses -o GAME -lncurses -L/mingw64/bin…
0
votes
0 answers

How to solve the undefined reference to `WinMain' error for links made on command line?

I'm doing a test. I have created an empty qmake project with Qt creator. I added a file main.cpp. A small code in main.cpp just displays a button. I want to use the created main.o file to build the obtained application in Qt Creator. For this, I…
Kev_
  • 29
  • 6
0
votes
0 answers

WinMain taken from docs can't be compiled

I have the following declaration of WinMain. int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) This compiles, however it generates the following warning. Warning C28251 Inconsistent…
sanitizedUser
  • 1,723
  • 3
  • 18
  • 33
0
votes
1 answer

undefined reference to `WinMain' in eclipse IDE with cygwin (setup-x86_64)

I am currently doing unit testing for a project of c/c++ in eclipse IDE (Version: Luna Service Release 2 (4.4.2)) and I have recently upgraded my cygwin to cygwin64 to make it compatible with c++17 standard and my g++ version is g++ (GCC) 10.2.0,…
Neetika
  • 17
  • 2
0
votes
0 answers

If MinGW-w64 doesn't support wWinMain, then what C++ compiler should I use instead?

I've been attempting to follow this guide here for writing a program in C++ that allows me to create an application window, however I ran into an issue where whenever I used Run Build Task with MinGW-w64 on the example code provided on the page…
0
votes
0 answers

undefined reference to WinMain c programming language in vscode

Altough I save my project, I get these errors When I run parametric_stack_arr.c I got this error D:/Qt/Tools/mingw810_64/bin/../lib/gcc/x86_64- w64-mingw32/8.1.0/../../../../x86_64-w64- mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a…
baseroglu
  • 11
  • 3
0
votes
0 answers

error in compiling my first code in C++ in VS code editor through mingW

I have authored the following Hello World C++ example... #include using namespace std; int main(){ cout << "Hello World!"; return 0; } ...however, I am getting the following error message. "e:\reality\visual studio\" &&…
0
votes
0 answers

How can I setup mingw to run cpp, specifically this undefined reference to winmain

I am new to c++. I have installed MingGw 64 and vscode and I am trying to run this basic program but this message comes up. C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:…
Crown
  • 1
1 2 3
8 9