小编GSP*_*ler的帖子

编译Ubuntu提供的Crypto ++

我尝试使用apt-get:安装Crypto ++ sudo apt-get install libcrypto++-dev libcrypto++-doc libcrypto++-utils.然后我尝试编译非常简单的程序,如:

#include <iostream>
#include "aes.h"
#include "modes.h"

using namespace std;
using namespace CryptoPP;

int main()
{
    cout << "Yo, man!" << endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

它导致了fatal error: aes.h: No such file or directory.

我是一个新的Ubuntu用户(Windows之前),所以我做了一些研究,但是大多数人说输入一个命令足以获得Crypto ++库的存储库并使其工作.嗯,这不是我的情况.

ubuntu compilation crypto++

8
推荐指数
1
解决办法
8942
查看次数

属性'Context'是F#中的静态错误

我有一个问题,从C#到F#重写Akka.Net演员:

public class Listener : ReceiveActor
{
    public Listener()
    {
        Receive<Messages.Shutdown>(s =>
        {
            Console.WriteLine($"shutdown {s.Duration}");
            Context.System.Terminate();
        });
    }
}
Run Code Online (Sandbox Code Playgroud)

Actor应该通过终止actor系统来处理Shutdown消息.我试图像这样重新实现它:

type Listener() =
    inherit ReceiveActor()
    do
        base.Receive<Messages>(fun m -> 
            match m with 
            | Shutdown(duration) -> 
                printf "shutdown %s" (duration.ToString())
                base.Context.System.Terminate()
                true
            | _ -> false)
Run Code Online (Sandbox Code Playgroud)

但是有一个补充错误在线base.Context.System.Terminate()Property 'Context' is static.这段代码有什么问题?为什么我不能访问基类的静态属性?是因为这段代码是lambda expresion(有趣)吗?或者因为它在构造函数中(do)?

c# f# static-members akka.net

1
推荐指数
1
解决办法
115
查看次数

标签 统计

akka.net ×1

c# ×1

compilation ×1

crypto++ ×1

f# ×1

static-members ×1

ubuntu ×1