我不能为我的生活出了什么问题“类”在这里有一个先前的声明
我的生成文件:
all: main.o rsa.o
g++ -Wall -o main bin/main.o bin/rsa.o -lcrypto
main.o: src/main.cpp inc/rsa.h
g++ -Wall -c src/main.cpp -o bin/main.o -I inc
rsa.o: src/rsa.cpp inc/rsa.h
g++ -Wall -c src/rsa.cpp -o bin/rsa.o -I inc
我的主类:
#include <iostream>
#include <stdio.h>
#include "rsa.h"
using namespace std;
int main()
{
//RSA rsa;
return 0;
}
我的.cpp:
#include "rsa.h"
#include <iostream>
using namespace std;
RSA::RSA(){}
我的.h:
#ifndef RSA_H
#define RSA_H
class RSA
{
RSA();
};
#endif
,我发现了以下错误:
In file included from src/main.cpp:7:0:
inc/rsa.h:7:7: error: using typedef-name ‘RSA’ after ‘class’
/usr/include/openssl/ossl_typ.h:140:23: error: ‘RSA’ has a previous declaration here
我觉得我已经尝试了一切,但我坚持。有任何想法吗?