首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >诅咒开发工具包- DSO从命令行丢失

问诅咒开发工具包- DSO从命令行丢失
EN

Stack Overflow用户
提问于 2014-10-13 20:56:15
回答 2查看 852关注 0票数 2

我试图在Ubuntu14.04上编译以下代码,但是收到了一个错误。谁能给我指明正确的方向?我试过没有效果的-lpthread。

编译:

代码语言:javascript
复制
gcc main.c -o terminal-app -lcdk -lpthread

main.c (为更正从这里粘贴的副本)

代码语言:javascript
复制
#include <cdk/cdk.h>

void main()
{
  CDKSCREEN   *cdkscreen;
  CDKLABEL    *demo;
  WINDOW      *screen;
  char        *mesg[4];

  /* Initialize the Cdk screen.   */
  screen = initscr();
  cdkscreen = initCDKScreen (screen);

  /* Start CDK Colors */
  initCDKColor();

  /* Set the labels up.      */
  mesg[0] = "</31>This line should have a yellow foreground and a cyan background.<!31>";
  mesg[1] = "</05>This line should have a white  foreground and a blue background.<!05>";
  mesg[2] = "</26>This line should have a yellow foreground and a red  background.<!26>";
  mesg[3] = "<C>This line should be set to whatever the screen default is.";

  /* Declare the labels.     */
  demo   = newCDKLabel (cdkscreen, CENTER, CENTER, mesg, 4, TRUE, TRUE);

  /* Draw the label          */
  drawCDKLabel (demo, TRUE);
  waitCDKLabel (demo, ' ');

  /* Clean up           */
  destroyCDKLabel (demo);
  destroyCDKScreen (cdkscreen);
  endCDK();
  exit (0);
}

错误:

代码语言:javascript
复制
/usr/bin/ld: /tmp/ccUtj1kg.o: undefined reference to symbol 'initscr'
//lib/x86_64-linux-gnu/libncurses.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-10-14 06:38:58

显然,cdk要求在命令行中直接提供ncurse。在我的机器上你的测试通过了:

代码语言:javascript
复制
gcc test.c -lcdk -lncurses
票数 4
EN

Stack Overflow用户

发布于 2015-02-28 18:07:50

我使用makefile来编译Linux中的CDK (Debian稳定的)

834v5010生成器/makefile

我需要两个零件:

  1. 在哪里找到头文件

:= -Wall -g -I /usr/include/cdk

  1. 链接CDK库

LDLIBS := -lcdk

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26348743

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档