how to specify the libstdc++.so.6 to use

2,455

Installing gcc puts a libstdc++.so.6 into both $PREXIF/lib and $PREFIX/lib64. Using the latter as RPATH for boost and my program solved the issue. Using only the former results in a fall-back to the system libstdc++.so.6.

Share:
2,455

Related videos on Youtube

user1766270
Author by

user1766270

Updated on September 18, 2022

Comments

  • user1766270
    user1766270 over 1 year

    how can I print this to an output file and calculate sum and average of these peoples salaries by week and by overall weeks for 4 weeks...

    example txt file..

    doe       jane
    williams  tom
    lons      adams
    
     45.7   56.3   345.6  344.7  // week 1
     43.6   89.0   543.6  12.5   // week 1  person 2
     90.5   78.0  345.4  345.6  //week 1 person 3
     67.5   34.5   56.6   34.5   // week2 person 1
      etc....for 4 weeks..
    

    I know there is an easier way by using loops can I get some help thanks :)

    this is what I have so far

    #include<iostream>
    #include<fstream>
    #include<cstdlib>
    #include<string>
    #include<iomanip>
    using namespace std;
    
    int main()
    {
    ifstream infile;
     ofstream outfile;
    
    double s1, s2, s3 , s4 ,s5;
    double t1, t2,t3,t4,t5;
    double w1, w2,w3,w4,w5;
    string personlast,personfirst,personlast2,personfirst2,personlast3,personfirst3;
    double sum, average;
    int numberpeople, numberofweeks;
    
    infile.open("data.txt");
    outfile.open("output.txt");
    
    outfile<< fixed<< showpoint;
    outfile<< setprecision(2);
    
    infile>> numberpeople >> personlast >> personfirst >> personlast2 >> personfirst2>>
      personlast3 >> personfirst3 >> numberofweeks;
    outfile<< " The number of salespeople are " << numberpeople <<"they are" <<
    personlast << personfirst << "and " <<
     personlast2 << personfirst2 <<
     "and " << personlast3 << personfirst3 <<"Number of weeks = " << numberofweeks;
    
    
    infile>> s1 >> s2 >> s3 >> s4 >> s5;
    outfile <<" sales for week 1  "<< " for" << personlast << personfirst << s1 << s2
    << s3 << s4 << s5 << endl;
    sum= s1+s2+s3+s4+s5;
     outfile <<"Sum of first week is " << sum<<endl;
    
    infile >> t1 >> t2 >> t3 >> t4 >> t5;
    outfile <<" sales for week 1  "<< " for" << personlast2 << personfirst2 << t1 << t2 
    << t3 << t4 << t5 <<endl;
    
    
    
    infile.close();
    outfile.close();
    return 0;
    
    • jma127
      jma127 over 11 years
      It might help to state what each number within a row represents.
    • Basile Starynkevitch
      Basile Starynkevitch over 11 years
      Why don't you use std::vector-s? With for loops?
    • evanmcdonnal
      evanmcdonnal over 11 years
      @BasileStarynkevitch 20 rep says it's for c++ class and you can't use std::vector
    • user1766270
      user1766270 over 11 years
      I am very big noob so I do not understand what is std vector is or how it works..
    • user1766270
      user1766270 over 11 years
      I need some tutoring willing to pay $20 for an hours worth of C++ help via email...
    • user1766270
      user1766270 over 11 years
      @BasileStarynkevitch..would you be willing to tutor via email.thanks
    • Alen Milakovic
      Alen Milakovic almost 10 years
      What distribution, please?
    • janoliver
      janoliver almost 10 years
      Some old CentOS with Linux 2.6.18. I do not have root access.
    • vfbsilva
      vfbsilva almost 10 years
    • janoliver
      janoliver almost 10 years
      @vfbsilva: As you can see, I am using the rpath way of specifying the lib directory - doesn't work. Executing my program with LD_LIBRARY_PATH=/secured/local/lib also doesn't work.
    • vfbsilva
      vfbsilva almost 10 years
      @janoliver strange, does your user has access rights over the library folder?
    • janoliver
      janoliver almost 10 years
      What do you mean? I can read /usr/lib(64), and write to /secured/local.
  • user1766270
    user1766270 over 11 years
    @evanmcdonnal....would you consider tutoring me tonight via email.. i would be willing to pay you $20 for an hour for your time..
  • user1766270
    user1766270 over 11 years
    thanks for the bit of code :) but..I need further explanation on what you mean..Like I mentioned would really appreciate some tutoring if you are available tonight.
  • evanmcdonnal
    evanmcdonnal over 11 years
    @user1766270 Start by writing some code to read the file line by line using a loop. If you make some progress and edit your post I'll provide further help. Take a look at this to get a start cplusplus.com/doc/tutorial/files