对“main”的未定义引用找不到条目符号\u

2024-09-30 08:17:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将python程序编译为c文件。第一个,在用几十个链接标志检查并消除了几十个错误后,最后只留下了一个错误。当我键入:

$ gcc -Os -I /usr/include/python3.6m -o example example_cy.c -lpython3.6m     -lpthread -lm -lutil -ldl

错误是:

^{pr2}$

然后我添加-nostartfiles

gcc -Os -I /usr/include/python3.6m -o example example_cy.c
-lpython3.6m -lpthread -lm -lutil -ldl -nostartfiles

错误变成:

/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to  
00000000000022f0

我得到的图像是,问题是在我的.c文件中没有main或\u start函数。在


Tags: 文件程序includeosexampleusr错误start

热门问题