6

我正在学习 C++,并且一直在 thenewboston.org 上观看教程。我正在尝试将类放在不同的文件中。在 Codeblocks 中编译时,我收到消息“未定义对 WinMain@16 的引用”。这是我的代码:

墨西哥卷饼.cpp

  #include "Burrito.h"
  #include <iostream>

   using namespace std;

    Burrito::Burrito()
   {
    cout << "Im a burrito!"<< endl;
    }

墨西哥卷饼.h

        #ifndef BURRITO_H
        #define BURRITO_H


        class Burrito
        {
        public:
        Burrito();

         };

         #endif // BURRITO_H

主文件

     #include <iostream>
     #include "Burrito.h"
     using namespace std;

     int main()
     {
         Burrito Obj1;
         return 0;
      }
  • 所有文件都保存在同一目录中
  • 我正在使用 Windows 8 x64
  • 代码块最新版本
4

0 回答 0