FFMPEG Understanding(7. How to solve the issue of searching path?)
How to build the environment of MSYS for the crossing compiler? has described the way to build the MSYS, and it is well to deal with the compiling issue of FFMPEG. However, it has natural flaw to integrate multi-gcc compiler in the same time, so How to build the environment of MSYS in the windows? provides a better solution to overcome the form disadvantages. For a good sample of the above article, there are PKG_CONFIG_PATH and PERLIB environment variables to be declared for the appropriate searching path.
StepD03: Edit /etc/profile and add “export PKG_CONFIG_PATH=/lib/pkgconfig:/mingw/lib/pkgconfig:$PKG_CONFIG_PATH ”
StepD04: Edit /etc/profile and add "export PERLLIB=/usr/share/autoconf/Autom4te:/usr/share/automake-1.9:$PERLLIB "
The same situation is found when building FFMPEG because it depends on the extension libraries located in the ‘/lib ’ folder, but unfortunately, it does not been included to search in the GCC.
How to add the additional path for searching?
1. Use parameters of configuration. Fox example, --extra-cflags=’-I/include’ --extra-ldflags=’-L/lib’ --extra-libs=’-lXXX’ when executing configure command.
It seems that it is good solution to fix it, but I do not like typing so many characters when compiling all programs utilizing the ‘/lib ’ folder.
Now, the problem is whether I can take a better measure to do it once for ever! Yes, please refer to solution 2.
2. Add the environment variables to notify of GCC where there are.
Open ‘/etc/profile ’, and add two entries as follows.
export C_INCLUDE_PATH=.:/include:/mingw/include:$C_INCLUDE_PATH export LIBRARY_PATH=.:/lib:/mingw/lib:$LIBRARY_PATH |
--- C_INCLUDE_PATH indicates where the header files are.
--- LIBRARY_PATH points out the home of the libraries of header files.
Here, compiling it again. What’s happen:- )?
[Summarization]
1. The two solutions are based on the MSY established by How to build the environment of MSYS in the windows? . If the configuration is different, maybe there are no any issues in these aspects.
2. When the alternative is available, we should select the more valuable option for future. In our case, I prefer option2.
3. Familiar with GCC is very important to set the environment variables. It needs track GCC to gain more in our daily activities. Simple words – constantly self-building!