• (2 Pages)
  • +
  • 1
  • 2

Make a text combat game in C++ plays like pokémon/final fantasy where you fight a monster

#16 AbeLinclolnstein  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 21-April 12

Posted 23 April 2012 - 06:52 AM

So you can use it to define it as one thing, then define it as another inside the "#ifndef" if it hasn't been called?
Was This Post Helpful? 0
  • +
  • -

#17 rurunosep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-November 12

Posted 20 November 2012 - 03:45 PM

Sorry for bumping such an old thread, but I've been having a problem with the code that I just can't see to solve. I keep getting an error referring to an "unresolved external symbol." I've looked it up and found that the error occurs when something is declared, but not defined anywhere in the code. However, no matter what I try, I can't find the source of the problem. I can copy and paste my code if necessary, but it should be exactly the same as the code in the first post besides the "Combat(Monster& C);" and the "#include <string>" changes. I would really appreciate it if someone could help me out.
Thank you.
Was This Post Helpful? 0
  • +
  • -

#18 Hezekiah  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 207
  • View blog
  • Posts: 552
  • Joined: 12-July 09

Posted 21 November 2012 - 01:01 AM

Please post the complete error message. It includes important information, like the name of the unresolved symbol.

Also, have you tried the code I uploaded in one of the previous posts? I can't remember exactly what I fixed, but I might have fixed your error as well.
Was This Post Helpful? 0
  • +
  • -

#19 rurunosep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-November 12

Posted 21 November 2012 - 02:58 PM

I use a Japanese copy of Visual Studio Express 2012, but I can roughly translate the error message. It says "Unresolved external symbol _WinMain@16 was referenced in the function __tmainCRTStartup." It also refers to a file MSVCRTD.lib(crtexew.obj) somewhere in the project folder. I never added this, so it must have been included by default.
I tried making a new, empty Win32 Project and importing the files the you uploaded and I ended up getting the same exact error. This makes me think that it's not an error in the code but probably in the way that I'm setting up or running the program. All I did in following the tutorial was create an empty Win32 project and type in all the code that was posted into the respective files.
I'm pretty new to C++, so maybe I'm missing some general step that was too obvious to mention in the tutorial? Because if your code works for you and not for me, then the problem probably isn't in the code itself.
Was This Post Helpful? 0
  • +
  • -

#20 Hezekiah  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 207
  • View blog
  • Posts: 552
  • Joined: 12-July 09

Posted 22 November 2012 - 06:27 AM

The project type is incorrect. It shouldn't be a Win32 project, it should be a console application.
Was This Post Helpful? 1
  • +
  • -

#21 rurunosep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-November 12

Posted 25 November 2012 - 03:50 PM

I made a new console application project, imported all the files, and ran the program and it worked fine. Thanks a lot for the help.
Was This Post Helpful? 0
  • +
  • -

#22 ekta pasricha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-January 13

Posted 17 February 2013 - 05:54 AM

Hey This is Ekta Pasricha... A totally new n fresh aspirant to learn the coding of games... U see girls are least interested in the games as well as their so damn Fucking coding... But truly speaking I have that interest n m so damn interested... Plzz help me out...
Was This Post Helpful? 0
  • +
  • -

#23 s3lfik  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-April 13

Posted 22 April 2013 - 08:15 AM

Nice motivating tutorial :clap: maybe it's even cool having some misstakes in code to make others think of the solutions :sigh:

Terry Goodkind - "Think of the solution, not the problem"
Was This Post Helpful? 0
  • +
  • -

#24 bhumitra  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-September 14

Posted 13 September 2014 - 06:07 PM

View PostHezekiah, on 01 January 2011 - 07:16 AM, said:

I thought it might be helpful to upload the bug-free source while crazyjugglerdrummer can't edit his tutorial.



can you please upload the file again.. or mail it to <Removed>

This post has been edited by macosxnerd101: 14 September 2014 - 08:47 AM
Reason for edit:: Removed email per site policy

Was This Post Helpful? 0
  • +
  • -

#25 Hezekiah  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 207
  • View blog
  • Posts: 552
  • Joined: 12-July 09

Posted 14 September 2014 - 01:52 AM

I don't have the file any more. From my quick look at the code you should make the following changes: add the line #include <string> after #include <iostream> in Monster.h and Character.h and change Combat(Character& C); to Combat(Monster& M); in Combat.h. There might be more errors, but just post them here and I'll tell you what to do.

This post has been edited by Hezekiah: 14 September 2014 - 01:55 AM

Was This Post Helpful? 0
  • +
  • -

#26 bhumitra  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-September 14

Posted 14 September 2014 - 07:43 AM

View PostHezekiah, on 14 September 2014 - 01:52 AM, said:

I don't have the file any more. From my quick look at the code you should make the following changes: add the line #include <string> after #include <iostream> in Monster.h and Character.h and change Combat(Character& C); to Combat(Monster& M); in Combat.h. There might be more errors, but just post them here and I'll tell you what to do.


for some reason i am not able to include the header files...

i am getting this error in visual studio...

Error 1 error C1083: Cannot open include file: 'Monster.h': No such file or directory c:\users\bhumitra\documents\visual studio 2013\projects\consoleapplication2\monster.cpp 1 1 ConsoleApplication2
Error 2 error C2006: '#include' : expected a filename, found 'identifier' c:\users\bhumitra\documents\visual studio 2013\projects\consoleapplication2\monster.h 4 1 ConsoleApplication2
Error 3 error C1083: Cannot open include file: '': No such file or directory c:\users\bhumitra\documents\visual studio 2013\projects\consoleapplication2\monster.h 4 1 ConsoleApplication2
Error 4 error C2006: '#include' : expected a filename, found 'identifier' c:\users\bhumitra\documents\visual studio 2013\projects\consoleapplication2\monster.h 4 1 ConsoleApplication2

what shall i do now?
Was This Post Helpful? 0
  • +
  • -

#27 Hezekiah  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 207
  • View blog
  • Posts: 552
  • Joined: 12-July 09

Posted 14 September 2014 - 10:14 AM

Are all the files in the same folder? Since the errors seem to originate from monster.cpp and monster.h, maybe you should post the contents of those files.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2