the5thace
the5thace

Reputation: 159

How to find syntax errors using Microsoft Visual Studio 2012 in c++?

I have made sure that InteliSense is turned on and that nothing is disabled while I use the IDE. I don't see a way for me to tell where the syntax errors in my code are. When I try to build the project it just gives me that "failed" report and there are no syntax errors being reported in the error box.

http://imageshack.us/f/850/visualt.jpg/

The only errors its giving me are :

Error 2 error LNK1169: one or more multiply defined symbols found C:\Users\Artur\Documents\Visual Studio 2012\Projects\Project2\Debug\Project2.exe 1 1 Project2

Error 1 error LNK2005: _main already defined in Portfolio Program 2.obj C:\Users\Artur\Documents\Visual Studio 2012\Projects\Project2\Project2\Source.obj Project2

These don't seem to make any sense to me.

Upvotes: 0

Views: 1975

Answers (2)

V-X
V-X

Reputation: 3029

You have source.cpp in resources. This is wrong.

Upvotes: 0

Timo Geusch
Timo Geusch

Reputation: 24341

Visual Studio would normally give you syntax errors if there are any in your C++ code. The error message you're getting suggest that you're linking two modules together that both contain a definition of main(). That won't work as the linker will not be able to determine which of the two main() functions to use as an entry point into the program. So, check your linker and project dependencies.

Upvotes: 1

Related Questions