D
Dave
Hi,
I need to use Botan C++ library in my project.
But I m having trouble with finding the header file.
The botan library and its header files are already installed in
/usr/local/lib and /usr/local/include.
I got the following error when compiling it in FreeBSD 5.4:
make -f Makefile
c++ -I/usr/local/include -c auth.cpp -o auth.o
auth.cpp: In constructor `Auth::Auth()':
auth.cpp:8: error: `PK_Encrypt' undeclared (first use this function)
auth.cpp:8: error: (Each undeclared identifier is reported only once for
each function it appears in.)
auth.cpp:8: error: `rsa_enc1' undeclared (first use this function)
auth.cpp:8: error: invalid initialization of reference of type 'const
Botan:
K_Encrypting_Key&' from expression of type 'std::string'
/usr/local/include/botan/look_pk.h:16: error: in passing argument 1 of
`Botan:
K_Encryptor* Botan::get_pk_encryptor(const
Botan:
K_Encrypting_Key&, const std::string&)'
*** Error code 1
Please see the following files for detail:
Makefile:
CC = c++
CXXFLAGS = -O -pipe -W -Wall -Wpointer-arith
INCS = -I/usr/local/include
LIBS = /usr/local/lib/libbotan.a
OBJS = auth.o auth_main.o
PROGS = wkey
all: ${PROGS}
wkey: ${OBJS} ${LIBS} uth.hh
${CC} ${CXXFLAGS} -o $@ ${OBJS} ${LIBS} ${INCS}
auth.o: auth.cpp
$(CC) $(INCS) -c $< -o $@
auth_main.o: auth_main.cpp
$(CC) $(INCS) -c $< -o $@
clean:
rm -f ${PROGS} *.o *.core
auth.hh:
#ifndef __AUTH__
#define __AUTH__
#include <iostream>
#include <string>
#include <fstream>
#include "botan/pubkey.h"
#include "botan/dsa.h"
#include "botan/rsa.h"
#include "botan/dh.h"
#include "botan/pkcs8.h"
#include "botan/look_pk.h"
#include "botan/rng.h"
#include "botan/filters.h"
using namespace Botan;
using namespace Botan_types;
using namespace std;
class Auth
{
public:
Auth();
~Auth() {};
private:
};
#endif
auth.cpp:
#include "auth.hh"
Auth::Auth()
{
string rsakey = "skjfksajfsakej99dae3";
PK_Encrypt *rsa_enc1 = get_pk_encryptor(rsakey, "EME1(RIPEMD-160)");
}
auth_main.cpp:
#include "auth.hh"
int main()
{
Auth auth;
}
I need to use Botan C++ library in my project.
But I m having trouble with finding the header file.
The botan library and its header files are already installed in
/usr/local/lib and /usr/local/include.
I got the following error when compiling it in FreeBSD 5.4:
make -f Makefile
c++ -I/usr/local/include -c auth.cpp -o auth.o
auth.cpp: In constructor `Auth::Auth()':
auth.cpp:8: error: `PK_Encrypt' undeclared (first use this function)
auth.cpp:8: error: (Each undeclared identifier is reported only once for
each function it appears in.)
auth.cpp:8: error: `rsa_enc1' undeclared (first use this function)
auth.cpp:8: error: invalid initialization of reference of type 'const
Botan:
/usr/local/include/botan/look_pk.h:16: error: in passing argument 1 of
`Botan:
Botan:
*** Error code 1
Please see the following files for detail:
Makefile:
CC = c++
CXXFLAGS = -O -pipe -W -Wall -Wpointer-arith
INCS = -I/usr/local/include
LIBS = /usr/local/lib/libbotan.a
OBJS = auth.o auth_main.o
PROGS = wkey
all: ${PROGS}
wkey: ${OBJS} ${LIBS} uth.hh
${CC} ${CXXFLAGS} -o $@ ${OBJS} ${LIBS} ${INCS}
auth.o: auth.cpp
$(CC) $(INCS) -c $< -o $@
auth_main.o: auth_main.cpp
$(CC) $(INCS) -c $< -o $@
clean:
rm -f ${PROGS} *.o *.core
auth.hh:
#ifndef __AUTH__
#define __AUTH__
#include <iostream>
#include <string>
#include <fstream>
#include "botan/pubkey.h"
#include "botan/dsa.h"
#include "botan/rsa.h"
#include "botan/dh.h"
#include "botan/pkcs8.h"
#include "botan/look_pk.h"
#include "botan/rng.h"
#include "botan/filters.h"
using namespace Botan;
using namespace Botan_types;
using namespace std;
class Auth
{
public:
Auth();
~Auth() {};
private:
};
#endif
auth.cpp:
#include "auth.hh"
Auth::Auth()
{
string rsakey = "skjfksajfsakej99dae3";
PK_Encrypt *rsa_enc1 = get_pk_encryptor(rsakey, "EME1(RIPEMD-160)");
}
auth_main.cpp:
#include "auth.hh"
int main()
{
Auth auth;
}