Compile jrtplib and jthread in Linux

Source: Internet
Author: User
Tags superuser permission

1. Download and decompress the SDK. Download jrtplib-3.7.1.tar.gzand jthread-1.2.1.tar.gz separately. Is:

Http://research.edm.uhasselt.be/jori/jrtplib/jrtplib-3.7.1.tar.gzand

Http://research.edm.uhasselt.be/jori/jthread/jthread-1.2.1.tar.gz

2. Place the source file in any directory as follows. Assume that the file is in the main directory:/home/jrtplib /. Decompress # tar-xzvf XXX and XXX respectively as the file name. After decompression there are two directories, one is the jrtplib-3.7.1, the other is the jthread-1.2.1. Install jthread first, and then install jrtplib. Here, ensure that the installation sequence is install jthread first.
Jrtplib.

3. install jthread: Enter the jthead decompression directory. First, run #. /configure configuration environment to generate the MAKEFILE file. If permission denied appears, we need to grant the permission to the file configure to run # chmod A + x configure. Run # make after the environment is configured. Run # Make
Install. After the installation is successful, a jthread folder will be added to the/Urs/local/include directory.

4. jrtplib installation is the same as above, after all installed, there will be two more folders under the/Urs/local/include directory jrtplib3 (may be due to different versions, the generated folder name is slightly different, such as jrtplib-3.7.1) and jthead. Copy all files under jthead (all header files with the suffix. h) to the jrtplib folder, so that all header files can be conveniently called in one directory.

5. installed after the system environment is as follows, static dynamic library installed to the/usr/local/lib directory, including libjrtplib-3.7.1.so and libjthread-1.2.1.so. The header file is under the/usr/local/include/jrtplib-3.7.1 directory.

6. there is a sample program in the jrtplib source code directory. In the directory example, compile example1.cpp and use the static library libjrtp. link A: Compile the link statement as follows (note that G ++ is used instead of GCC for compiling, because g ++ is required for the link stage ):
G ++-O example1 example1.cpp-I/usr/local/include/jrtplib/-ljrtp
That is, the application exmaple1 is generated. Note that the path in the-I (capital I) parameter is the header file directory of jrtplib and is modified according to the actual situation. If an error occurs, the path of the dynamic link library is incorrect. You can set the path of the dynamic link library in the following two ways:

A. Modify the dynamic link library macro LD_LIBRARY_PATH. LD_LIBRARY_PATH is the environment variable that everyone is most familiar with. It tells loader which directories can find shared libraries. You can set multiple search directories separated by colons. Export
LD_LIBRARY_PATH =/usr/local/lib, and then run the compilation. This method only temporarily modifies the path and will expire after shell restart. Or the configuration is in the environment variable file/etc/profile, restart or the source/etc/profile takes effect, and the source takes effect only in this console.

B. The permanent effective method is to modify the dynamic link library configuration file/etc/lD. so. conf, or in/etc/lD. so. conf. d. Create a new file and add the required directory to the file. The specific method is as follows: (Note: to modify the dynamic link library configuration, you must use the superuser permission. Otherwise, you do not have the write permission for the shared library configuration file)

# Cd/etc/lD. So. conf. d

# Vim jrtplib Add/usr/local/lib in the editing environment, save and exit.

# Ldconfig reload the dynamic link library.

Then run the compilation link to generate the example1 file.

Then run./example1. Successful.

1. Download and decompress the SDK. Download jrtplib-3.7.1.tar.gzand jthread-1.2.1.tar.gz separately. Is:

Http://research.edm.uhasselt.be/jori/jrtplib/jrtplib-3.7.1.tar.gzand

Http://research.edm.uhasselt.be/jori/jthread/jthread-1.2.1.tar.gz

2. Place the source file in any directory as follows. Assume that the file is in the main directory:/home/jrtplib /. Decompress # tar-xzvf XXX and XXX respectively as the file name. After decompression there are two directories, one is the jrtplib-3.7.1, the other is the jthread-1.2.1. Install jthread first, and then install jrtplib. Here, ensure that the installation sequence is install jthread first.
Jrtplib.

3. install jthread: Enter the jthead decompression directory. First, run #. /configure configuration environment to generate the MAKEFILE file. If permission denied appears, we need to grant the permission to the file configure to run # chmod A + x configure. Run # make after the environment is configured. Run # Make
Install. After the installation is successful, a jthread folder will be added to the/Urs/local/include directory.

4. jrtplib installation is the same as above, after all installed, there will be two more folders under the/Urs/local/include directory jrtplib3 (may be due to different versions, the generated folder name is slightly different, such as jrtplib-3.7.1) and jthead. Copy all files under jthead (all header files with the suffix. h) to the jrtplib folder, so that all header files can be conveniently called in one directory.

5. installed after the system environment is as follows, static dynamic library installed to the/usr/local/lib directory, including libjrtplib-3.7.1.so and libjthread-1.2.1.so. The header file is under the/usr/local/include/jrtplib-3.7.1 directory.

6. there is a sample program in the jrtplib source code directory. In the directory example, compile example1.cpp and use the static library libjrtp. link A: Compile the link statement as follows (note that G ++ is used instead of GCC for compiling, because g ++ is required for the link stage ):
G ++-O example1 example1.cpp-I/usr/local/include/jrtplib/-ljrtp
That is, the application exmaple1 is generated. Note that the path in the-I (capital I) parameter is the header file directory of jrtplib and is modified according to the actual situation. If an error occurs, the path of the dynamic link library is incorrect. You can set the path of the dynamic link library in the following two ways:

A. Modify the dynamic link library macro LD_LIBRARY_PATH. LD_LIBRARY_PATH is the environment variable that everyone is most familiar with. It tells loader which directories can find shared libraries. You can set multiple search directories separated by colons. Export
LD_LIBRARY_PATH =/usr/local/lib, and then run the compilation. This method only temporarily modifies the path and will expire after shell restart. Or the configuration is in the environment variable file/etc/profile, restart or the source/etc/profile takes effect, and the source takes effect only in this console.

B. The permanent effective method is to modify the dynamic link library configuration file/etc/lD. so. conf, or in/etc/lD. so. conf. d. Create a new file and add the required directory to the file. The specific method is as follows: (Note: to modify the dynamic link library configuration, you must use the superuser permission. Otherwise, you do not have the write permission for the shared library configuration file)

# Cd/etc/lD. So. conf. d

# Vim jrtplib Add/usr/local/lib in the editing environment, save and exit.

# Ldconfig reload the dynamic link library.

Then run the compilation link to generate the example1 file.

Then run./example1. Successful.

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.