草庐IT

reference-source

全部标签

linux - 附加到/etc/apt/sources.list

我正在创建一些脚本来简化应用程序安装,我需要附加到/etc/apt/sources.list的末尾下面的代码附加到~但不附加到/etc/apt/中的文件echo"debhttp://ppa.launchpad.net/person/ppa/ubuntukarmicmain">>/etc/apt/sources.list@meder我尝试了以下命令但没有成功:sudoecho"debhttp://ppa.launchpad.net/person/ppa/ubuntukarmicmain">>/etc/apt/sources.list#===---sudosh"echo'debhttp:/

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 - "Source file is more recent than executable"除了它不是

GDB提示说我的源文件比可执行文件更新,调试信息似乎确实与源文件的旧版本有关,因为gdb在空白行停止:ProgramreceivedsignalSIGSEGV,Segmentationfault.0x0000000000000000in??()(gdb)up#10x00007ffff7ba2d88inCBKeyPairGenerate(keyPair=0x602010)atlibrary/src/CBHDKeys.c:246warning:Sourcefileismorerecentthanexecutable.246(gdb)list241if(versionBytes==CB_HD

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

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

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

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

linux - : ". [script]" or "source [script]", "bash [script] or $SHELL [script]"和 "./[script]"或 "[script]"有什么区别?

我知道source和.做同样的事情,如果标题中的其他命令对不一样,我会感到惊讶事情(因为我正在运行bash作为我的shell,$SHELL[script]和bash[script]是等价的,对吧??)。那么这三种执行脚本的方法有什么区别呢?我问是因为我刚刚了解到采购脚本是NOTtheexactsame作为执行它。在运行我的“实验”和阅读手册页时我没有发现明显的方式。通过在我编写的非常简单的脚本上盲目调用这些函数,我无法发现其他哪些细微差别?阅读上面链接的答案后,我可以强烈猜测我的问题的答案将是一个非常简单的解释,但以一种我自己几乎从未完全发现的方式。这是我做的“实验”:$.myScri

c++ - Gcc 编译 Boost::regex 存在多个版本的 boost 时 undefined reference

我试图在linux机器上安装Boost(CentOs,Linux版本2.6.9-67.ELsmp)。我遵循了关于BoostGettingStarted的说明网页。下载并提取文件,然后添加前缀,因为我不是root用户。./bootstrap.sh--prefix=/my_path/boost-1.49.0./b2install我转到/my_path/boost-1.49.0并检查那里有/include/boost/和/lib/包含文件。我还将LD_LIBRARY_PATH设置为/my_path/boost-1.49.0/lib/。为了测试我是否安装成功,我编译了下面的代码:主要.cpp#