Thread: little problem

Results 1 to 10 of 10
  1. #1
    Wilds's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    522
    Reputation
    1
    Thanks
    170
    My Mood
    Relaxed

    little problem

    trying to get 2 functions in 2 .cpp's

    have the function in ADE32.cpp, but i also need it to be in the main .cpp

    tried putting it in a .h and including it in both, or defining it in both .cpp's, but it says already defined in the .obj files

    little weird, never ran into this

    need to solve this in order to actually test out my no fall damage so i can put the finishing touches on it and put it on beta.

  2. #2
    mmbob's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    ja
    Posts
    653
    Reputation
    70
    Thanks
    1,157
    My Mood
    Bitchy
    You can't compile an application that has two functions with the same name and arguments. The linker wouldn't be able to tell which is which. You put the function in only one cpp file and use and h file to let your other cpp files know what the function is.

  3. #3
    Wilds's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    522
    Reputation
    1
    Thanks
    170
    My Mood
    Relaxed
    Right, thanks
    /dumbazz

  4. #4
    Fabolous's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    192.168.1.01
    Posts
    2,704
    Reputation
    261
    Thanks
    682
    My Mood
    Paranoid
    Use extern
    @wolffang0000
    Last edited by Fabolous; 04-25-2011 at 03:41 PM.

  5. #5
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh
    C++ doesn't allow for overloading of functions and procedures? Delphi does :P

  6. #6
    nucks's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    191
    Reputation
    6
    Thanks
    85
    My Mood
    Amazed
    i thought you had a VIP you should know this then if your a real coder

  7. The Following User Says Thank You to nucks For This Useful Post:

    Stephen (04-26-2011)

  8. #7
    Wilds's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    522
    Reputation
    1
    Thanks
    170
    My Mood
    Relaxed
    Quote Originally Posted by nucks View Post
    i thought you had a VIP you should know this then if your a real coder
    u obviously didnt read my post

  9. #8
    PashaAmd's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    1,008
    Reputation
    58
    Thanks
    224
    just make a .h and put everything into it and name it functions.h and include it in every file

  10. #9
    Mynameisname's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    44
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by wolffang0000 View Post
    (signature quote) Languages-
    C++ (Extremely experienced)

  11. #10
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,409
    My Mood
    In Love
    It's been solved. Don't post anything else
    No I do not make game hacks anymore, please stop asking.