Recently, some readers informed us that they are facing the error lnk2005 _main, which is already installed.
Approved: Fortect
Requested
Visited 27k times
Hello, please, I read the same error I received, although I did not fix my problem, so I am using MS VC ++ 2010
and I have two ac and bc files ,
everyone works together and they all have simple and straightforward rules. But when I collect consumption shows this error ** Error LNK2005: _main is already defined in a.c **
, the same following error is displayed in the IED program block. I think it has to do with the main function being used twice. How do I now when I use the main function for one of the files
#include #include above all() int a = 9; if (a == 7) put ("These are seven numbers"); another Puts (“These are not seven pieces of information”); getch ();
#include #include above all() integer x = 10; printf ("% d", x); getch ();
1052
requested Oct 27, 14 at 8:42 am
135
Not The Answer You Are Looking For? Browse Other Questions Tagged C ++ T Visual-c ++ Or Ask Your Own Question.
It is not really possible to have two basic functions, one approach starts working with one basic skill. You canthose rename the main functions and therefore create a main function that calls both children.
code file a.c#include #include void a_main () int a = 9; if (a == 7) put ("Usually this is number seven"); another put ("This is no longer a number"); getch ();
#include #include basic void () hand (); b_main ();void b_main () integer x = 10; printf ("% d", x); getch ();
Note that it is a good thing to name functions carefully so that the names can describe what they do. For example, in this example, you can contact a_main PrintIs7OrNot and b_main Print10.
answered Oct 20, 2014 at 9:00 am.
Approved: Fortect
Fortect is the world's most popular and effective PC repair tool. It is trusted by millions of people to keep their systems running fast, smooth, and error-free. With its simple user interface and powerful scanning engine, Fortect quickly finds and fixes a broad range of Windows problems - from system instability and security issues to memory management and performance bottlenecks.
53.9k
Speed up your computer's performance now with this simple download.