Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio 2005 compile error #496

Closed
yr-github opened this issue Sep 13, 2017 · 5 comments
Closed

Visual Studio 2005 compile error #496

yr-github opened this issue Sep 13, 2017 · 5 comments

Comments

@yr-github
Copy link

yr-github commented Sep 13, 2017

I use Visual Studio 2005 to compile cryptlib.lib. There have two errors:

.\integer.cpp(2986) : error C2039: 'make_checked_array_iterator' : is not a member of 'stdext'
.\integer.cpp(2986) : error C3861: 'make_checked_array_iterator': identifier not found

My environment is:

  • Windows 7
  • cryptopp 5.6.5
  • Microsoft Visual Studio 2005 8.0.50727.42 (RTM.050727-4200)

How can i fix it?

@noloader noloader changed the title vs 2005 complate error Visual Studio 2005 compile error Sep 13, 2017
@noloader
Copy link
Collaborator

noloader commented Sep 13, 2017

I seem to recall there was an open question about when checked iterators and make_checked_array_iterator arrived. It was sometime around VS2005 SP1 and VS2008.

To fix it, navigate to integer.cpp : 2986, and make the following change:

OLD (notice version 140050727):

#if (_MSC_FULL_VER >= 140050727)
    std::reverse_copy(encodedInteger, encodedInteger+byteCount,
        stdext::make_checked_array_iterator(block.begin(), block.size()));
#else
    std::reverse_copy(encodedInteger, encodedInteger+byteCount, block.begin());
#endif

NEW (use VS2008 SP1 instead of VS2005):

#if (_MSC_FULL_VER >= 150030729)
    std::reverse_copy(encodedInteger, encodedInteger+byteCount,
        stdext::make_checked_array_iterator(block.begin(), block.size()));
#else
    std::reverse_copy(encodedInteger, encodedInteger+byteCount, block.begin());
#endif

By the way, you might want to work from Master instead of the 5.6.5 ZIP.

noloader added a commit to noloader/cryptopp that referenced this issue Sep 13, 2017
…eidai11#496)"

This reverts commit 3b6e17b. The version in Master was correct. The 5.6.5 ZIP has the old, downlevel version.
@noloader
Copy link
Collaborator

noloader commented Sep 13, 2017

@adelewyr,

I backed out the change in the cited commit. Master is OK; the 5.6.5 ZIP was using the wrong version. This is what you want:

#if (_MSC_FULL_VER >= 140050727)
    std::reverse_copy(encodedInteger, encodedInteger+byteCount,
        stdext::make_checked_array_iterator(block.begin(), block.size()));
#else
    std::reverse_copy(encodedInteger, encodedInteger+byteCount, block.begin());
#endif

@yr-github
Copy link
Author

@noloader
thanks
I annotation that line ,and it works well .
i think this code is useless for me, because in my environment _MSC_FULL_VER <140050727 is certainly

noloader added a commit that referenced this issue Sep 13, 2017
)"

This reverts commit 3b6e17b. The version in Master was correct. The version the OP was using was incorrect.
@noloader
Copy link
Collaborator

noloader commented Sep 13, 2017

@adelewyr,

i think this code is useless for me, because in my environment _MSC_FULL_VER <140050727 is certainly

Yeah, it sounds like you are using Release To Manufacturing (RTM), and not Service Pack 1 (SP1).

If you need a quick/easy way to work with Git and GitHub on Windows, then consider Git on Windows at https://git-scm.com/downloads. You get the Git command line with other functionality like sed, grep and ssh.

Using the command line will allow you to easily work from Master. Master is mostly stable. We introduce an occasional break, but we try hard to keep it stable. The idea is at any point we should be able to build a release ZIP. If a user has a question, then they can always turn to Master and Master is as stable as a release ZIP.

@JanFellner
Copy link

I wanted to link this pretty old issue with a new one that arises out of the changes beeing made
#1250
VS 2022 17.8 seems not to really love the make_checked_array_iterator
As i have no deeper understanding about the changes made here and how to test them...
Maybe one of the authors of this change can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants