Use eclipse to compile and manage the live555 source code

Source: Internet
Author: User

This is an eclipse getting started tutorial.

Live555 uses makefile to manage projects. It is troublesome to add source code files by yourself. You need to modify the dependencies between files by yourself. in fact, we can easily transplant live555 into eclipse's own C ++ project. in this way, eclipse can automatically manage the relationships between files.

The compiling environment is mingw in windows. msys is installed when mingw is installed. msys is a command line program. to compile a program using mingw, execute the following command in the msys command line :. /configure, make and other commands.

Official Website: http://www.mingw.org/

Installation: http://sourceforge.net/projects/mingw/files/latest/download? Source = files

To http://sourceforge.net/projects/mingw/files/latest/download? Source = files download Installer: mingw-get-inst-20111118.exe

After running, the system automatically downloads and installs the required files from the Internet.

After the installation is complete (usually installed on the C disk), a file such as msys. bat will be found on the desktop, that is, the msys command line. Just run it.

 

For example, if you have a makefile project under D:/AAA/, you generally need to execute the following command to compile it:

CD/D/AAA

./Configure

Make

The following describes how to use eclipse.

First, transplant the mediaserver project in live555

  • Open eclipse
  • Menu File> New> C ++ Project
  • The C ++ project dialog box is displayed.
  • Enter mediaserver in project name
  • In the project type tree control, select excutable-> emptyproject, and select mingw GCC in toolchains.
  • In location, you can select the path of the project, such as D:/workspace.
  • Click Finish.

In this case, the project is automatically created, for example, in D:/workspace/mediaserver, all source code files under the live555/mediaserver directory (*. C ,*. CPP ,*. H ,*. HH) copy to D:/workspace/mediaserver. In eclipse, right-click the project mediaserver in projectexplorer on the left and select refresh, the file we copied will be automatically added to the project.

 

Now you can compile. Select "project"> "build all" to start compilation, but it cannot be succeeded because we still rely on several libraries.

Next we will create the libraries, all of which are static libraries. The creation process is similar to mediaserver, but in projecttype, select staticlibrary-> Empty Project. toolchains or mingw GCC.

Create basicusageenvironment, usageenvironment, groupsock, and livemedia static library projects, all of which are located in D:/workspace/mediaserver. copy the files in the corresponding directory of live555 to various project directories and refresh them. in this way, all projects are created.

 

However, compiling any library cannot be passed because they want to use each other's header files. therefore, you need to set the include path in the settings of each project. for example, if the groupsock library uses the usageenvironment header file, you need to set the usageenvironment path to groupsock. the procedure is as follows:

  • Select groupsock project in project exporer
  • Right-click menu
  • Select properties
  • The Project Settings dialog box is displayed.
  • Select C/C ++ build-> settings in the left-side tree control.
  • On the tool settings page, select gcc C ++ comiler-> nodes
  • The include path (-I) interface is displayed, and an icon with a small + sign is displayed on the right.
  • The add dictionary path dialog box appears.
  • Select Workspace
  • The folder selection dialog box appears.
  • Select usageenvironment-> include (usageenvironment puts the header file under the include directory ).
  • Click OK.

Now you can compile groupsock.

You can solve the problem of header file reference between other databases in the above way.

 

However, mediaserver compilation fails because the library to be linked cannot be found.

Here we will solve this problem:

  • Select the mediaserver project in project explorer. The right-click menu is displayed.
  • Select properties menu items
  • The properties for mediaserver dialog box is displayed.
  • In the left-side tree control, select C/C ++ build-> Settings
  • Select tool settings page on the right
  • In the tree control, select mingw C ++ linker-> Libraries
  • Select the button with the + sign in the right libraries (-l) line.
  • In the displayed dialog box, enter groupsock
  • Repeat the preceding action to add all the static databases that the mediaserver depends on.
  • Select the plus sign for the libraries search path (-l) row in the lower right corner.
  • The add directory path dialog box is displayed.
  • Click workspace.
  • In the displayed dialog box, select groupsock-> debug
  • Click OK. The dialog box is closed. The add directorypath dialog box is displayed.
  • Click OK to add a library path.
  • Repeat the paths of other libraries.

Complete the acquisition.

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.