Linker Error Winmain
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring linker error undefined reference to winmain@16' dev c++ developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
Dev C++ Undefined Reference To
Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join
[linker Error] Undefined Reference To `__dyn_tls_init_callback'
them; it only takes a minute: Sign up Linker error undefined reference to `WinMain@16', ld returned 1 exit status up vote 0 down vote favorite 1 I'm having this error: Linker error undefined reference toWinMain@16'` Here's the code: #include
Linker Error Undefined Reference In C
#include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings c++ undefined reference to function and policies of this site About Us Learn more about Stack unresolved external symbol c++ Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; http://stackoverflow.com/questions/21127146/linker-error-undefined-reference-to-winmain16-ld-returned-1-exit-status it only takes a minute: Sign up Linker error: undefined reference to 'function', 'WinMain@16' C up vote 1 down vote favorite I have a piece of a project in which I have some code files defining functions, some header files, and then a .c file for testing (which has the main()). Particularly, I have these files all in the same http://stackoverflow.com/questions/20273369/linker-error-undefined-reference-to-function-winmain16-c folder (both .c and .h): “dice”, “game”, “map”, “players”. Then there's “test”, this last one only .c. In all the .h files there's the same type of declaration at the begining (this is from “game.h”): #ifndef GAME_H #define GAME_H #include "dice.h" #include "map.h" #include "players.h" //then there goes the short declaration of the functions in game.c #endif The stdio.h is also added in the .c files. My problem is that I get all the time an error like this: "[Linker Error]: undefined reference to 'whatever_the_function_is_called'" (for like 2 or three functions), and "[Linker Error]: undefined reference to 'WinMain@16'". "Id returned 1 exit status". The only thing I managed to solve is the “WinMain@16” error by adding “void” before the main(), but I've never needed this before. Actually, in an earlier version of the project none of this happened. I've checked my spelling and looked over the case sensitivity, revised the parameters, checked over that the functions were written on the right place, and tested a lot of other things a bunch of times, but nothing worked.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the http://stackoverflow.com/questions/21652922/undefined-reference-to-winmain-error-id-returned-1-exit-status company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million https://www.gidforums.com/t-8754.html programmers, just like you, helping each other. Join them; it only takes a minute: Sign up undefined reference to WinMain, [Error] Id returned 1 exit status up vote 0 down vote favorite What have I screwed up undefined reference here? There can be no hard coded values in the code which is why all my prompts are constants. We also have to call a user defined function to verify input. Im getting the following error when I compile -- undefined reference to WinMain, [Error] Id returned 1 exit status I'm using Dev C++ as an IDE #include
Thread Tools Search this Thread Rating: #1 23-Feb-2006, 19:36 vermin1302 Awaiting Email Confirmation Join Date: Feb 2006 Location: Indiana, USA Posts: 19 [Linker error] undefined reference to `WinMain@16' I'm using Dev-C++ 4.9.9.2 to compile a program I wrote about five years ago. I recall that it compiled without errors when I first wrote it. I had to change a few things, because I guess the code was getting a little old. Anyway, I got rid of all of the errors except this WinMain@16 thing. I've noticed that this can be a problem if you're writing a console program and accidentally have your project set to Windows Program, but I've checked this and it's definitely set as a console program. So now I'm not exactly sure what to do. My code is attached to the bottom of this post...please help if you can! chat.cpp CPP / C++ / C Code:
/* CPP Final Projekt JMVermillion chat.cpp If they can do it, so can I. 24 hours! All of the WinSock routines were blatantly butchered from Open-Source code. Thanks to the authors. :) */ #includeusing namespace std; #include "chat.h" CComm::CComm() { ListenSocket = INVALID_SOCKET; // Start with INVALID socket. Ease of use. /* Check to see if it's a Windows machine. If not, don't worry. */ #ifdef _WIN32 // Why does Windows *need* WinSock? Who knows... WORD VersionRequested = MAKEWORD(1,1); WSADATA wsaData; WSAStartup(VersionRequested, &wsaData); // starts the Winsock service if ( wsaData.wVersion != VersionRequested ) { cout << "Error Code \"MI