Home > Back-end >  Vs2013 written in c win32 console application has been prompt LNK2005 error, do not know how to solv
Vs2013 written in c win32 console application has been prompt LNK2005 error, do not know how to solv

Time:10-01

I was programming beginners, I check it on the website of the interpretation cannot understand,,, someone posted source code look thanks

1. To C or the not To C

#include

Int main (void) {

Printf (" or not To C To C; That is a question. ");

getchar();
Return (0);
}

2. Dwight

#include

Int main (void) {
Int height, length, width, volume, weight.

Height=18;
Length=12;
Width=23;
Volume=height * length * width;
Weight=(volume + 165)/166;

Printf (" dX dX Dismensions: % % % d \ n ", length, height, width);
Printf (" Volume (Cubic inches) : % d \ n ", Volume).

getchar();
Return (0);
}

Compile error message is:
1> -- -- -- -- -- - has started to generate: project: Project1, configuration, Release the Win32 -- -- -- -- -- --
1> Dwight. CPP
1> To or not to Arthur c. pp
1> To or not to c.o bj: error LNK2005: _main already in Dwight. Obj defined in
1> D: \ Personal \ documents \ visual studio 2013 \ Projects \ Project1 \ Release \ Project1 exe: fatal error LNK1169: locate one or more of the definition of multiple symbol
==========: zero success, failure, latest 0, 0 skip==========


Thank you for your attention

CodePudding user response:

A project can have only one entrance to the main function, you put the two unit in two projects

CodePudding user response:

Such a basic error should not be made,
  • Related