<bdo id='IqRLN'></bdo><ul id='IqRLN'></ul>

      <tfoot id='IqRLN'></tfoot>
    1. <legend id='IqRLN'><style id='IqRLN'><dir id='IqRLN'><q id='IqRLN'></q></dir></style></legend>
    2. <i id='IqRLN'><tr id='IqRLN'><dt id='IqRLN'><q id='IqRLN'><span id='IqRLN'><b id='IqRLN'><form id='IqRLN'><ins id='IqRLN'></ins><ul id='IqRLN'></ul><sub id='IqRLN'></sub></form><legend id='IqRLN'></legend><bdo id='IqRLN'><pre id='IqRLN'><center id='IqRLN'></center></pre></bdo></b><th id='IqRLN'></th></span></q></dt></tr></i><div id='IqRLN'><tfoot id='IqRLN'></tfoot><dl id='IqRLN'><fieldset id='IqRLN'></fieldset></dl></div>

      <small id='IqRLN'></small><noframes id='IqRLN'>

      使用 ncurses 时对 `stdscr' 的未定义引用

      Undefined reference to `stdscr#39; while using ncurses(使用 ncurses 时对 `stdscr 的未定义引用)

      <small id='YJciy'></small><noframes id='YJciy'>

          <i id='YJciy'><tr id='YJciy'><dt id='YJciy'><q id='YJciy'><span id='YJciy'><b id='YJciy'><form id='YJciy'><ins id='YJciy'></ins><ul id='YJciy'></ul><sub id='YJciy'></sub></form><legend id='YJciy'></legend><bdo id='YJciy'><pre id='YJciy'><center id='YJciy'></center></pre></bdo></b><th id='YJciy'></th></span></q></dt></tr></i><div id='YJciy'><tfoot id='YJciy'></tfoot><dl id='YJciy'><fieldset id='YJciy'></fieldset></dl></div>
          <legend id='YJciy'><style id='YJciy'><dir id='YJciy'><q id='YJciy'></q></dir></style></legend>
            <tbody id='YJciy'></tbody>
        • <tfoot id='YJciy'></tfoot>

                <bdo id='YJciy'></bdo><ul id='YJciy'></ul>
                本文介绍了使用 ncurses 时对 `stdscr' 的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试在 Ubuntu 11.10 中编译我的代码并出现这些错误等等.到目前为止,通过谷歌搜索,我认为这是一个链接错误.具体来说,有一些建议可以确保您拥有正确的标题并链接 -lncurses 库.我已经这样做了.我仍然收到此错误.我还读到可能我应该安装 libncurses,但我已经安装了它.

                I am trying to compile my code in Ubuntu 11.10 and getting these errors and more.So far by googling it I think it is a linking error. Specifically, there have been suggestions to make sure you have the right headers and link the -lncurses library. I have already done that. I'm still getting this error. I also read that may be i should install the libncurses, but I already have it installed.

                My MakeFile:
                CPP           = g++
                CPPFLAGS      = -c -Wall -g
                LINK          = g++
                LDFLAGS_LINUX = -lpthread -lncurses
                LDFLAGS       = $(LDFLAGS_LINUX)
                RM            = rm
                
                
                .SUFFIXES:
                .SUFFIXES: .o .cpp
                
                .cpp.o:
                    $(CPP) $(CPPFLAGS) $*.cpp -o $(SRC_DIR)$*.o
                
                all: skygrid
                
                skygrid: skygrid.o commServer.o pose.o robot.o
                    $(LINK) $(LDFLAGS) -o $@ $^
                
                clean:
                    $(RM) -rf *.o skygrid
                
                skygrid.o:  skygrid.cpp definitions.h commServer.h pose.h robot.h
                commServer.o:   commServer.cpp commServer.h
                pose.o:     pose.cpp pose.h
                robot.o:    robot.cpp robot.h pose.h
                

                我的错误:

                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1094: undefined reference to `stdscr'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1094: undefined reference to `stdscr'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1094: undefined reference to `stdscr'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1094: undefined reference to `stdscr'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1104: undefined reference to `werase'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1106: undefined reference to `wprintw'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1107: undefined reference to `wprintw'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1109: undefined reference to `wprintw'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1111: undefined reference to `stdscr'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1111: undefined reference to `wgetch'
                /home/fari/Desktop/FarahSkygrid/skygrid/src/skygrid.cpp:1116: undefined reference to `wtouchln'
                

                推荐答案

                我在 Centos 6.2 上的 ncurses 程序中遇到了这个问题.事实证明,ncurses 有时被分成两个库,ncursestinfo.就我而言,stdscr 存在于 libtinfo 中,而不存在于 libncurses 中,因此将 -ltinfo 添加到链接行,在 -lncurses<之后/code>,解决问题.

                I was having this problem with an ncurses program on Centos 6.2. It turns out that ncurses is sometimes split into two libraries, ncurses and tinfo. In my case, stdscr exists in libtinfo, not in libncurses, so adding -ltinfo to the link line, after -lncurses, solved the problem.

                这篇关于使用 ncurses 时对 `stdscr' 的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Is Type(::x); valid?(是类型(::x);有效的?)
                Difference between an inline function and static inline function(内联函数和静态内联函数的区别)
                Compilation fails randomly: quot;cannot open program databasequot;(编译随机失败:“无法打开程序数据库)
                Too many initializers error for a simple array in bcc32(bcc32 中的简单数组的初始值设定项过多错误)
                No Member named stoi in namespace std(命名空间 std 中没有名为 stoi 的成员)
                Error using a constexpr as a template parameter within the same class(在同一个类中使用 constexpr 作为模板参数时出错)
                  <tbody id='NnXcT'></tbody>

                    <tfoot id='NnXcT'></tfoot>

                    1. <i id='NnXcT'><tr id='NnXcT'><dt id='NnXcT'><q id='NnXcT'><span id='NnXcT'><b id='NnXcT'><form id='NnXcT'><ins id='NnXcT'></ins><ul id='NnXcT'></ul><sub id='NnXcT'></sub></form><legend id='NnXcT'></legend><bdo id='NnXcT'><pre id='NnXcT'><center id='NnXcT'></center></pre></bdo></b><th id='NnXcT'></th></span></q></dt></tr></i><div id='NnXcT'><tfoot id='NnXcT'></tfoot><dl id='NnXcT'><fieldset id='NnXcT'></fieldset></dl></div>
                        <bdo id='NnXcT'></bdo><ul id='NnXcT'></ul>

                        <legend id='NnXcT'><style id='NnXcT'><dir id='NnXcT'><q id='NnXcT'></q></dir></style></legend>

                        <small id='NnXcT'></small><noframes id='NnXcT'>