Use STLport in Ubuntu

Source: Internet
Author: User
After reading a lot of articles, after compiling and installing stlport, you will always be prompted that the header file cannot be found, or the library cannot be linked, and so on. I am worried that I have performed this operation according to my own documents today, it's amazing. The actual is very simple, the steps are as follows: Enter the stlport directory, cdstlport/build/libmake-fgcc.makdependmake-fgcc.makinstall and then you can use it, do not need to include usr/local

After reading a lot of articles, after compiling and installing stlport, you will always be prompted that the header file cannot be found, or the library cannot be linked, and so on. I am worried that I have performed this operation according to my own documents today, it's amazing.

The procedure is as follows:

Enter the stlport directory, cd stlport/build/lib

Make-f gcc. mak depend

Make-f gcc. mak install

Then you can use it without the need to include. the lib directory may be running make-f gcc. mak install has been added to the environment variable, and I do not know whether there is any concept of the environment variable in Linux.

  1. # Include
  2. # Include
  3. IntMain ()
  4. {
  5. Std: vector <Int> V1;
  6. V1.push _ back (0 );
  7. Printf ("The first element of vector is % d \ n", V1 [0]);
  8. Return0;
  9. }

Www.linuxidc.com @ Ubuntu :~ /Project $ g ++-g-o use_stl use_stl.cpp

Www.linuxidc.com @ ubuntu :~ /Project $./use_stl

The first element of vector is 0

Sorry, it turned out to be so simple. It took a lot of effort before. In fact, you can simply follow the document. Hey, remember!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.