undefined reference to ....

http://codepad.org/7x4aaR3D 不知道问题是什么。。。

c++

4个回答

下面函数实现写成3了
void sort(int ar[][3], double br[], int s)
{
...
}

yeflin
Ths_ye 已经发现了,谢谢
3 年多之前 回复

楼主知道为什么不行吗? 二维数组作为形参退化为数组指针,也就是,你相当于修改了一位数组的位数就相当于修改了形参指针的类型,肯定会报错的

yeflin
Ths_ye 好的,原来如此,谢谢
3 年多之前 回复

Ubuntu下编译c程序,报错:
undefined reference to sin'
可是有很确定程序包含了头文件<math.h>.经查阅资料发现,在编译的时候还需要加上选项-lm,指明链接到数学库
......<br/><strong>答案就在这里:</strong><a target='_blank' rel='nofollow' href='http://blog.csdn.net/u012648144/article/details/41729561'>undefined reference to
sin'
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

 #include <iostream>

using namespace std;

void sort(int [][2], double [], int);

void swap(double &, double &);
void swap(int &, int &);

int main()
{
    int n;
    cin >> n;
    int i, j, m, gmd = 0, count = 0;
    int a[10000][2];
    double b[10000];
    for(i = 1; i <= n; i++)
    {
        for(j = 1; j <= i; j++)
        {
            int k = (i < j) ? i : j;
            for(m = k; m >= 1; m--)
            {
                if(i % m == 0 && j % m == 0)
                    gmd = m;
            }
            if(gmd == 1 && i != j)
            {
                a[count][0] = j;
                a[count][1] = i;
                b[count] = j / i;
                count++;
            }
        }
    }
    sort(a, b, count);
    cout << "0/1" << endl;
    for(i = 0; i < count; i++)
    {
        cout << a[i][0] << '/' << a[i][1] << endl;
    }
    cout << "1/1" << endl;
    return 0;
}
void sort(int ar[][2], double br[], int s)
{
    int i, j;
    for(i = 0; i < s; i++)
    {
        for(j = i + 1; j < s; j++)
        {
            if(br[i] < br[j])
            {
                swap(ar[i][0], ar[j][0]);
                swap(ar[i][1], ar[j][1]);
                swap(br[i], br[j]);
            }
        }
    }
}

