简体   繁体   English

静态链接NCurses给出错误,用于BusyBox环境

[英]Statically Linking NCurses Gives Error, for use in BusyBox environment

I wrote a very simple ncurses program to be run in BusyBox environment. 我编写了一个非常简单的ncurses程序,可以在BusyBox环境中运行。 However, it seems like that I cannot get my program to compile with everything. 但是,似乎我无法使我的程序与所有内容一起编译。 I used: 我用了:

g++ menu.cpp -ohello -lncurses  --> Works fine
g++ -static menu.cpp -ohello -lncurses --> Undefined reference to SP (many times)

I found this question but it ignores linking to ncurses. 我发现了这个问题,但它忽略了与ncurses的链接。 I need a very single executable. 我需要一个非常单一的可执行文件。 My targeted environment is fixed, so I do not concern portability. 我的目标环境是固定的,因此无需担心可移植性。

  1. You should paste the exact compiler calls and the exact error messages that you are getting. 您应该粘贴确切的编译器调用和所获取的确切错误消息。

  2. Do you have a static version of the ncurses library? 您是否有ncurses库的静态版本?

  3. More importantly, do you have a static version of the ncurses library compiled for your target environment? 更重要的是,您是否为目标环境编译了ncurses库的静态版本? For example your target environment may be using ulibc instead of glibc or it could even be a whole different platform (hint: tell us what your target platform is). 例如,您的目标环境可能使用ulibc而非glibc ,甚至可能是一个完全不同的平台(提示:告诉我们您的目标平台是什么)。

  4. Are you certain that you are compiling with the right flags? 您确定使用正确的标志进行编译吗? The compiler flags that you are showing seem more suited to compiling an application for use in the build host environment... 您显示的编译器标志似乎更适合于编译要在构建主机环境中使用的应用程序...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM