【问题标题】:Cross compiling pdcurses from arch linux to windows从arch linux交叉编译pdcurses到windows
【发布时间】:2014-01-28 13:38:26
【问题描述】:

我正在尝试交叉编译一个简单的“Hello World!”程序,从arch linux到windows

代码如下:

#include <stdio.h>
#include <curses.h>

int main() {
    initscr();

    printw("Hello World!");
    refresh();
    getch();

    endwin();
    return 0;
}

然后我使用mingw编译:

x86_64-w64-mingw32-gcc hello.c -o hello-x64.exe -lpdcurses.dll

当我运行程序时,它崩溃了。这是trace

【问题讨论】:

    标签: c console-application cross-compiling pdcurses


    【解决方案1】:

    确保包含 PDCurses 包中的 curses.h,而不是系统 curses.h(即 ncurses)。

    另外,虽然它可能与问题无关,但这里不需要 stdio.h。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-27
      • 1970-01-01
      • 2017-02-03
      • 2014-01-16
      • 2018-01-14
      • 2021-11-20
      • 2017-06-22
      相关资源
      最近更新 更多