void swap( double & a, double &  b)
{
    double temp;
    temp = a;
    a = b;
    b = temp;
}
void swap( int & a, int &  b)
{
    int temp;
    temp = a;
    a = b;
    b = temp;
}
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
undefined reference
编译时出错:rn.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_exec.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_ord2utf8.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_newline.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_fullinfo.o /e/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/pcre_xclass.o -L/e/pocobuild/lib/MinGW/ia32 -liphlpapi -lws2_32 -lpcrernCreating library file: e:/pocobuild/lib/MinGW/ia32/libPocoFoundationd.arne:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/LoggingFactory.o(.text$_ZNK4Poco12InstantiatorINS_15EventLogChannelENS_7ChannelEE14createInstanceEv[Poco::Instantiator::createInstance() const]+0x59): In function `ZN4Poco12InstantiatorINS_17FormattingChannelENS_7ChannelEED1Ev':rne:/poco-1.3.1-data/Foundation/include/Poco/Instantiator.h: undefined reference to `Poco::EventLogChannel::EventLogChannel()'rne:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/LoggingFactory.o(.text$_ZNK4Poco12InstantiatorINS_21WindowsConsoleChannelENS_7ChannelEE14createInstanceEv[Poco::Instantiator::createInstance() const]+0x59):e:/poco-1.3.1-data/Foundation/include/Poco/Instantiator.h: undefined reference to `Poco::WindowsConsoleChannel::WindowsConsoleChannel()'rne:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/SyslogChannel.o(.text+0x6e4): In function `ZN4Poco13SyslogChannel4openEv':rne:/poco-1.3.1-data/Foundation/src/SyslogChannel.cpp:76: undefined reference to `openlog'rne:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/SyslogChannel.o(.text+0x702): In function `ZN4Poco13SyslogChannel5closeEv':rne:/poco-1.3.1-data/Foundation/src/SyslogChannel.cpp:85: undefined reference to `closelog'rne:/pocobuild/Foundation/obj/MinGW/ia32/debug_shared/SyslogChannel.o(.text+0x762): In function `ZN4Poco13SyslogChannel3logERKNS_7MessageE':rne:/poco-1.3.1-data/Foundation/src/SyslogChannel.cpp:94: undefined reference to `syslog'rnrn看样子是是缺少可查了很久rn第一我包含了//这个只有openlog(),closelog()的声明,缺没有定义,rn我不知道到底怎么回事?是不是g++时 没有带什么时候-l参数如果缺少库是缺那个我也不知道,望高手指点rn
Undefined reference
在学习Computer System这本书rn看到第十二章, 按照书上的代码敲了一个Web Server出来rn[code=C/C++]rn#include "csapp.h"rnrnvoid echo(int connfd);rnrnint main( int argc, char **argv)rnrn int listenfd, connfd, port, clientlen;rn struct sockaddr_in clientaddr;rn struct hostent *hp;rn char *haddrp;rn rn if(argc != 2)rn rn fprintf(stderr, "Usage: %s \n", argv[0]);rn exit(0);rn rn port = atoi(argv[1]);rn rn listenfd = Open_listenfd(port);rn while(1)rn rn clientlen = sizeof(clientaddr);rn connfd = accept(listenfd, (SA *)&clientaddr, &clientlen);rn rn hp = Gethostbyaddr( (const char *)&clientaddr.sin_addr.s_addr, sizeof(clientaddr.sin_addr.s_addr), AF_INET); rn haddrp = inet_ntoa(clientaddr.sin_addr);rn printf("Server connected to %s (%s)\n", hp->h_name, haddrp);rn rn echo(connfd);rn Close(connfd);rn rn rn exit(0);rnrnrnvoid echo(int connfd)rnrn size_t n;rn char buf[MAXLINE];rn rio_t rio;rn rn Rio_readinitb(&rio,connfd);rn while( (n = Rio_readlineb(&rio, buf, MAXLINE)) != 0)rn rn printf("Server received %d bytes\n", n);rn Rio_writen(connfd, buf, n);rn rnrnrn[/code]rnrnrnrn在Ubuntu 64bit下面rngcc -Wall server.c -o serverrnrn编译器报错:rnundefined reference to "Open_listenfd"rnundefined reference to "Gethostbyaddr"rnundefined reference to "Close"rnrnundefined reference to "Rio_readinitb"rnundefined reference to "Rio_writen"rnundefined reference to "Rio_readlineb"rnrnrn头文件 csapp.h我是从教材的官网上下载的rn我也看过了, 上面这些“undefined”的函数, 在头文件里面也有。rnrn不明白为什么编译器报错, 望指教!rnrn谢谢!
求教undefined reference to
用g++编译一下代码时出现这样的问题:rn undefined reference to `Tree::Tree()'rnrn 1 #include rn 2 #include rn 3 using namespace std;rn 4rn 5 template rn 6 struct CSTnodern 7 rn 8 T data;rn 9 struct CSTnode* firstchild;rn 10 struct CSTnode* nextsibling;rn 11 struct CSTnode* parent;rn 12 ;rn 13rn 14 template rn 15 class Treern 16 rn 17 public:rn 18 Tree();rn 19 virtual ~Tree();rn 20 virtual void getParent() const=0;rn 21 virtual void getFirstChild() const=0;rn 22rn 23 ;rn 24rn 25 template rn 26 class csTree: public Treern 27 rn 28 public:rn 29 csTree();rn 30 ~csTree();rn 31 void getParent() const;rn 32 void getFirstChild() const;rn 33rn 34 private:rn 35 struct CSTnode* root;rn 36 ;rn 37rn 38 template rn 39 csTree::csTree():Tree()rn 40 rn 41 root=new CSTnode;rn 42 root->firstchild=NULL;rn 43 root->nextsibling=NULL;rn 44 rn 45rn 46 template rn 47 csTree::~csTree()rn 48 rn 49 rn 50 template rn 51 void csTree::getParent() constrn 52 rn 53 cout<<""<rn 56 void csTree::getFirstChild() constrn 57 rn 58 cout<<""< cs;rn 66 return 1;rn 67 rn
undefined reference to `CRYPTO_malloc_init'
本人在linux系统安装apache时configure这步没问题:rn./configure --prefix=/usr/local/apache --enable-ssl --enable-rewrite --enable-so --with-ssl=/usr/local/opensslrn 但是make时遇到报错rnhttpd-2.4.20/support/ab.c:2380: undefined reference to `CRYPTO_malloc_init'rnrn请问各位大神如何解决?
编译报错 undefined reference
一个叫 Component 的classrnrn[code=C/C++]//情况1,没有Component.cpp,光有一个Component.h,构造函数定义在其中rnclass Component rnpublic:rn Component() rn...rn;[/code]rn这样就会报rn[color=#FF0000]undefined reference to `Component::Component()'[/color]rnrn如果改成这样就okrn[code=C/C++]//情况2,同时又Component.cpp和Component.h,构造函数定义在cpp中rnrn//file Component.hrnclass Component rnpublic:rn Component();rn...rn;rnrn//file Component.cpprn#include "Component.h"rnComponent::Component() rnrn[/code]rnrnrn如果同时在h和cpp里都定义构造函数,又会出现重复定义的错误rn[color=#FF0000]redefinition of 'Component::Component()'[/color]rn[code=C/C++]//情况3,同时在cpp和h中定义构造函数rnrn//file Component.hrnclass Component rnpublic:rn Component() rn...rn;rnrn//file Component.cpprn#include "Component.h"rnComponent::Component() rnrn[/code]rnrn请问为什么情况1会报错?就是只在.h里定义构造函数。rn
undefined reference to 'pthread_create'
我在linux写下面c程序时,总是报错,说rnundefined reference to 'pthread_create'rnundefined reference to 'pthread_join'rnrn但是我看见pthread.h头文件下面有这个函数的定义啊。这是怎么回事呢?rnrnrnrn#include rn#include rn#include rn#include rn#define NLOOP 5000rnint counter;rnpthread_mutex_t counter_mutex = PTHREAD_MUTEX_INITIALIZER;rnrnvoid *doit(void *vptr)rnrn int i,val;rn for(i=0;i
undefined reference to ... 问题
在写一个内存池,可是在总是出现如题的这个错误rn[code=c]rn#ifndef MEMORYPOOL_Hrn#define MEMORYPOOL_Hrnrn#include rn#include rnrntemplate rnclass MemoryPoolrnrnpublic:rn MemoryPool(int _size = DEFAULTSIZE);rn ~MemoryPool();rn void* alloc(size_t _size);rn void free(void* element, size_t size);rn int size() const rn return _size;rn rn int vaildSize() const rn return _validsize;rn rnprivate:rn enum DEFAULTSIZE = 5;rn /**rn * @brief pool 用来存放内存块的指针rn */rn std::list pool;rn void expandPool(int _len = DEFAULTSIZE);rn int _size;rn int _validsize;rn;rnrntemplate rnMemoryPool::MemoryPool(int _size):rn _size(0),rn _validsize(0)rnrn expandPool(_size);rnrntemplate rnMemoryPool::~MemoryPool()rnrn std::list::iterator ite = pool.begin();rn for (;ite != pool.end();++ite) rn delete[] (*ite);rn rnrntemplate rnvoid* MemoryPool::alloc(size_t /*_size*/)rnrn if (pool.empty()) rn expandPool();rn rn void* t = pool.front();rn pool.pop_front();rn --_validsize;rn return t;rnrntemplate rnvoid MemoryPool::free(void *element, size_t /*size*/)rnrn pool.push_back(element);rn ++_validsize;rnrntemplate rnvoid MemoryPool::expandPool(int _len)rnrn for (int i = 0;i < _len;++i) rn pool.push_back(static_cast(new char[sizeof(T)]));rn rn _validsize += _len;rn _size += _len;rnrnrnrn#endif // MEMORYPOOL_Hrnrn#ifndef TESTOBJ_Hrn#define TESTOBJ_Hrn#include "memorypool.h"rnrnclass Objrnrnpublic:rn Obj() rn static void newPool() rn mPool = new MemoryPool();rn rn static void deletePool() rn delete mPool;rn rn void* operator new(size_t size) rn return mPool->alloc(size);rn rn void operator delete(void* m, size_t size) rn mPool->free(m,size);rn rnrnprivate:rn static MemoryPool *mPool;rn;rnMemoryPool Obj::mPool = NULL;rnrn#endif // TESTOBJ_Hrnrnrn[/code]rnrnrn[img=https://img-bbs.csdn.net/upload/201304/30/1367282753_435259.png][/img]rnrn希望大虾帮解决下
undefined reference to的问题
小弟我入门不久,遇到一个不懂的问题,我写了如下程序,但是编译的时候出现了问题,不知道怎么修正,望各位师傅解答解答rn#include rnvoid printed(int n);rnint main()rn rn int a = 287;rn printed(287);rn getchar();rn return 0;rnrnvoid printd(int n)rnrn if (n < 0) rn rn putchar('-');rn n = -n;rn rn if (n / 10)rn printed(n / 10);rn putchar(n % 10 + '0');rn
NDK undefined reference to `main'
调试NDK中自带的HelloJni例子,编译的时候出现undefined reference to `main'的error,倘若我在.c中加入main函数,那是不是Android工程中就有两个程序入口点了?查了一下,“Add -shared to LD_FLAGS fixed it”,但不太明白,有大神帮个忙吗?帮我看看哪里的设置出现了问题?谢谢啊
undefined reference to 'GameLayer::createScene()'
将Cocos项目导入eclipse当中后,报这个错误,百度到说进入Android.mk添加所有cpp文件,这是什么意思,尝试了一下还是有错。。。
undefined reference to错误!
下面的代码gcc的时候提示下面的错误,看半天没找出哪有毛病,请教高手指点!rn/tmp/ccmKb9yz.o: In function `sort':rntest.c:(.text+0x1f5): undefined reference to `merge'rncollect2: ld 返回 1rnrn[code=C/C++]rn#include rnrn#define MAXSIZE 8rnint arr[MAXSIZE] = 5, 7, 2, 1, 9, 4, 3, 8 ;rnrnvoid merger(int start, int mid, int end) rn int len1 = mid - start + 1;rn int len2 = end - mid;rn int left[len1];rn int right[len2];rn int i, j, k;rn // 相邻子序列赋值rn for (i = 0; i < len1; i++)rn left[i] = arr[start + i];rn for (j = 0; j < len2; j++)rn right[j] = arr[mid + 1 + j];rn // 合并相邻两个有序子序列rn i = j = 0;rn k = start;rn while (i < len1 && j < len2)rn if (left[i] < right[j])rn arr[k++] = left[i++];rn elsern arr[k++] = right[j++];rn // 检查是否合并完毕rn while (i < len1)rn arr[k++] = left[i++];rn while (j < len2)rn arr[k++] = right[j++];rnrnrnvoid sort(int start, int end) rn int mid;rn if (start < end) rn mid = (start + end) / 2;rn sort(start, mid);rn sort(mid + 1, end);rn merge(start, mid, end);rn rnrnrnint main(int argc, char**argv) rn sort(0, MAXSIZE - 1);rn int index = 0;rn for (index = 0; index < MAXSIZE; index++)rn printf("%d ", arr[index]);rn return 0;rnrnrnrn[/code]
undefined reference to "function..."
Redhat 5.0 企业版rnEclipse 3.2 IDErnrn所有写出来的.cpp文件均生成对应.o问件,但总是构建不成功,报错说undefined reference to "function..."。rn去google了,但是很多人给出的都是诸如大小写敏感、路径设置错误、.o文件生成错误,都不能解决问题。rn请高手进来指教!!!!
undefined reference to `dlopen'
我用的是ubuntu8.04, 在eclipse下面开发C++程序rnrno_pModule = dlopen( "./libclassifier.so.1.0", RTLD_LAZY);rnm_pLoadModel = (void(*)(char*)) dlsym( o_pModule, "ClaLoadModel" );rnrn在C++代码里调用动态库时出现如下的错误:rnundefined reference to `dlopen'rnundefined reference to `dlsym'rnundefined reference to `dlsym'rnrn请问如何解决? 望详细点, 谢谢
问题关于undefined reference to
在linux下,我装了一个新的库,叫Gosu的2d游戏引擎。用CodeBlocks打开一个范例程序,报了很多的undefined reference to错误,程序include了gosu/gosu.hpp这个文件,我去/usr/include文件夹下,找到了gosu这个文件夹,文件夹下的文件也都是齐的。但是我不知道cpp文件都放在什么地方。安装的时候没报错。是什么原因呢?rnrn以前也常有这种问题,不知道是怎么回事。rnrn是不是编译器设置不对?GNU GCC Compiler。
编译错误 undefined reference to '__udivdi3'
最近在调试文件系统 exfat,在将打包好的.a库文件加到工程中时出现编译错误:undefined reference to '__udivdi3'。rn在工程中直接使用源代码编译没有这个错误。在网上找了很久没有找有行之有效的方法,只有在这里寻找高手帮忙了。rn打包方法:makefile + mingw32-make.exe,同样的方法打包没有64位数除32位数的库是正常的。rn编辑器:codelitern编译器:ARM-GCCrncpu :ARM9rn系统 :无rnrn
undefined reference to `lstat'
undefined reference to `lstat'rn这个编译错误说明什么,我用的是mingw,我看glibc里FAQ说是,可能缺少lib.os是这样吗。
glibc-static-2.17-55.el7.x86_64(undefined reference to `memcpy@GLIBC_2.14)
Ubuntu下安装此资源,可以解决/lib64/libstdc++.so.5: undefined reference to `memcpy@GLIBC_2.14' 这个问题
undefined reference to `_Unwind_Resume'
OS:windows 7nIDE:codeblocks 12.12nc complier:mingw32-gcc.exenC++ complier:mingw32-g++.exen错误提示:undefined reference to `_Unwind_Resume'|n在IDE中运行FLTK的模板程序“hello world”时出现错误n——————————————————分割线——————————————n如下是所有错误信息:n||=== Build: Debug in fltk_test01 (compiler: GNU GCC Compiler) ===|nC:\msys\1.0\local\lib\libfltk.a(Fl_Window.o):Fl_Window.cxx:(.text$_ZN9Fl_WindowC2EiiiiPKc+0x72)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Window.o):Fl_Window.cxx:(.text$_ZN9Fl_WindowC2EiiPKc+0x80)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Window.o):Fl_Window.cxx:(.text$_ZN9Fl_WindowD2Ev+0x6e)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Window.o):Fl_Window.cxx:(.eh_frame+0x83)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.text$_ZN15Fl_Input_Choice7menu_cbEP9Fl_WidgetPv[__ZN15Fl_Input_Choice7menu_cbEP9Fl_WidgetPv]+0xfe)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.text$_ZN15Fl_Input_Choice6inp_cbEP9Fl_WidgetPv[__ZN15Fl_Input_Choice6inp_cbEP9Fl_WidgetPv]+0x87)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.text$_ZN8Fl_Group6handleEi+0x581)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.text$_ZN8Fl_GroupD2Ev+0x37)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.text$_ZN15Fl_Input_ChoiceC2EiiiiPKc+0x19c)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.eh_frame+0x157)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.eh_frame$_ZN15Fl_Input_Choice7menu_cbEP9Fl_WidgetPv+0x13)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.eh_frame$_ZN15Fl_Input_Choice6inp_cbEP9Fl_WidgetPv+0x13)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.eh_frame$_ZN10Fl_SpinnerD1Ev+0x13)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Group.o):Fl_Group.cxx:(.eh_frame$_ZN10Fl_SpinnerD0Ev+0x13)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl.o):Fl.cxx:(.text$_ZN2Fl4copyEPKciiS1_+0x196)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl.o):Fl.cxx:(.text$_ZN2Fl6optionENS_9Fl_OptionE+0x285)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl.o):Fl.cxx:(.text$_ZN2Fl6optionENS_9Fl_OptionE+0x2a3)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl.o):Fl.cxx:(.eh_frame+0xb4b)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_get_system_colors.o):Fl_get_system_colors.cxx:(.text$_ZN2Fl13reload_schemeEv+0x737)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_get_system_colors.o):Fl_get_system_colors.cxx:(.text.startup._GLOBAL__sub_I__ZN2Fl10backgroundEhhh+0xa7)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_get_system_colors.o):Fl_get_system_colors.cxx:(.eh_frame+0x157)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Window_shape.o):Fl_Window_shape.cxx:(.text$_ZN9Fl_Window13shape_pixmap_EP9Fl_Pixmap+0x64)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Window_shape.o):Fl_Window_shape.cxx:(.eh_frame+0x113)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Widget.o):Fl_Widget.cxx:(.text$_ZN9Fl_Widget11do_callbackEPS_Pv+0x5e)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Widget.o):Fl_Widget.cxx:(.eh_frame+0x30b)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Menu_Button.o):Fl_Menu_Button.cxx:(.text$_ZN14Fl_Menu_Button5popupEv+0xe9)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Menu_Button.o):Fl_Menu_Button.cxx:(.eh_frame+0x7f)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Button.o):Fl_Button.cxx:(.text$_ZN9Fl_Button19simulate_key_actionEv+0x94)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Button.o):Fl_Button.cxx:(.text$_ZN9Fl_Button6handleEi+0x3c5)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Button.o):Fl_Button.cxx:(.text$_ZN9Fl_Button6handleEi+0x3d6)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Button.o):Fl_Button.cxx:(.eh_frame+0x103)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Menu_.o):Fl_Menu_.cxx:(.text$_ZN8Fl_Menu_D2Ev+0x37)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Menu_.o):Fl_Menu_.cxx:(.eh_frame+0x2bb)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Tooltip.o):Fl_Tooltip.cxx:(.text$_ZL15tooltip_timeoutPv+0x10b)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Tooltip.o):Fl_Tooltip.cxx:(.eh_frame+0xdf)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(fl_font.o):fl_font.cxx:(.text$_ZL7fl_fontP18Fl_Graphics_Driveriii+0xf4)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(fl_font.o):fl_font.cxx:(.eh_frame+0xa3)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Image.o):Fl_Image.cxx:(.text$_ZN12Fl_RGB_ImageD2Ev+0x3c)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Image.o):Fl_Image.cxx:(.text$_ZN12Fl_RGB_ImageC2EPK9Fl_Pixmapj+0x95)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Image.o):Fl_Image.cxx:(.eh_frame+0x1f7)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Double_Window.o):Fl_Double_Window.cxx:(.text$_ZN16Fl_Double_WindowD2Ev+0x37)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Double_Window.o):Fl_Double_Window.cxx:(.eh_frame+0x4b)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Preferences.o):Fl_Preferences.cxx:(.text$_ZN14Fl_PreferencesC2EPKcS1_S1_+0x85)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Preferences.o):Fl_Preferences.cxx:(.text$_ZN14Fl_PreferencesC2ENS_4RootEPKcS2_+0x85)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Preferences.o):Fl_Preferences.cxx:(.text$_ZN17Fl_Plugin_ManagerC2EPKc+0x72)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Preferences.o):Fl_Preferences.cxx:(.text$_ZN17Fl_Plugin_Manager6pluginEi+0x7f)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Preferences.o):Fl_Preferences.cxx:(.text$_ZN17Fl_Plugin_Manager6pluginEPKc+0xa9)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Preferences.o):Fl_Preferences.cxx:(.eh_frame+0x8fb)||undefined reference to `__gxx_personality_v0'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Pixmap.o):Fl_Pixmap.cxx:(.text$_ZN9Fl_PixmapD2Ev+0x3e)||undefined reference to `_Unwind_Resume'|nC:\msys\1.0\local\lib\libfltk.a(Fl_Pixmap.o):Fl_Pixmap.cxx:(.text$_ZN9Fl_Pixmap4copyEii+0x416)||undefined reference to `_Unwind_Resume'|n||More errors follow but not being shown.|n||Edit the max errors limit in compiler options...|n||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|n————————————分割线——————————————n由于我在网上找了很多相关资料,里面所说的mingw版本问题和makefile命令完全不懂,请最好能step by step讲解一下,谢谢!nn再次感谢!n
undefined reference to memset?
请问高手如何解决undefined reference to memset,memcpy, __divsi3之类的问题?rn我用GCC编译一些嵌入式代码,可能是Makefile写得不对,连接器在链接时总是提示一些很奇怪的错误。比如我定义了一个二维数组,他就提示在数组定义的地方undefined reference to memcpy。数组定义如下:rnint array[][2]=rnrn 5, 2,rn 6, 4,rn;rn我调用memset他也说找不到,但编译时他不报错,也就是说他找到了原形,但找不到定义。尽管我include了memory.h string.h math.h等,都没有用。而我用了一个除号,他就说undefined reference to __divsi3。我也试过在连接时用了 -lm -lc,但结果一样。rn以下是MakefilernrnOBJECTS = startup.o target.o UART0.o au030.o auo30.o test.o io.o memory.o testjpeg.o jpeg.o lcd.ornLIB_DIRS = ../usr/local/arm/lib/gcc-lib/arm-linux/3.2.3/rnCC = arm-linux-gcc -vrnLD = arm-linux-ld -vrnAR = arm-linux-ar -vrnAS = arm-linux-as -vrnCP = arm-linux-objcopyrnOD = arm-linux-objdump rnCFLAG = -I./ -c -fno-common -O2 -grnAFLAG = -ahls -mapcs-32 -o startup.ornLDFLAGS = -nostartfiles --crefrnLDFLAGS += -lc -lm -Map boot.map -T link.ldsrnHEXFORMAT = -O ihexrnBINFORMAT = -O binaryrnODFLAG = -x --symsrnrnall: testrnrntest: boot.outrn @ echo "Copying..."rn $(CP) $(HEXFORMAT) boot.out boot.hexrn $(CP) $(BINFORMAT) boot.out boot.binrn $(OD) $(ODFLAG) boot.out > boot.dmprnrnboot.out: $(OBJECTS) link.ldsrn @ echo "Linking..."rn $(LD) $(LDFLAGS) $(OBJECTS) -o boot.outrn $(LD) $(LDFLAGS) $(OBJECTS) -o boot.elfrnrnstartup.o: startup.Srn @echo "Assembling..."rn $(AS) $(AFLAG) startup.S > startup.lstrn%.o: %.crn @echo "Compiling..."rn $(CC) $(CFLAG) $
关于undefined reference to 问题
ab.h文件有这么一段定义rnclass Matrix : public GeneralMatrix // usual rectangular matrixrnrn GeneralMatrix* Image() const; // copy of matrixrnpublic:rn Matrix() rn ~Matrix() rn Matrix(int, int); // standard declarationrn Matrix(const BaseMatrix&); // evaluate BaseMatrixrn void operator=(const BaseMatrix&);rn void operator=(Real f) GeneralMatrix::operator=(f); rn void operator=(const Matrix& m) operator=((const BaseMatrix&)m); rn ...rn ...rn;rnrn主函数k.cpp 下面这段代码出错rn Matrix xhat(n,1);rn Matrix phi(n,n);rn Matrix z(m,1);rn错误信息是类似undefined reference to `Matrix::Matrix(int, int)'rn请问如何解决?rn
关于agent++的undefined reference
我在Ubuntu上解压好snmp++ agent++ agentX++三个压缩包,都放在snmp++文件夹下rnsnmp++rn --snmp++rn --agent++rn --agentX++rn然后在snmp++/include/snmp_pp的config_snmp_pp.h定义#define _NO_SNMPv3rn分别用Makefile.linux编译这三个包生成各自的库文件,加入到我的code::block工程中去,rn引入一下头文件rn#include rn#include rn#include rn#include rn#include rn编译能通过,在链接时总是出错:rn/software/snmp++/agentX++/lib/libagentx++.a(agentx_request.o): In function `NoVacm':rn/software/snmp++/agentX++/src/agentx_request.cpp:40: undefined reference to `Agentpp::Vacm::Vacm()'rn/software/snmp++/agentX++/src/agentx_request.cpp:40: undefined reference to `Agentpp::Vacm::Vacm()'rn/software/snmp++/agentX++/lib/libagentx++.a(agentx_request.o): In function `~NoVacm':rn/software/snmp++/agentX++/src/agentx_request.cpp:46: undefined reference to `Agentpp::Vacm::~Vacm()'rn/software/snmp++/agentX++/src/agentx_request.cpp:46: undefined reference to `Agentpp::Vacm::~Vacm()'rn/software/snmp++/agentX++/src/agentx_request.cpp:46: undefined reference to `Agentpp::Vacm::~Vacm()'rn/software/snmp++/agentX++/lib/libagentx++.a(agentx_request.o):(.rodata._ZTIN7Agentpp6NoVacmE[typeinfo for Agentpp::NoVacm]+0x8): undefined reference to `typeinfo for Agentpp::Vacm'rncollect2: ld returned 1 exit statusrnrn这是怎么回事啊?在网上我根本搜不到解决办法啊,求救啊。。。
undefined reference to winmain
这是个什么问题啊rn我需要在什么环境下编译运行才可以
求助!!undefined reference to 'pthread_create'
我确定头文件已经包含了!rn#include rnrn命令为 gcc beiwang.c -o beiwang -lpthreadrnrn可结果还是如图示:rnrn[img=E:\快照-1.jpg][/img]
undefined reference to `filename'
[code=C/C++]rn// main.crn#include rn#include "file.h"rnrnint main()rnrn printf("%s\n", filename);rn return 0;rnrn[/code]rn[code=C/C++]rn// file.hrn#ifndef FILE_H_INCLUDEDrn#define FILE_H_INCLUDEDrnrnextern char filename[];rnrn#endif // FILE_H_INCLUDEDrn[/code]rn[code=C/C++]rn#include "file.h"rnchar filename[] = "/etc/passwd";rn[/code]rnrn[code=C/C++]rn// error rnobj\Debug\main.o||In function `main':|rn\test\main.c|6|undefined reference to `filename'|rn||=== Build finished: 1 errors, 0 warnings ===|rn[/code]
undefined reference to...
在LINUX下,eclipse + cdt + qt-eclipse-plugin下写代码,rn很简单的一条语句,pcap_findalldevs(&alldevs,errbuf),调用libpcap里面的函数,rn但是编译提示错误:rn[color=#FF0000]undefined reference to `pcap_findalldevs'[/color] rn在网上找到的答案是,连接的时候找不到库,可以修改make文件,添加库文件的路径就好了,rn但是我的make文件是开发环境生成的,无法手动修改,在make文件里找到如下内容:rnLIBS = $(SUBLIBS) -L/usr/local/Trolltech/Qt-4.3.4/lib -lQtGui (后面内容省略)rn这个是make文件声明的link时的库文件路径信息rn发现只能从SUBLIBS这个变量上做文章了,但是这个文件,我自己找遍了系统的环境变量配置也没找到rn不知道在哪里定义的,望高手指教,不生感激。rn
undefined reference to错误。
g++.exe F:\programme\ll.o -o F:\programme\ll.exe -Wall -fpermissive -Wno-sign-compare -grnF:\programme\ll.o(.text+0x29d): In function `ZN7Account4rateEd':rnF:/programme/ll:27: undefined reference to `Account::interestRate'rncollect2: ld returned 1 exit statusrnFailurernrnrn这是错误提示。请大家帮帮忙
undefined reference to `DES_cfb64_encrypt'
有头文件 rn#include rn#include rn#include "sysclass/base_func.h"rn 14 #include "crypt.h"rn 15 #include rn 16 #include rn 17 #include rn 18 #include rn 19 #include rn 20 #include rn 21 #include rnrnrn出现错误 undefined reference to `DES_cfb64_encrypt'rnrn求解!
qt 当中undefined reference to
/home/sdust/untitled1/mainwindow.cpp:154: rn我自己写了个函数bool IsValidEmail(string)rn运行提示rnerror: undefined reference to `MainWindow::IsValidEmail(std::string)'rn急~~~
Linux下undefined reference to错误
各位:我在写一个双向链表程序。里面有一个FindElebyIndex 函数,是用来查找链表中指定序号元素的,但是我在编译连接时提示如下错误:rn/tmp/ccSh2r0h.o: In function `main':rnDoubleLinkList.c:(.text+0x2ee): undefined reference to `FindEleByIndex'rncollect2: ld returned 1 exit statusrnrn我使用的命令是rngcc DoubleLinkList.c -o DoubleLinkListrnrn然而我把这个函数注释后重新编译通过,然后取消注释,编译也通过,并且运行结果正确。可是不知这里面发生了什么。请有过类似经验的大牛告诉我为什么会这样。为什么注释后编译链接,再取消注释重新编译链接就好了呢?rn我在网上搜这个错误,说是链接错误,但不知道错在了那里。rnrn这是我的源代码:rn//2011/05/08rn//DoubleList的实现和基本操作。包括查找,删除,增加等。rnrn#includern#includernrn#define True 1rn#define False 0rn#define null NULLrnrntypedef struct DNodernrn int data;rn struct DNode* prior; //前驱结点rn struct DNode* next; //后继结点rnDLinkList;rnrn//void PrintDl(DLinkList* dl);rnrn//头插法建表rnint CreateDoubleLinkList_head(DLinkList *dl,int n)rnrn DLinkList* s;int i;rn dl->next=null;rn dl->prior=null;rn for(i=0;idata));rn s->next=dl->next; //s的前驱指向下一个结点rn s->prior=dl; //s插入头结点之后 rn dl->next=s; //dl指向刚插入的结点 rn if(s->next!=null)rn rn s->next->prior=s; //若插入结点的下一个结点不为空,则后继结点的前驱指针域指向srn rn //printf("%d\n",dl->data);rn rn // PrintDl(dl);rn return True;rnrnrn//尾插法rnint CreateDoubleLinkList_tail(DLinkList *dl,int n)rnrn DLinkList *s,*r;rn int i=0;rn dl->next=null;rn dl->prior=null;rn r=dl;rn for(i=0;idata));rn r->next=s; //插入尾结点之后rn s->prior=r; //修改s的前驱指针域rn r=s;rn rn r->next=null; //尾结点next域设为空rn return True;rnrnrn//这里貌似出了一个链接错误:rn///tmp/ccSh2r0h.o: In function `main':rn//DoubleLinkList.c:(.text+0x2ee): undefined reference to `FindEleByIndex'rn//collect2: ld returned 1 exit statusrn//不知是何原因,重新注释这个函数后就正确了。rn//按序号查找第n个元素rnint FindElebyIndex(DLinkList* dl,int index,int *element)rnrnrn int i=0;rn DLinkList* s=dl;rnrn while(s!=null&&inext;rn rnrn if(s==null)rn rn return False;rn rnrn *element=s->data;rnrn return True;rnrnrn//Print DLrnvoid PrintDl(DLinkList* dl)rnrn DLinkList* s=dl->next;rn while(s!=null)rn rn printf("%d\n",s->data);rn s=s->next;rn rnrnrn//Testrnint main()rnrn //头插法建表rn DLinkList* dl =(DLinkList*)malloc(sizeof(DLinkList)); //建立带头结点的双向链表rn printf("输入你想要建表的结点个数:\n");rn int num=0;rn scanf("%d",&num);rn printf("输入这%d数:\n",num);rn CreateDoubleLinkList_head(dl,num);//头插法建表rn printf("链表中有的元素为:\n");rn PrintDl(dl);rn printf("====================================================\n");rn //尾插法建表rn DLinkList* doublelist=(DLinkList*)malloc(sizeof(DLinkList)); //建立带头结点的双向链表rn printf("输入你想要建表的结点个数:\n");rn int count=0;rn scanf("%d",&count);rn printf("输入这%d数:\n",count);rn CreateDoubleLinkList_tail(doublelist,count);//头插法建表rn printf("链表中有的元素为:\n");rn PrintDl(doublelist);rn //查找第n个元素并打印rn int n;rn printf("输入你想找的元素序号:");rn scanf("%d",&n);rn int x=0;rn int *e=&x;rn FindElebyIndex(doublelist,n,e);rn printf("您想找的元素为:%d\n",*e);rnrn return 0;rnrnrn
undefined reference to'CPU_ZERO'问题
我在使用sched_setaffinity将线程和CPU绑定,但总显示“undefined reference to'CPU_ZERO'”。我在文件头已经写了rn#define __USE_GNUrn#include rn为什么出现这些问题,怎样解决?谢谢
undefined reference to `OCILogon'
./lib.so: undefined reference to `OCILogon'rn./lib.so: undefined reference to `OCIEnvCreate'rn./lib.so: undefined reference to `OCIHandleAlloc'rn需要包含什么头文件?
undefined reference to `clock_gettime'
rnrn查找了一些资料,说:rn这个错误通常是因为链接选项里漏了-lrt,但有时发现即使加了-lrt仍出现这个问题,使用nm命令一直,会发现-lrt最终指向的文件没有包含任何symbol,这个时候,可以找相应的静态库版本librt.a,看看它里面是否存在`clock_gettime'。rn提示:使用/usr/lib/x86_64-linux-gnu/librt.a替代-lrtrnrnrn问题:但是我的目录下根本没有 /usr/lib/x86_64-linux-gnu/librt.a 文件啊~怎么装??
QT编译错误 undefined reference to
编译QT遇到如下错误,请问怎么解决rn[img=https://img-bbs.csdn.net/upload/201706/22/1498118569_898383.png][/img]
codeblocks 报错Undefined reference to
想要gcc编译工程给linux用rn报下面错 可是明明头文件给了 静态库也连接了 o文件也生成了 右键 find decalaration也能找到相应头文件中的定义rn[img=https://img-bbs.csdn.net/upload/201906/20/1560999189_635135.png][/img]rnrn另外[url=https://www.cnblogs.com/Bonker/p/3549140.html][/url] 这个里面的这个问题我也看了rn所有的cpp文件都生成了o文件rn[img=https://img-bbs.csdn.net/upload/201906/20/1560999237_789872.png][/img]rn设置也没问题rnrnrn[face]monkey:50.gif[/face]rn第一次用这个ide 真的找不到问题 有没有遇到过这个问题的 帮忙排查一下
求助:undefined reference to `pcre_compile'
Ubuntu 12.04 LTSrnrn通过apt-get install libpcre3 libpcre3-dev安装pcre,安装后,pcre.h在/usr/include/pcre.hrnrn程序中,#include rnrngcc -Wall -I/usr/include -I/usr/local/include -L/lib -L/usr/lib -L/usr/local/lib -lpcre 5.c,有如下提示:rn5.c.text+0x54): undefined reference to `pcre_compile'rn5.c.text+0x7d): undefined reference to `pcre_study'rn5.c.text+0xf2): undefined reference to `pcre_exec'rn5.c.text+0x10: undefined reference to `pcre_free_study'rn5.c.text+0x10e): undefined reference to `pcre_free'rnrn怎么解决?
undefined reference to 'pthread_cond_signal'
rnundefined reference to 'pthread_cond_signal'rnrn我的编译命令是 cc -pthread example.crnrn-lphtread也用过了,报的错是一样的rnrn在网上也无论如何找不到答案rnrn求助了,谢谢! 到底怎样才能正确使用pthread_cond_signal呢? 我明明在/usr/include/pthread.h中看到有pthread_cond_signal函数的声明啊
Dev C++ undefined reference to
在 头文件 JCDLinkList.h 中定义了一个函数, 在 源文件 JCDLinkList.c 中实现了它,rn在 main.c中调用这个函数时,提示 undefined reference to 函数名。rnrn/* rn *file JCDLinkList.hrn *------------------rn *这个文件JCD写的链表定义操作的接口文件rn *2006-7-23rn */rnrn#ifndef _JCDLinkList_h rn#define _JCDLinkList_h rnrn#include rn#include rnrnrnrnrn/* rn *链表的数据类型定义rn */ rnrntypedef struct node NODE;rntypedef NODE *LinkList;rnrn/*rn *创建一个新的链表rn *函数 CreateListrn *用法 NewLinkList = CreateList rn */rnrnrnrnLinkList CreateList();rnrn/*rn *输出一个链表rn *函数 PrintListrn *用法 PrintList(P); rn */rnrnvoid PrintList(LinkList X); rnrnvoid PrintTest();rnrnrn#endifrn rnrnrn/*rn *file JCDLinkList.crn *------------------rn *这个文件实现JCDLinkList.h中的定义rn */rn rnrn#include rn#include rn#include "JCDLinkList.h"rnrnstruct nodernrn int data;rn struct node *next;rn;rnrn/* 创建链表 */ rnLinkList CreateList()rnrn LinkList head,tail,P;rn head = tail = NULL;rn int n;char c;rn printf("input data \n");rn while (scanf("%d",&n)>0)rn rn P = (LinkList) malloc (sizeof(NODE));rn P->data = n;rn P->next = NULL;rn if (head == NULL)rn rn head = P;rn tail = head;rn rn elsern rn tail->next = P;rn tail = tail->next; rn rn rn dorn rn scanf("%c",&c); rn rn while (c!= '\n');rn return head;rnrnrn/*rn *打印链表rn */rn rnvoid PrintList(LinkList X)rnrn LinkList P;rn P = X;rn while (P!= NULL)rn rn printf("%d\n",P->data);rn P = P->next; rn rn printf("\n"); rn rnrnvoid PrintTest()rnrn printf("This Is A Test"); rnrnrnrnrnrn/*rn *main.c rn *主程序 rn*/rnrnrn#include rn#include rn#include "JCDLinkList.h"rnrnint main(int argc, char *argv[])rnrn rn LinkList P;rn /*P = CreateList(); */rn PrintTest();rn rn return 0;rnrnrnrnrnrn大家帮我看看,实在困扰我太久了。rnrnrn
类成员函数找不到undefined reference to
定义了一个类,有一个函数时返回一个vector。rnrn------rnStaAgent.hrn------rnrnusing Ssid_t = struct rnstd::string ssid;rn;rnrnclass StaAgent rnpublic:rnvector scanSsid();rn...rnrnrn在StaAgent.cpp里定义了此函数的实现rnrn------rnStaAgent.cpprn------rnrnrnvector StaAgent::scanSsid()rnrn...rnrnrnrn在另一个文件里调用这个rnrn#include "StaAgent.h"rn...rnvoid StaDialog::cn_scanSsidBt_clicked()rnrnauto _sa = new StaAgent();rnauto ssids = _sa->scanSsid();rn...rnrnrn链接的时候显示undefined reference to StaAgent::scanSsid()rnrng++ -Wl,-O1 -Wl,-rpath,/opt/Qt5.1.0/5.1.0/gcc_64 -Wl,-rpath,/opt/Qt5.1.0/5.1.0/gcc_64/lib -o StaTest main.o StaAgent.o StaDialog.o moc_StaDialog.o -L/opt/Qt5.1.0//5.1.0/gcc_64/lib -lQt5Gui -lQt5Widgets -lQt5Core -lGL -lpthreadrnStaDialog.o: In function `StaDialog::cn_scanSsidBt_clicked()':rnStaDialog.cpp:(.text+0x1d2): undefined reference to `StaAgent::scanSsid()'rncollect2: error: ld returned 1 exit statusrnrnrnrn----------------------------------rn首先,链接文件里能找到StaAgent.orn然后使用nm -C StaAgent.orn在输出里,找不到StaAgent::scanSsid()这个符号。
qtopia编译出错undefined reference to
为什么我编译一直出现类似的错误,怎么改。。。rn-lqtopia2 -lqtopia -lqpe -L/qtopia/qtopia-free-2.2.0/qtopia/lib -L/qtopia/qt-2.3.10/lib -lqtern.obj/release-shared/callover.o(.text+0x6dd): In function `Callover::closethisDialog()':rn/qtopia/qtopia-free-2.2.0/qtopia/src/applications/mycall/callover.cpp:58: undefined reference to `Callover::CalloverOperate(int)'rncollect2: ld returned 1 exit statusrnmake[1]: *** [mycall] Error 1rnmake[1]: Leaving directory `/qtopia/qtopia-free-2.2.0/qtopia/src/applications/mycall'rnmake: *** [all] Error 2rnrn找到callover.cpp(58行)rn yesbtn=new QPushButton(this);rn yesbtn->setPixmap(QPixmap(QPEApplication::qpeDir()+ "pics/mycall/yes.png"));rn layout4->addMultiCellWidget(yesbtn,3,3,1,1);rn connect(yesbtn,SIGNAL(clicked()),this,SLOT(closethisDialog(void)));rn......rnvoid Callover::closethisDialog(void)rnrn emit(CalloverOperate(0)); //58行rn this->close();rnrn在callover.h里面定义的这个信号rnsignals:rn void CalloverOperate(int);rn发现如果把58行注释掉,则编译运行都可以,但点击button没反应,也就是说槽函数没有起作用,窗口也一直停在第四界面。rn检查mycall.pro文件,.cpp和.h都包含进来了,再检查callover.cpp、callover.h头文件,基本都跟前面一样的,也没有什么可添加了,不知道哪里出错了?
undefined reference to winmain@16'错误!
#include rnrnint mian(void)rnrn printf("the begin\n");rn goto end;rnrn printf("hello world");rnend:rn printf("the end\n");rn return 0;rnrnrnrn有一个错误“undefined reference to winmain@16” 这是为什么呢?
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数