【问题标题】:Undeclared identifier compiling diablo 2 program "muleview" [closed]编译暗黑破坏神 2 程序“muleview”的未声明标识符 [关闭]
【发布时间】:2020-10-27 04:16:21
【问题描述】:

我在编译 (Visual Studio 2013) 时遇到 4 个未声明的标识符错误,无法弄清楚在哪里以及如何声明它们。

error C2065: 'IDR_MAINWND' : undeclared identifier 
error C2065: 'ID_FILE_EXIT' : undeclared identifier 
error C2065: 'ID_TOOLS_OPTIONS' : undeclared identifier 
error C2065: 'ID_HELP_ABOUT' : undeclared identifier

源文件:https://code.google.com/archive/p/mule-view/source/default/source

来源github:https://github.com/kamikazzi1/mule-view/tree/master/

Mainwnd.cpp sn-ps:

wcx->lpszMenuName = MAKEINTRESOURCE(IDR_MAINWND);


case WM_COMMAND:
    {
      int id = LOWORD(wParam);
      int code = HIWORD(wParam);
      switch (id)
      {
      case IDC_ITEMFILTER:
        if (code == EN_CHANGE)
          itemList->updateSelected();
        break;
      case ID_FILE_EXIT:
        PostMessage(hWnd, WM_CLOSE, 0, 0);
        break;
      case ID_TOOLS_OPTIONS:
        {
          SettingsWnd settings(this);
          settings.doModal();
        }
        break;
      case ID_HELP_ABOUT:
        {
          AboutDlg about(this);
          about.doModal();
        }
        break;
      }
    }
    break;

【问题讨论】:

  • 现在在这里中断:if (*str == 0) return start;

标签: c++ winapi undeclared-identifier


【解决方案1】:

我发现res文件夹里还有一个resource.h,所以请修改mainwnd.cpp: #include "resource.h" -> #include "../res/resource.h"

【讨论】:

  • 如果发生无法打开包含文件:'afxres.h',请使用 windows.h 替换 afxres.h
  • 如果这解决了您的问题,请点赞帖子...
猜你喜欢
  • 2012-08-08
  • 2014-08-17
  • 2012-07-12
  • 1970-01-01
  • 2011-12-14
  • 2021-12-17
  • 1970-01-01
  • 2012-09-04
  • 1970-01-01
相关资源
最近更新 更多