Compilation error in files.cpp

19 views
Skip to first unread message

Sindhu Saripella

unread,
Feb 1, 2014, 1:11:31 PM2/1/14
to cryptop...@googlegroups.com
Hi,

I have been working on an assignment where I need to use cryptopp. I am facing a compilation error with files.cpp.

When I typr gnumake, it errors out while compiling files.cpp.

Kindly, please show me where am I wrong and what changes can I make to correct it.

The error details are:

files.cpp: In method `size_t CryptoPP::FileStore::CopyRangeTo2(CryptoPP::BufferedTransformation &, lword &, long long unsigned int = CryptoPP::LWORD_MAX, const string & = CryptoPP::DEFAULT_CHANNEL, bool = true) const':
files.cpp:123: `char_traits' undeclared (first use this function)
files.cpp:123: (Each undeclared identifier is reported only once
files.cpp:123: for each function it appears in.)
files.cpp:123: parse error before `>'
files.cpp:128: `blockedBytes' undeclared (first use this function)
files.cpp:131: confused by earlier errors, bailing out
gnumake: *** [files.o] Error 1

Thank you.

-SS

David Irvine

unread,
Feb 1, 2014, 1:15:55 PM2/1/14
to Sindhu Saripella, Crypto++ Users

On Sat, Feb 1, 2014 at 6:11 PM, Sindhu Saripella <sindh...@gmail.com> wrote:

When I typr gnumake, it errors out while compiling files.cpp.

can you post the actual command you type. 

If you are on linux or osx then I think make is all you need do in the unzipped sources directory. It looks like somehow you maybe are typing gcc instead of g++ or something. 

so
1: mkdir cryptopp (or whatever)
2: cd cryptopp
3: unizip cryptopp... 
4: make
5: chill for few mins
6: ./crypttest.exe v (to check all is well)

hope this helps




--

David Irvine
maidsafe.net 
twitter: @metaquestions

Sindhu Saripella

unread,
Feb 1, 2014, 1:23:19 PM2/1/14
to cryptop...@googlegroups.com, Sindhu Saripella
Hi David,

I'm on SunOS.

I did do the below steps only, still ....

1: mkdir cryptopp (or whatever)
2: cd cryptopp
3: unizip -a cryptopp...
4: gnumake
5: chill for few mins

> got the error at this stage.


The lines in the Code:
123:
                if (result == char_traits<char>::eof())

124:
                        return 0;

-SS

David Irvine

unread,
Feb 1, 2014, 1:26:01 PM2/1/14
to Sindhu Saripella, Crypto++ Users
Can you tell us the compiler you are using and the version. If you look in the GnuMakefile you will see the settings for Sun I think. I do not have a terminal just now. 


--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-user...@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cryptopp-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sindhu Saripella

unread,
Feb 1, 2014, 1:52:07 PM2/1/14
to cryptop...@googlegroups.com
Hi David,

These are the lines I see if I search for relevant keywords in the Makefile. 
I've attached it in text format as well. 

in the makefile, there is a g++ -v 2>&1 | grep -c "<text>" command.

g++ -v gives me:
Reading specs from /pkg/gnu/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/specs
gcc version 2.95.2 19991024 (release)

(I don't know what to make of 2>&1.)

So, I think "g++" is being used. Do I check the command line arguements also being given to it?

David Irvine

unread,
Feb 1, 2014, 1:57:58 PM2/1/14
to Sindhu Saripella, Crypto++ Users

On Sat, Feb 1, 2014 at 6:52 PM, Sindhu Saripella <sindh...@gmail.com> wrote:
(I don't know what to make of 2>&1.)

That just means redirect stderr (2) via stdio (1) 

It's trying to check the version of g++ you are using. 

I am not sure how much I can help here, seems if you simply type make then there is something wrong with the script or perhaps compiler issue.

perhaps typing the following will help 
  make VERBOSE=1
This will make the output very verbose and you should see there what exactly each file is being compiled with. You can then copy this and alter bits until a file compiles. From there you can alter the makefile to suit. 

Sorry chap, this is the easiest way I think, unless anyone else can spot a simpler 'fix'

Sindhu Saripella

unread,
Feb 1, 2014, 8:09:12 PM2/1/14
to David Irvine, Crypto++ Users
Hi David,
Thanks for the tip. Strangely VERBOSE=1 or =true is not adding any information.

But I can see the command being used to compile:
g++ -DNDEBUG -g -O2 -pipe -c files.cpp

< errors details same as before >

David Irvine

unread,
Feb 1, 2014, 8:22:16 PM2/1/14
to Sindhu Saripella, Crypto++ Users

On Sun, Feb 2, 2014 at 1:09 AM, Sindhu Saripella <sindh...@gmail.com> wrote:
g++ -DNDEBUG -g -O2 -pipe -c files.cpp

What happens if you type 
  g++ -DNDEBUG -g -O2 -pipe -I. -c files.cpp
That's an upper-case i to tell teh compiler to include the current dir as an include location. Rather than a simple . it may be better to type in the complete path 
  g++ -DNDEBUG -g -O2 -pipe -I<path to current dir> -c files.cpp

See if this actually compiles that single file. If so then you can adjust the makefile, it seems to me though something much simpler is wrong, but I cannot see it from here :-) 

Marshall Clow

unread,
Feb 3, 2014, 12:15:08 AM2/3/14
to Sindhu Saripella, cryptop...@googlegroups.com

On Feb 1, 2014, at 10:52 AM, Sindhu Saripella <sindh...@gmail.com> wrote:

Hi David,

These are the lines I see if I search for relevant keywords in the Makefile. 
I've attached it in text format as well. 

in the makefile, there is a g++ -v 2>&1 | grep -c "<text>" command.

g++ -v gives me:
Reading specs from /pkg/gnu/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/specs
gcc version 2.95.2 19991024 (release)

GCC 2.95.2 was released on October 27, 1999 - coming up on 15 years ago.
I’m not really that surprised that Crypto++ fails to compile.

— Marshall

David Irvine

unread,
Feb 3, 2014, 3:00:26 AM2/3/14
to Marshall Clow, Sindhu Saripella, Crypto++ Users

On Mon, Feb 3, 2014 at 5:15 AM, Marshall Clow <mclow...@gmail.com> wrote:
GCC 2.95.2 was released on October 27, 1999 - coming up on 15 years ago.
I’m not really that surprised that Crypto++ fails to compile.

Well spotted Marshal, I never even noticed that, good catch!
Reply all
Reply to author
Forward
0 new messages