我是 运行 一个程序并遇到了这个错误。这是什么意思?

I was running a a program and came by this error. what does it mean?

#if __APPLE_CC__
#include <GLUT/glut.h>
#else
#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include "glut.h"
#endif



#include <math.h>
#include <stdio.h>
#include "scene.h"
#include <string.h>




extern float g_t;




//function prototypes for the local functions
void drawCone(float x, float y, float z, float radius, float height, int nSides, float startColor[3], float endColor[3]);

void drawBox(float left, float bottom, float front,
    float length, float height, float depth);

/*
   this function is called whenever OpenGL needs to redraw
   the screen
   
*/
void drawScene(void)
{
  float startColor[3] = { 0.5, 0.0, 0.0}, endColor[3] = {1.0, 1.0, 0.0};
//    drawCone(0,-1,0, 0.5, 1.0, 20, startColor, endColor);
 //   drawCone(0,1,0, 0.5, -1.0, 20, startColor, endColor);

//    glEnable(GL_CULL_FACE);
//    glCullFace(GL_BACK);
    
    
    //tabletop
    drawBox(-1, 1, 0.5, 2.0, 0.1, 1);
    
    //left, front leg
    drawBox(-1, 0, 0.5, .1, 1, .1);
    
    glColor3f(0,0,0);
    glutWireTorus(0.1, .25, 12, 16);
    
    glTranslatef(0.0, 1.25, 0.0);
    glutWireTeapot(0.2);
    glTranslatef(0.0, -1.25, 0.0);


}//drawScene

void drawCone(float x, float y, float z, float radius, float height, int nSides, float startColor[3], float endColor[3])
{
    int i, j, next;
    float angle;
    
    float circlePoints[100][3];
    float colors[100][3];
    
    //first calculate the points on a circle and the color for each point
    
    for(i = 0; i < nSides; ++i)
    {
       angle = 2* M_PI/nSides * i;
       circlePoints[i][0] = radius * sin(angle) + x;
       circlePoints[i][1] = y;
       circlePoints[i][2] = radius * cos(angle) + z;
       
       colors[i][0] = (endColor[0]- startColor[0])/ nSides * i + startColor[0];
       colors[i][1] = (endColor[1]- startColor[1])/ nSides * i + startColor[1];
       colors[i][2] = (endColor[2]- startColor[2])/ nSides * i + startColor[2];
    }
     //draw the cone
    glBegin(GL_TRIANGLES);
    for(i = 0; i < nSides; ++i)
    {
        next = (i + 1) % nSides;
        glColor3f(colors[i][0], colors[i][1], colors[i][2]);
        glVertex3f(circlePoints[next][0], circlePoints[next][1], circlePoints[next][2]);
        glVertex3f(x, y + height, z);
        
        glVertex3f(circlePoints[i][0], circlePoints[i][1], circlePoints[i][2]);
       // glVertex3f(x, y + height, z);
    }
    glEnd();
    
    //draw the circle
    glBegin(GL_POLYGON);
    for(i = 0; i < nSides; ++i)
    {
        glColor3f(startColor[0], startColor[1], startColor[2]);
        glVertex3f(circlePoints[i][0], circlePoints[i][1], circlePoints[i][2]);
    }
     glVertex3f(circlePoints[0][0], circlePoints[0][1], circlePoints[0][2]);
    glEnd();
}

/*
            x,X left
            y,Y bottom
            z Z front
            l L length
            h H height
            d D depth
*/
               
void handleKey(char key)
{
    printf("key = %c\n", key);

}

void drawBox(float left, float bottom, float front,
    float length, float height, float depth)
    {
    float right = left + length;
    float top = bottom + height;
    float back = front - depth;
    //draw the front
    glBegin(GL_QUADS);
    
    //front
    glColor3f(1.0, 0.0, 0.0);
    glVertex3f(left, bottom, front);
    glVertex3f(right, bottom, front);
    glVertex3f(right, top, front);
    glVertex3f(left, top, front);
    
    //left
    glColor3f(0.0, 1.0, 0.0);
    glVertex3f(left, bottom, front);
    glVertex3f(left, top, front);
    glVertex3f(left, top, back);
    glVertex3f(left, bottom, back);
    
    //back
    glColor3f(0.0, 0.0, 1.0);
    glVertex3f(left, bottom, back);
    glVertex3f(left, top, back);
    glVertex3f(right, top, back);
    glVertex3f(right, bottom, back);
    
    //top
    glColor3f(0.0, 1.0, 1.0);
    glVertex3f(left, top, front);
    glVertex3f(right, top, front);
    glVertex3f(right, top, back);
    glVertex3f(left, top, back);

    //bottom
    glColor3f(1.0, 0.0, 1.0);
    glVertex3f(left, bottom, front);
    glVertex3f(right, bottom, front);
    glVertex3f(right, bottom, back);
    glVertex3f(left, bottom, back);
    
    glEnd();
}










 


未定义的体系结构符号x86_64: “_main”,引用自: 主可执行文件的隐式 entry/start ld:未找到体系结构的符号 x86_64 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

这是我遇到的错误,但我无法弄清楚

我复制粘贴了这个因为我需要在正文中添加更多单词

Ld /Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Products/Debug/scene 正常(在项目 'scene' 的目标 'scene' 中) CD /Users/dahirali/Desktop/1101/scene /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-macos10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10. 15.sdk -L/Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Products/Debug -F/Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Products/Debug -filelist /Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Intermediates.noindex/scene.build/Debug/scene.build/Objects-normal/x86_64/scene.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Intermediates.noindex/scene.build/Debug/scene.build/Objects-normal/x86_64/scene_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -dependency_info -Xlinker /Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Intermediates.noindex/scene.build/Debug/scene.build/Objects-normal/x86_64/scene_dependency_info.dat -o /Users/dahirali/Library/Developer/Xcode/DerivedData/scene-ccsieluddlpredauupsijrhisooo/Build/Products/Debug/scene

这意味着您试图将 C 源文件编译为可执行文件,但是没有 main function。当可执行文件为 运行.

时,操作系统会调用 main