Thread: Microsoft Visual C++ 6.0 Help

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    53

    Microsoft Visual C++ 6.0 Help

    Hello everyone,

    I've been visiting this thread for a couple weeks now, and I love how this community acts with one another. I have a bit of a problem. I'm pretty much new to C. I'm around 90 pages into my C programming book. I've been using the IDE Microsoft Visual C++ 6.0 Professional. When I start a new project and make a new file everything works great. When I make a new c file where they would now be more than one it will give me an error when i build it saying

    hello.obj error LNK2005: _main already defined in precedence.obj.
    Error executing link.exe

    Now I assume it is because both of these c programs have a main function which is why it won't build. I know my friend said he can do multiple c programs in one project. How do you accomplish that?

    I'm on AIM as Krimit Got High if you know the answer or I'll check on here. Thanks everyone.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You need to stop adding a new C file to the same project, and either:
    a) Make a new project.
    b) Reuse the file, replacing the original code.

    If you want to have your old code as an example to look back on, it's recommended you just make a new project.

    If I've misunderstood the question, explain exactly what you're doing in finer detail.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    53

    Reply

    Yes, you understood correctly from what I saw because your directions is exactly what I've been doing. I just didn't know if there was an easier way than having to make a bunch of different projects or reusing the same code over and over and naming it as something different.

    Thanks for your help.

    Hern
    A+/Network+/MCP/MCSA Certified

    C+? C? C-?

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Be aware, though, that VC++ is, as the name implies, a C++ compiler. It will compile pre-C99 code, but it is NOT C99 compliant, so if you plan to use the current ANSI-C, you may want a true C compiler.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM