Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: identifier not found errors in shop.cpp  (Read 3296 times)

RenoFox

  • Bay Watcher
    • View Profile
identifier not found errors in shop.cpp
« on: November 06, 2012, 11:15:30 am »

When trying to compile the game in Visual C++,  I get the following errors:

Spoiler (click to show/hide)

How can I fix them?

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #1 on: November 06, 2012, 06:46:00 pm »

I can't make sense of that part of the code. I've never used any of that stuff before. But, apparently, not1 and mem_fun are part of <functional> which isn't included anywhere in the project. But it compiles fine for everyone else...  weird.

What version of Visual C++ are you using? It works fine with my Visual C++ 2010 Express
Logged

RenoFox

  • Bay Watcher
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #2 on: November 07, 2012, 03:45:50 pm »

I have Visual Studio 2012 Express, the one linked in the sticky thread.

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: identifier not found errors in shop.cpp
« Reply #3 on: November 07, 2012, 09:23:39 pm »

I can't make sense of that part of the code. I've never used any of that stuff before. But, apparently, not1 and mem_fun are part of <functional> which isn't included anywhere in the project. But it compiles fine for everyone else...  weird.

What version of Visual C++ are you using? It works fine with my Visual C++ 2010 Express

<functional> is a part of the Standard Template Library that deals with function objects, and is probably included by other headers we're including directly. Why this didn't work here, I'm not sure.

RenoFox, try going to the top of shop.cpp and adding the line:

Code: [Select]
#include <functional>
It can be above or below the include line for externs, shouldn't matter any.

If it doesn't work, let me know. There are multiple ways to tackle this problem, this is just the simplest.
Logged

RenoFox

  • Bay Watcher
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #4 on: November 08, 2012, 07:53:29 am »

RenoFox, try going to the top of shop.cpp and adding the line:

Code: [Select]
#include <functional>
It can be above or below the include line for externs, shouldn't matter any.

If it doesn't work, let me know. There are multiple ways to tackle this problem, this is just the simplest.

That fixed the problem with shop.cpp. Next one was about output file game.exe vs crimesquad.exe, but I (presumably) fixed it by changing the Target Name in project settings to crimesquad. That still left the following errors:

Spoiler (click to show/hide)

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #5 on: November 08, 2012, 08:39:49 am »

Hmm, it looks like src/log/log.cpp isn't being compiled. Can you tell if this is the case?
Logged

RenoFox

  • Bay Watcher
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #6 on: November 08, 2012, 10:25:09 am »

Log.cpp and log.h were not in the project explorer, so I added them.

Now when I try to debug run the game, I get a system error popup saying "The program can't start because pdcurses.dll is missing from your computer. Try reinstalling the program to fix this problem." The debug output gives the following errors:

Spoiler (click to show/hide)

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #7 on: November 08, 2012, 11:42:44 am »

Copy pdcurses.dll from workspaces to workspaces\Debug, the same place as crimesquad.exe. Also, you may need to copy the art folder into there as well. And maybe CrimeSquadManual.txt. These should be the last of your errors.
Logged

RenoFox

  • Bay Watcher
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #9 on: November 10, 2012, 12:13:23 pm »

I went along modifying creature names and texts, occassionally stopping to see if the game still compiled successfully. At one point, the game started skipping straight from character creation to skipping time, so I restored the creature.cpp and creature.h files back to an earlier version. Now the game doesn't start at all, instead breaking with:

Code: [Select]
Unhandled exception at at 0x7555B9BC in crimesquad.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00E8F02C.
What should I do?

Jonathan S. Fox

  • Bay Watcher
    • View Profile
    • http://www.jonathansfox.com/
Re: identifier not found errors in shop.cpp
« Reply #10 on: November 10, 2012, 04:22:31 pm »

It may be an issue of the current save file being incompatible -- make sure you delete the save file you've been testing with and try again?
Logged

RenoFox

  • Bay Watcher
    • View Profile
Re: identifier not found errors in shop.cpp
« Reply #11 on: November 11, 2012, 03:54:31 am »

It may be an issue of the current save file being incompatible -- make sure you delete the save file you've been testing with and try again?

Thanks, that fixed the breaking error. However, now the missing PDB-file errors are back, despite pdcurses.dll and art folder still being in the debug folder.