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

Explanation on using STLport under Ubuntu

WBOY
Release: 2024-01-08 08:06:10
forward
972 people have browsed it

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!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template