安装curlpp之后,我尝试编译使用curlpp库的c ++代码并得到以下错误:
g++ testCurl.cpp -lcurlpp
/usr/bin/ld: /tmp/ccx5aH5P.o: undefined reference to symbol 'curl_easy_setopt@@CURL_OPENSSL_3'
//usr/lib/x86_64-linux-gnu/libcurl.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
任何想法如何解决这一问题?
我首先尝试从源代码安装curlpp,但是在运行./config之后,我被告知我需要boost(这是一台新计算机,所以我还没有安装它).我安装了boost.然后我被告知我需要"卷曲的工作版本"或类似的东西.经过快速的互联网搜索,我发现我需要安装一些版本的libcurl-dev.特别是我安装了包:libcurl4-openssl-dev 7.35.0-1ubuntu2.2在此之后,curlpp编译安装没有问题.
最后,我使用了一些通用测试代码并尝试使用命令g ++ test.cpp -lcurlpp进行编译.这导致了上述错误.我尝试卸载curl和所有相关的东西并重新安装它.我还尝试安装一些备用的libcurl-dev实现.同样的错误.
我已经在网上寻找解决方案并尝试了其他一些方法.到目前为止,没有任何工作.
在此先感谢您的帮助!!
我在一些更大的代码中调试了一个问题,并且发现了一些关于智能指针及其多态属性的奇怪之处.通过简单的示例可以很好地看到这一点:
#include <iostream>
#include <memory>
using namespace std;
class A {
public:
virtual void who() {cout << "I am class A" << endl; };
};
class B : public A{
public:
void who() {cout << "I am class B" << endl; };
};
int main(int argc, char *argv[])
{
B b;
A * aptr = &b;
aptr->who(); //Output: I am class B
B * bptr = &b;
bptr->who(); //Output: I am class B
shared_ptr<A> sptr;
sptr = make_shared<A>(b);
sptr->who(); //Output: …Run Code Online (Sandbox Code Playgroud) Emacs尝试使用其注释函数变得聪明,以便空白的行不会获得注释前缀.是否有一种简单的内置方式可以确保在我调用类似内容时所有行(空白或不空白)都会被注释comment-region?所以,如果我有这个代码:
Comment comment comment
More comments more comments
Run Code Online (Sandbox Code Playgroud)
假设注释前缀是//,我希望能够选择该区域,并使注释看起来像:
// Comment comment comment
//
// More comments more comments
Run Code Online (Sandbox Code Playgroud)
是的,我可以编写一个自定义函数来执行此操作,但它看起来像基本的足够的行为,它可能以某种方式内置.