草庐IT

fcatch-undefined-behavior

全部标签

c++ - openGL 3 问题 : undefined reference to _glapi_tls_Dispatch

我正在尝试从http://open.gl/introduction编译一个简单的测试程序:#include#includeintmain(){glfwInit();std::this_thread::sleep_for(std::chrono::seconds(1));glfwTerminate();}我使用以下编译:>>g++-ctutorial01.cpp-otutorial01.o-std=c++11>>g++tutorial01.o-otutorial01-lglfw3-lGL-lXrandr-lX11-lXi-lGLEW/usr/lib/gcc/x86_64-linux-gn

c++ - 在 Linux 中测试外部 undefined reference

是否有内置的linux实用程序可用于测试新编译的共享库是否存在外部undefinedreference?Gcc似乎足够智能,可以在我自己的二进制文件中检查undefinedsymbol,但是如果该符号是对另一个库的引用,gcc不会在链接时进行检查。相反,我只有在尝试从另一个程序链接到我的新库时才会收到消息。当我编译一个不同的项目时,在库中获取undefinedreference消息似乎有点傻,所以我想知道我是否可以在构建库时而不是在链接到时检查所有内部和外部引用示例错误:make-CUnitTestsdebugmake[1]:Enteringdirectory`~/projects/F

linux - 内核模块中的 EXPORT_SYMBOL | insmod 期间的 undefined symbol

我有一个来自a.ko(内核模块)的导出函数foo()和foo1(),foo1()接受输入参数,一个函数指针。我从b.ko调用foo1(),并将foo()作为输入参数传递。我看到b.ko(未知符号foo)的insmod失败,即使a.ko在b.ko之前被insmod。任何解释/解决方案?谢谢,幸运 最佳答案 有两种方法可以解决这个问题,1)在同一个Makefile中编译两个内核模块,即objs-m:=a.ob.o.2)在将使用导出函数或变量的内核模块的Makefile中包含**KBUILD_EXTRA_SYMBOLS=。

c++ - 向项目添加类后对 'main' 的 undefined reference

我在使用代码块编写的项目时遇到问题。我制作了新的控制台应用程序并构建了它。但是当我添加一个新类C::B时会抛出一个错误:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o||Infunction`_start':(.text+0x20)||undefinedreferenceto`main'不知道怎么回事main.cpp#include#include"display.h"intmain(){DisplaynewDisplay;std::cout显示.cpp#include"display.h"#incl

python : undefined symbol: PyUnicodeUCS2_DecodeUTF8

当我尝试在python中执行我的主文件时遇到问题(我在Ubuntu12.04和python2.7上)。我收到此错误:michael@michael-laptop-ubuntu:~/rubyWorkSpace/pymcs$python__main__.pyTraceback(mostrecentcalllast):File"__main__.py",line9,insys.exit(main())File"__main__.py",line5,inmainimportlaunchFile"/home/michael/rubyWorkSpace/pymcs/launch.py",line2

linux - bcrypt_lib.node : undefined symbol: node_module_register

Error:/home/george/Desktop/myProject/node_modules/bcrypt/build/Release/bcrypt_lib.node:undefinedsymbol:node_module_registeratModule.load(module.js:356:32)atFunction.Module._load(module.js:312:12)atModule.require(module.js:364:17)atrequire(module.js:380:17)atbindings(/home/george/Desktop/myProjec

c++ - Linux 生成文件中的 undefined reference

我想在linux下构建我的应用程序,但我无法让我的makefile来创建它。问题是我想链接的静态库。我收到很多“undefinedreference”错误消息,例如:undefinedreferenceto`std::basic_string,std::allocator>::~basic_string()'或undefinedreferenceto`cgicc::Cgicc::Cgicc(cgicc::CgiInput*)'这是我的生成文件:CXX=gccINCL_CGICC=../cgicc-3.2.9INCL_OPENSSL=../openssl-1.0.0e/includeIN

c - 对 `GlewInit' 的 undefined reference - OpenGL

我在尝试制作可执行文件时收到此错误,代码编译正确,但当我点击make命令时,我收到此错误消息:gcc-chelloworld.clewis@lewis-desktop~/Desktop/Dev/gl$makegcc-ohello-glhelloworld.o-L/usr/X11R6/lib-lGL-lglut-lGLEW-lmhelloworld.o:Infunction`Initialize':helloworld.c:(.text+0x55):undefinedreferenceto`GlewInit'collect2:ldreturned1exitstatusmake:***[h

c - 使用 gcc 编译一个显示 "undefined reference to ` 中止的项目'”

我写了一个使用va_list/va_arg/va_start/va_end/va_arg的printfmyselef。typedefchar*va_list;#define_AUPBND(sizeof(acpi_native_int)-1)#define_ADNBND(sizeof(acpi_native_int)-1)#define_bnd(X,bnd)(((sizeof(X))+(bnd))&(~(bnd)))#defineva_arg(ap,T)(*(T*)(((ap)+=(_bnd(T,_AUPBND)))-(_bnd(T,_ADNBND))))#defineva_end(ap

c - 奇怪的链接行为和 undefined symbol

我正在链接一个外部库(通过奇怪的过程,mpicc+Cython+等),但是我有一个链接过程的奇怪行为。有两个.o文件,libpetsc4py.o和PETSc.o它们链接到.so文件PETSc.so一个包含undefinedsymbol__pyx_tp_new_8petsc4py_5PETSc_Object[zheltkov@compiler-2src]$nmlibpetsc4py.o|grep__pyx_tp_new_8petsc4py_5PETSc_ObjectU__pyx_tp_new_8petsc4py_5PETSc_Object在另一个.o文件中定义:[zheltkov@com