<bdo id='TvVIR'></bdo><ul id='TvVIR'></ul>
  • <tfoot id='TvVIR'></tfoot>

  • <small id='TvVIR'></small><noframes id='TvVIR'>

      <i id='TvVIR'><tr id='TvVIR'><dt id='TvVIR'><q id='TvVIR'><span id='TvVIR'><b id='TvVIR'><form id='TvVIR'><ins id='TvVIR'></ins><ul id='TvVIR'></ul><sub id='TvVIR'></sub></form><legend id='TvVIR'></legend><bdo id='TvVIR'><pre id='TvVIR'><center id='TvVIR'></center></pre></bdo></b><th id='TvVIR'></th></span></q></dt></tr></i><div id='TvVIR'><tfoot id='TvVIR'></tfoot><dl id='TvVIR'><fieldset id='TvVIR'></fieldset></dl></div>
      <legend id='TvVIR'><style id='TvVIR'><dir id='TvVIR'><q id='TvVIR'></q></dir></style></legend>

        链接:致命错误 LNK1561:必须在 VC++ 中定义入口点错误

        时间:2023-07-01
          <bdo id='FiJMu'></bdo><ul id='FiJMu'></ul>
              <tbody id='FiJMu'></tbody>

              <i id='FiJMu'><tr id='FiJMu'><dt id='FiJMu'><q id='FiJMu'><span id='FiJMu'><b id='FiJMu'><form id='FiJMu'><ins id='FiJMu'></ins><ul id='FiJMu'></ul><sub id='FiJMu'></sub></form><legend id='FiJMu'></legend><bdo id='FiJMu'><pre id='FiJMu'><center id='FiJMu'></center></pre></bdo></b><th id='FiJMu'></th></span></q></dt></tr></i><div id='FiJMu'><tfoot id='FiJMu'></tfoot><dl id='FiJMu'><fieldset id='FiJMu'></fieldset></dl></div>

              <legend id='FiJMu'><style id='FiJMu'><dir id='FiJMu'><q id='FiJMu'></q></dir></style></legend>
                  <tfoot id='FiJMu'></tfoot>

                  <small id='FiJMu'></small><noframes id='FiJMu'>

                1. 本文介绍了链接:致命错误 LNK1561:必须在 VC++ 中定义入口点错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我第一次安装了 MS VS VC++,以便开始使用 GLFW 库对 OpenGL 进行编程.我在 http://shawndeprey.blogspot.com/2012/02/setting-up-glfw-in-visual-studio-2010.html然后我写了这个简单的程序,只是为了测试它,它确实在 Eclipse 上工作:

                  I installed MS VS VC++ for the first time in order to start programming OpenGL with GLFW library. I follower instructions on how to install it over at http://shawndeprey.blogspot.com/2012/02/setting-up-glfw-in-visual-studio-2010.html Then I wrote this simple program, just to test it, which did work on Eclipse:

                  #include <stdlib.h>
                  #include <GL/glfw.h>
                  
                  using namespace std;
                  
                  int main()
                  {
                      int running = GL_TRUE;
                      if (!glfwInit()) {
                          exit(EXIT_FAILURE);
                      }
                  
                      if (!glfwOpenWindow(300, 300, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)) {
                          glfwTerminate();
                          exit(EXIT_FAILURE);
                      }
                  
                      while (running) {
                          // glClear( GL_COLOR_BUFFER_BIT );
                          glfwSwapBuffers();
                          running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam(GLFW_OPENED);
                      }
                  
                      glfwTerminate();
                      exit(EXIT_SUCCESS);
                      return 0;
                  }
                  

                  但后来我得到了这个可怕的错误:

                  But then I got this awful error:

                  ------ Build started: Project: first1, Configuration: Debug Win32 ------
                     LINK : fatal error LNK1561: entry point must be defined
                  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
                  

                  我知道,我在互联网上环顾四周,我找到的唯一解决方案是它需要 main() 函数才能工作".我显然有它,就在那里,但它仍然给我抛出同样的致命错误:(

                  I know, I've looked around on the internet and the only solution I found was "It requires main() function in order to work". I obviously have it, right there, but it still throws me the same fatal error :(

                  如果能得到关于如何修复它的回应会很棒.可能是我安装过程中的缺陷什么的.

                  Would be great to get response on how to fix it. There might me a flaw in the installation process or something.

                  推荐答案

                  这是控制台程序项目还是 Windows 项目?我问是因为对于 Win32 和类似项目,入口点是 WinMain().

                  Is this a console program project or a Windows project? I'm asking because for a Win32 and similar project, the entry point is WinMain().

                  1. 右键单击左侧的项目(而不是解决方案).
                  2. 然后点击属性 -> 配置属性 -> 链接器 -> 系统

                  如果它说 Subsystem Windows 你的入口点应该是 WinMain(),即

                  If it says Subsystem Windows your entry point should be WinMain(), i.e.

                  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
                  {
                     your code here ...
                  }
                  

                  另外,说到评论.这是编译(或更准确地说是链接)错误,而不是运行时错误.当你开始调试时,编译器需要制作一个完整的程序(不仅仅是编译你的模块),这就是错误发生的时候.

                  Besides, speaking of the comments. This is a compile (or more precisely a Link) error, not a run-time error. When you start to debug, the compiler needs to make a complete program (not just to compile your module) and that is when the error occurs.

                  它甚至还没有到被加载和运行的地步.

                  It does not even get to the point being loaded and run.

                  这篇关于链接:致命错误 LNK1561:必须在 VC++ 中定义入口点错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用/不使用 Visual Leak Detector 在 C++ 中检测内存泄漏 下一篇:使用 C++ 读取文本文件的最优雅方式是什么?

                  相关文章

                    <bdo id='l9Tll'></bdo><ul id='l9Tll'></ul>
                2. <i id='l9Tll'><tr id='l9Tll'><dt id='l9Tll'><q id='l9Tll'><span id='l9Tll'><b id='l9Tll'><form id='l9Tll'><ins id='l9Tll'></ins><ul id='l9Tll'></ul><sub id='l9Tll'></sub></form><legend id='l9Tll'></legend><bdo id='l9Tll'><pre id='l9Tll'><center id='l9Tll'></center></pre></bdo></b><th id='l9Tll'></th></span></q></dt></tr></i><div id='l9Tll'><tfoot id='l9Tll'></tfoot><dl id='l9Tll'><fieldset id='l9Tll'></fieldset></dl></div>

                3. <legend id='l9Tll'><style id='l9Tll'><dir id='l9Tll'><q id='l9Tll'></q></dir></style></legend>

                  <small id='l9Tll'></small><noframes id='l9Tll'>

                      <tfoot id='l9Tll'></tfoot>