can't find third-party C++ library

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::pK_Encrypting_Key&' from expression of type 'std::string'
/usr/local/include/botan/look_pk.h:16: error: in passing argument 1 of
`Botan::pK_Encryptor* Botan::get_pk_encryptor(const
Botan::pK_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;
}
 
R

Rapscallion

Dave said:
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: `rsa_enc1' undeclared (first use this function)

You either did not include the right header file or you forgot a
namespace directive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top