fcatch-undefined-behavior
全部标签 我的编译器报告了对openWallet(..)函数的undefinedreference。如您所见,我已链接响应库-L/usr/lib-lkdeui-kdecore-lkparts。错误:password.cpp:(.text+0x29):undefinedreferenceto`KWallet::Wallet::openWallet(QStringconst&,unsignedlonglong,KWallet::Wallet::OpenType)'编译命令:g++-Wl,-O1-Wl,-rpath-link,/usr/lib/x86_64-linux-gnu-opassword_cl
我写了一个简单的程序来测试xdotool是否可以满足我的要求。(嗯,不是真的。我的第一步是确保我是否可以调用xdotool库。)#include#includeusingnamespacestd;intmain(){cout但是,当我使用g++-oamain.cpplibxdo.a-lXtst-lX11-lXinerama-I../test/xdotool-2.20110530.1编译时,出现以下错误留言:/tmp/ccW95RQx.o:Infunction`main':main.cpp:(.text+0x5):undefinedreferenceto`xdo_version()'ma
这可能只是我要迁移到的构建系统的问题,但我将包括这两个系统的差异以及我是如何遇到问题的。我的旧构建系统是SLES10机器。gcc/cpp/g++版本为4.1.0我的新系统是SLES11SP4,gcc/cpp/g++版本是4.3.4。我正在构建一个共享库;在新系统上构建和链接工作正常。但是,在新系统上加载时,我得到以下信息:error./mysharedlib.so:undefinedsymbol:stat由于stat()函数包含在/usr/include/sys/stat.h中,我查看了两个系统上的glibc。旧的:#rpm-q-f/usr/include/sys/stat.hglib
这个问题在这里已经有了答案:Undefinedreferenceto`sin`[duplicate](4个答案)关闭6年前。我的源代码有点问题。gcc跟我说话:undefinedreferenceto`round'但我不知道为什么,因为我正在使用stdio.h、stdlib.h、math.h...:-(你能帮我解决这个问题吗?#include#include#include#include#include#include#include#include#defineVERYBIG200intdir_size(constchar*dirname){intsize=0;charpath[V
我正在尝试在运行KaliLinux的笔记本电脑上设置WordPress。在我安装WordPress和我正在使用的主题之前一切正常。我正在尝试在基岩上使用根鼠尾草。但是在我完成安装过程后,我在管理员中收到一条通知:Notice:Undefinedindex:hostin/var/www/html/site/web/wp/wp-includes/theme.phponline2937Notice:Undefinedindex:hostin/var/www/html/site/web/wp/wp-includes/theme.phponline2937Notice:Undefinedinde
动态加载库时出现undefinedsymbol错误。这是我生成此错误的代码片段:intmain(){void*lib_handle=NULL;MyClass*(*create)();void(*destroy)(MyClass*);char*error;lib_handle=dlopen("./libshared.so",RTLD_LAZY);if(lib_handle==NULL){fprintf(stderr,"%s\n",dlerror());exit(1);}create=(MyClass*(*)())dlsym(lib_handle,"create_object");if((
我正在尝试让代码(见下文)在Ubuntu上运行。该代码使用clock_gettime()。我想我已经成功链接到librt.a:****BuildofconfigurationDebugforprojecttest****make-kallBuildingfile:../src/test.cppInvoking:IntelIntel(R)64C++Compilericpc-g-I/usr/include/boost-std=c++0x-MMD-MP-MF"src/test.d"-MT"src/test.d"-c-o"src/test.o""../src/test.cpp"Finished
我是posix线程库的新手,我尝试使用以下教程编译示例代码:g++-lpthreadagreement.cpp-oagreement但是我无法编译代码并收到以下错误消息:a3q2.cpp:(.text+0x7e):undefinedreferenceto`sem_open'a3q2.cpp:(.text+0xab):undefinedreferenceto`sem_wait'a3q2.cpp:(.text+0x290):undefinedreferenceto`sem_post'a3q2.cpp:(.text+0x2af):undefinedreferenceto`sem_close'
操作系统:Linux我正在尝试链接mips64-softmmu/qemu-system-mips64但它导致错误:./slirp/misc.o:Infunction`memset':/usr/include/bits/string3.h:81:warning:memsetusedwithconstantzerolengthparameter;thiscouldbeduetotransposedparameters/usr/bin/ld:../qemu-timer.o:undefinedreferencetosymbol'timer_settime@@GLIBC_2.3.3'/usr/b
我有一个程序foo可以通过dlopen()加载插件。我正在编写一个这样的插件foobar,它可以连接第三方库libfoo提供的功能。在Linux上,我正在像这样构建foobar:gcc-fpic-c-ofoobar.ofoobar.cgcc-fpic-shared-ofoobar.sofoobar.o-lbar到目前为止一切顺利。问题是这不会检测undefinedsymbol,例如由于代码中的错误或头文件和库之间的不匹配。链接成功,您只会在稍后加载插件或调用插件中的某些内容时遇到错误(取决于dlopen()标志)。要检测共享库中的undefinedsymbol,通常会使用-Wl,-z,