模块c0.ASM未定义的符号_main [英] undefined symbol _main in module c0.ASM

查看:614
本文介绍了模块c0.ASM未定义的符号_main的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此方案正在编译成功,但以下链接错误,并提供:

This program is being compiled successfully but giving following linking error :

未定义的符号模块c0.ASM _main

undefined symbol _main in module c0.ASM

我的程序如下:

#include<stdio.h>
#include<conio.h>

int main()
{
char input[] = "hello sumit kumar";
char *a;
a = input;
printf("%s", a);
getch();
return 0;
}

`

推荐答案

假设你在Linux上:下面的程序将工作

Assuming you are on linux: The following program would work.

#include<stdio.h>

int main()
{
    char input[] = "hello sumit kumar"; //Removed stray marks at the beginning
    char *a;
    a = input;
    printf("%s", a);
    getchar();   //To use getch() have to include <curses.h> file
    return 0; //Removed stray marks at the end
}

这篇关于模块c0.ASM未定义的符号_main的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