Home >System Tutorial >LINUX >Explanation on using STLport under Ubuntu

Explanation on using STLport under Ubuntu

WBOY
WBOYforward
2024-01-08 08:06:10972browse

After reading a lot of articles, after compiling and installing stlport, there will always be a prompt that the header file cannot be found, or some library cannot be linked, which is very distressing. Today I followed the documentation that came with it, and it worked. , magical.

It’s actually very simple, the steps are as follows:

Enter the stlport directory, cd stlport/build/lib

make -f gcc.mak depend

make -f gcc.mak install

Then it can be used. There is no need to include the include.lib directory under usr/local. Maybe it has been added to the environment variables when executing make -f gcc.mak install. I don’t know if there is a concept of environment variables under Linux.

#include

#include

int main()

{

std::vector v1;

v1.push_back(0);

printf("the first element of vector is %d\n",v1[0]);

return 0;

}

www@Ubuntu:~/project$ g -g -o use_stl use_stl.cpp

www@ubuntu:~/project$ ./use_stl

the first element of vector is 0

Hey, it turns out to be so simple. I spent a lot of effort before. In fact, just follow the documentation. Hehe, remember!

The above is the detailed content of Explanation on using STLport under Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete