我尝试使用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 ++库的存储库并使其工作.嗯,这不是我的情况.
我有一个问题,从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)?