草庐IT

references

全部标签

c++ - 与 libcrypto : undefined reference to `__imp__CertFreeCertificateContext' 的链接问题

我正在尝试交叉编译cachecoin使用gitian的Linux主机上的二进制文件和i686-w64-mingw用于Windows目标。编译工作正常,直到依赖项的静态链接的最后一步。这是我得到的:/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x1ff):undefinedreferenceto`__imp__CertFreeCertificateContext@4'Google建议它缺少-lcrypto链接甚至-lcrypt32。但是在它失败之前的最后一行中,您可以看到它正在链接两者。这里有什么问题?

c++ - 没有优化的 g++ 4.9 上静态 constexpr 的 undefined reference

我有以下代码:#include#includeusingnamespacestd::chrono_literals;#defineMSG"hello"#defineDUR1000msclassmwe{public:staticconstexprautomsg=MSG;staticconstexprautodur_1=DUR;staticconstexprstd::chrono::millisecondsdur_2=DUR;staticconststd::chrono::millisecondsdur_3;staticconstexprdecltype(DUR)dur_4=DUR;};c

c++ - add_lvalue_reference/add_rvalue_reference 和 cv 限定类型

cppreference.com关于std::add_lvalue_reference/std::add_rvalue_reference:IfTisanobjecttypeorafunctiontypethathasnocv-orref-qualifier,providesamembertypedeftypewhichisT&&,otherwisetypeisT.这是否意味着如果T是const或volatile则T不会转换为引用?如果不是,那么“没有cv限定符”是什么意思。 最佳答案 DoesitmeanthatifTiscons

c++ - 链接错误 : undefined reference to EVP_CIPHER_CTX_ and EVP_CIPHER_CTX_init

我在我的代码中使用了crypto++。我不想使用它的依赖项,所以我尝试在我的文件夹中导入crypto++文件并将它们包含在我的.cpp文件中我有以下错误:TEST.cpp:(.text+0x89a0):undefinedreferenceto`EVP_CIPHER_CTX_init'TEST.cpp:(.text+0x8cb0):undefinedreferenceto`EVP_aes_128_cbc'TEST.cpp:(.text+0x8cdd):undefinedreferenceto`EVP_CipherInit_ex'TEST.cpp:(.text+0x8d49):undefi

c++ - 内联函数中的 undefined reference ,用一元 + 解决

我在启用c++11时遇到一个奇怪的gcc4.7问题:当我想编译这个时:constexprunsignedintgetDim(constinte){return(e==1)?A::Set::Dimension:((e==2)?B::Set::Dimension:((e==3)?C::Set::Dimension:(+D::Set::Dimension)));}其中对于每个结构A,B,C,D定义了Set的typedef,其中相关的Set有一个intDimension,例如structSetOne{staticconstintDimension=1;}structA{typedefSetOn

c++ - GLEW 和 glfw 编译错误 : undefined reference to symbol 'XConvertSelection'

我正在尝试编译这段代码:#include#include#include#includeGLFWwindow*window;#includeusingnamespaceglm;intmain(void){//InitialiseGLFWif(!glfwInit()){fprintf(stderr,"FailedtoinitializeGLFW\n");return-1;}glfwWindowHint(GLFW_SAMPLES,4);glfwWindowHint(GLFW_RESIZABLE,GL_FALSE);glfwWindowHint(GLFW_CONTEXT_VERSION_MA

c++ - 转到特定页面后,如何将SwipeView的currentIndex设置为TabBar的currentIndex "by reference"?

我开始使用QtQuickControls2.0。我有使用C++的经验和少量的Qt经验,但我以前没有使用过QML。我有一个TabBar和一个SwipeView相互链接。我的意思是,当您在TabBar上选择一个页面时,SwipeView会转到该页面。当您从SwipeView滑动到一个页面时,TabBar会自行更新以反射(reflect)这一点。作为学习练习,我决定创建一个将用户转到第二页的按钮。问题是我似乎无法找到一种方法来做到这一点而不会弄乱TabBar和SwipeView之间的链接。下面的代码是我想出的最好的。它正确转到第二页,当我使用TabBar更改当前页面时,SwipeView仍会

c++ - std::reference_wrapper *this 周围

我有一个场景,我需要转换一个可以被*this链接的函数返回std::optional>而不是T&(原因超出了这个问题的范围)。我使用std::reference_wrapper的原因是因为std::optional不能引用,至少在C++11中不能。但是,这不起作用,因为我似乎遇到了终身问题。这是一个最小的例子:#include#includestructtest{std::reference_wrapperfoo(){val=42;return*this;}test&foo2(){val=50;return*this;}intval;};voidbar(testt){std::cout

c++ - Google 使用 SetUpTestCase 静态变量测试 undefined reference

我正在编写一个测试用例,它将有一个SetUpTestCase()方法,尽管我收到undefinedreference链接器错误,但该方法将分配一个共享资源。classParsingEventsTest:public::testing::Test{protected:staticxmleventXml;staticvoidSetUpTestCase(){ManagedObjectManagerSingleton::GET_SINGLETON().initializeTestEnvironment(PATH_TO_FILE);eventXml=*ManagerSingleton::GET_

c++ - gtest,对 'testing::Test::~Test()' 的 undefined reference ,testing::Test::Test()

我使用apt-getinstalllibgtest-dev安装了gtest我正在尝试检查它是否有效。所以我在eclipse中编写了简单的测试代码。但是有错误,undefinedreferenceto'testing::Test::~Test()'undefinedreferenceto'testing::Test::Test()'相反,如果我将ATest类的继承更改为protected,错误就会消失,但是出现其他错误testing::Testisinaccessiblebaseof'ATest_AAA_Test'怎么了?#include#includeclassA{public:int