Thread: whoa....

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    14

    whoa....

    after i made those changes... i compiled it again, and i got this errors... any ideas? i'm attatching the program


    Compiling...
    program5.c
    Linking...
    program5.obj : error LNK2005: _main already defined in program 5.obj
    Debug/program 5.exe : fatal error LNK1169: one or more multiply defined symbols found
    Error executing link.exe.

    program 5.exe - 2 error(s), 0 warning(s)
    Peace

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Nothing wrong here. How are you compiling? (What compiler/OS)?

    Dave

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    14
    i'm using microsoft visual studio C++, on Windows XP
    Peace

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    14

    attatched, new file

    i dunno i re typed everything... recompiled it, and now it's giving me this error message...
    Compiling...
    Program51.cpp
    c:\documents and settings\owner\my documents\cs 223\cs223\program51\program51.cpp(87) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    Error executing cl.exe.

    Program51.exe - 1 error(s), 0 warning(s)


    okay... that's weird. did it run on your computer Dave?
    Peace

  5. #5
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    I use command line compilers for simple programs like this:

    Microsoft Visual C++, Borland bcc, GNU gcc/g++

    In the IDE of Visual C++, did you try "rebuild all"?

    Dave

  6. #6
    Registered User
    Join Date
    Mar 2004
    Posts
    14

    Angry ?

    yup i tried rebuild all... it didn't help at all... i'm stomped...
    Peace

  7. #7
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Well, when in doubt: create a new workspace and new project with your most recent file.

    (I don't use the IDE often enough to know what else to do.)

    I created a Microsoft Visual C++ (Version 6.0) Console project with your latest file; compiles OK and gives results same as my command-line compiles.

    Dave

  8. #8
    Registered User
    Join Date
    Mar 2004
    Posts
    14

    Thanx

    okay i finally got it, after i took a break. i started a new project, and pretty much copied and pasted the code.... it worked... weird. the outcome is still wrong tho. maybe the equation is messed up...
    Peace

  9. #9
    Registered User
    Join Date
    Mar 2004
    Posts
    536

    Re: Thanx

    Originally posted by camagitoe
    the outcome is still wrong tho. maybe the equation is messed up...
    Well, at least you have something to look at. If you think the equations might be wrong, temporarily put a printf() just before the calculation, and show the values of the terms used, so that you know the program is seeing the data that you intend to use.

    Dave

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Whoa... tough one here.
    By nickodonnell in forum Game Programming
    Replies: 10
    Last Post: 10-08-2005, 12:40 PM
  2. clock_t problems
    By drdodirty2002 in forum C++ Programming
    Replies: 5
    Last Post: 09-25-2005, 12:01 PM
  3. Whoa!
    By gcn_zelda in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 09-07-2003, 06:55 PM
  4. Direct x, open gl, but wait....what if...whoa, read this!
    By Leeman_s in forum Game Programming
    Replies: 2
    Last Post: 10-08-2001, 03:37 PM