Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3432342
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:26:14+00:00 2026-05-18T07:26:14+00:00

The project holding the code has all default MSVS2008 settings. Consider the following code

  • 0

The project holding the code has all default MSVS2008 settings.

Consider the following code using which I am familiarizing myself with various offerings of STL:

#include <vector>
#include <iostream>
#include <numeric>

using namespace std;


template <class T> void print(const vector<T>& l)
{  // A generic print function for vectors
    cout << endl << "PV Size of vector is " << l.size() << "\n[";
    for(int i = 0; i < l.size(); i++)
    {
        cout<<l[i]<<",";
    }
    cout << "]\n";
}


int main()
{
    vector<double> vec1(4, 2.0);
    vector<double> vec2(4, 4.0);
    double init = 0.0;
    double summation = accumulate(vec1.begin(), vec1.end(), init);
    cout<<"Summation = "<<summation<<", init is "<<init<<endl;

    double ip = inner_product(vec1.begin(), vec1.end(), vec2.begin(), init);
    cout<<"ip = "<<ip<<", init is "<<init<<endl;

    int size = 6;
    int seed_value = 2;
    vector<int> vec3(size, seed_value);
    vector<int> result(size);
    partial_sum(vec3.begin(), vec3.end(), result.begin());
    cout<<"The partial sum of vec3 is ";
    print(vec3);

    int sz = 10;
    int value = 2;
    vector<int> vec4(sz);
    for(int it = 0; it < vec4.size(); it++){
        vec4[it] = value;
        value++;
    }
    vector<int> result2(vec4.size());
    adjacent_difference(vec4.begin(), vec4.end(), result2.begin());
    cout<<"Adjacent differenec of vec4 is ";
    print(vec4);

    return(0);
}

The first time I try to run this (under Windows 7, Visual Studio 2008) I get the following error:

c:\programming\numeric_algorithms_on_vectors.cpp(86) : warning C4018: '<' : signed/unsigned mismatch

c:\programming\numeric_algorithms_on_vectors.cpp(37) : warning C4018: '<' : signed/unsigned mismatch

c:\programming\numeric_algorithms_on_vectors.cpp(81) : see reference to function template instantiation 'void print(const std::vector<_Ty> &)' being compiled

        with
        [
            _Ty=int
        ]

Linking...

numeric_algorithms_on_vectors.obj : fatal error LNK1000: Internal error during     IncrCalcPtrs
  Version 9.00.30729.01
  ExceptionCode            = C0000005
  ExceptionFlags           = 00000000
  ExceptionAddress         = 00E6B8C0 (00E10000) "C:\Program Files (x86)\Microsoft     Visual Studio 9.0\VC\bin\link.exe"
  NumberParameters         = 00000002
  ExceptionInformation[ 0] = 00000000
  ExceptionInformation[ 1] = 0000001C
CONTEXT:
  Eax    = 00000000  Esp    = 0042EAE8
  Ebx    = 3FFF0000  Ebp    = 0042EB04
  Ecx    = 77CB36FA  Esi    = 4000AF9C
  Edx    = 4000F774  Edi    = 00000000
  Eip    = 00E6B8C0  EFlags = 00010293
  SegCs  = 00000023  SegDs  = 0000002B
  SegSs  = 0000002B  SegEs  = 0000002B
  SegFs  = 00000053  SegGs  = 0000002B
  Dr0    = 00000000  Dr3    = 00000000
  Dr1    = 00000000  Dr6    = 00000000
  Dr2    = 00000000  Dr7    = 00000000

Yet, after clicking through the windows that tell me that my code did not compile/work properly, when I debug the same code again without making any changes to the code whatsoever, the program works. Is there a reason why the code would not compile/link/run the first time, yet run perfectly fine the next time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:26:15+00:00Added an answer on May 18, 2026 at 7:26 am

    This is a known problem in the linker for VS2008 SP1. Fixed in VS2010, the feedback report is here.

    I’ve seen this myself a few times, it only happens when it actually links incrementally. For me it always resolved itself by forcing a full build through Build + Rebuild so that the .ilk file is deleted and re-created. If that still doesn’t work for you then you can turn the feature off with Project + Properties, Linker, General, Enable Incremental Linking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working at the moment on a new project which has following requirement: Several
All, I had imported the source code for jbpm as a project in Eclipse.
I'm working on a project that will have a single table holding lots and
The project currently has a UIviewController called Dashboard that acts as the main view
My project is ARC enabled (the build settings have Objective-C Reference Counting set to
I have a Silverlight project in which I compile to both Silverlight 2 and
Why does the following code leak? for (var i = 0; i < 100;
I have a project where I am using Java RMI to make objects remotely
Moq has been driving me a bit crazy on my latest project. I recently
I am working on a project which includes an Android application which is used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.