Question:
visual c++ 2010 problem?
2011-10-12 01:15:14 UTC
I am using Visual C++ 2010.express edition

I recently created a win32 console app project...as an empty project

I have two .c programs in the source file.

one of the program is (hello world) and the other is an (even number check) program.

the files are hw.c and evenno.c

When i try to debug any of the two programs....I get an error

1>------ Build started: Project: c projects, Configuration: Debug Win32 ------
1>numprint.obj : error LNK2005: _main already defined in hw.obj
1>C:\Users\Pramit Kumar Pal\documents\visual studio 2010\Projects\c projects\Debug\c projects.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

after the error i get the following line as given below
Unable to start program----C:\Users\Pramit Kumar Pal\documents\visual studio 2010\Projects\c projects\Debug\c projects.exe

The system cannot find the file specified.


What to do??...
Help please
Three answers:
Nick T
2011-10-15 12:08:47 UTC
I am guessing that each of your files has its own main function (probably because they have been written as stand alone systems). You cannot have two copies of main in a program.
hanlin
2016-10-02 18:30:34 UTC
you probably did no longer specify what you have been doing once you acquire that blunders. you in addition to would did no longer specify what kind of challenge that's. For a beginner, the only thank you to write down a application is to start with the aid of coming up a challenge. A challenge is what tells seen Studio (VS) what it needs to understand to do each thing for you that it does right away. you may starte with a console application. Use "report | New | challenge..." and then contained in the verbal exchange boxes contained in the tree view on the left enhance the seen C++ node. Then click on Win32. click on Win32 Console utility. Take the defaults. once you have complete coming up the challenge, use the menus to do "build | build answer". After the challenge is outfitted you need to use "Debug | initiate without Debugging". in case you are trying this then you definately've created and examined an elementary beginner application. you will get a e book that might actually assist you with the 1000's of extra questions you've got.
Uchiha
2011-10-12 01:26:35 UTC
I would check for typos in your code. I would also make a directory like this - "c:\code" in order to make your coding life easier. I am not so sure why you would want to compile those two together? (?^-^)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...