Missing header files
Closed this issue · 15 comments
Hello.
I'm building mpp into a Qt program and facing difficulties while importing the necessary header files. I'm building my program on a Linux distribution and the media library struggles to find header files located in other folders of the library.
Here is a picture illustrating what I am talking about.
My code finds every header file, but the header files can't find other header files that are not located in the same folder. As shown in the picture, mpp-develop\mpp\base\mpp_buf_slot.cpp is looking for mpp_log.h, but it crashes since it is not in the same folder.
So, what is actually the correct way of handling the library files? Where do I place the folders from this API?
The cmake script handled the include directories by include_directories in CMakeLists.txt
include_directories(your_directory)
You also need to add more source code.
The mpp_packet is in mpp/base/
This example https://github.com/WainDing/mpp_linux_cpp/blob/master/CMakeLists.txt imports the whole library with target_link_libraries(mpp_linux_demo mpp pthread drm).
Can I use something similar in my situation?
I added these lines to my CMakeLists.txt file:
include_directories(inc)
include_directories(utils)
include_directories(osal/inc)
include_directories(mpp/inc)
add_subdirectory(mpp)
Yes, it is right.
I am using target_link_libraries(mpp_linux_demo mpp pthread drm).
I have included the following directories:
include_directories(inc)
include_directories(utils)
include_directories(osal/inc)
include_directories(mpp/inc)
include_directories(mpp/hal/inc)
add_subdirectory(mpp)
And I am still getting the error messages shown in the picture above.
Sub-directory should be also added. The sub-diretory CMakeLists.txt should be recursively included.
I have added:
add_subdirectory(mpp)
add_subdirectory(osal)
add_subdirectory(utils)
add_subdirectory(test)
add_subdirectory(mpp-develop)
add_subdirectory(hal)
add_subdirectory(base)
add_subdirectory(codec)
add_subdirectory(mpp/legacy)
add_subdirectory(mpp/hal)
add_subdirectory(mpp)
add_subdirectory(osal)
add_subdirectory(test)
add_subdirectory(utils)
add_subdirectory(mpp/hal)
add_subdirectory(mpp/base)
add_subdirectory(mpp/codec)
add_subdirectory(mpp/vproc)
add_subdirectory(osal/test)
add_subdirectory(mpp/legacy)
add_subdirectory(mpp/hal/vpu)
add_subdirectory(mpp/codec/rc)
add_subdirectory(mpp/base/test)
add_subdirectory(mpp/codec/dec)
add_subdirectory(mpp/codec/enc)
add_subdirectory(mpp/hal/dummy)
add_subdirectory(mpp/hal/rkenc)
add_subdirectory(mpp/vproc/iep)
add_subdirectory(mpp/vproc/rga)
add_subdirectory(mpp/hal/common)
add_subdirectory(mpp/hal/vpu/common)
add_subdirectory(mpp/vproc/iep/test)
But nothing new happens.
add_subdirectory is to add the CMakeLists.txt in the subdirectory. Use include_directories also to add include directory.
I have added: add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(utils) add_subdirectory(test) add_subdirectory(mpp-develop) add_subdirectory(hal) add_subdirectory(base) add_subdirectory(codec) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal) add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(test) add_subdirectory(utils) add_subdirectory(mpp/hal) add_subdirectory(mpp/base) add_subdirectory(mpp/codec) add_subdirectory(mpp/vproc) add_subdirectory(osal/test) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal/vpu) add_subdirectory(mpp/codec/rc) add_subdirectory(mpp/base/test) add_subdirectory(mpp/codec/dec) add_subdirectory(mpp/codec/enc) add_subdirectory(mpp/hal/dummy) add_subdirectory(mpp/hal/rkenc) add_subdirectory(mpp/vproc/iep) add_subdirectory(mpp/vproc/rga) add_subdirectory(mpp/hal/common) add_subdirectory(mpp/hal/vpu/common) add_subdirectory(mpp/vproc/iep/test)
But nothing new happens.
Dear @Nybon
did you solve the problem?
could you please share your experience?
I have added: add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(utils) add_subdirectory(test) add_subdirectory(mpp-develop) add_subdirectory(hal) add_subdirectory(base) add_subdirectory(codec) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal) add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(test) add_subdirectory(utils) add_subdirectory(mpp/hal) add_subdirectory(mpp/base) add_subdirectory(mpp/codec) add_subdirectory(mpp/vproc) add_subdirectory(osal/test) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal/vpu) add_subdirectory(mpp/codec/rc) add_subdirectory(mpp/base/test) add_subdirectory(mpp/codec/dec) add_subdirectory(mpp/codec/enc) add_subdirectory(mpp/hal/dummy) add_subdirectory(mpp/hal/rkenc) add_subdirectory(mpp/vproc/iep) add_subdirectory(mpp/vproc/rga) add_subdirectory(mpp/hal/common) add_subdirectory(mpp/hal/vpu/common) add_subdirectory(mpp/vproc/iep/test)
But nothing new happens.Dear @Nybon did you solve the problem? could you please share your experience?
I never got it to work, but I found another solution. The project contains samples that will run fine. Try editing the samples instead of building the whole thing from scrath. It may be a bit messy, but it will at least work. Please share a better way to do this if you find one. Remember to keep the same file positions!
I have added: add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(utils) add_subdirectory(test) add_subdirectory(mpp-develop) add_subdirectory(hal) add_subdirectory(base) add_subdirectory(codec) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal) add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(test) add_subdirectory(utils) add_subdirectory(mpp/hal) add_subdirectory(mpp/base) add_subdirectory(mpp/codec) add_subdirectory(mpp/vproc) add_subdirectory(osal/test) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal/vpu) add_subdirectory(mpp/codec/rc) add_subdirectory(mpp/base/test) add_subdirectory(mpp/codec/dec) add_subdirectory(mpp/codec/enc) add_subdirectory(mpp/hal/dummy) add_subdirectory(mpp/hal/rkenc) add_subdirectory(mpp/vproc/iep) add_subdirectory(mpp/vproc/rga) add_subdirectory(mpp/hal/common) add_subdirectory(mpp/hal/vpu/common) add_subdirectory(mpp/vproc/iep/test)
But nothing new happens.Dear @Nybon did you solve the problem? could you please share your experience?
I never got it to work, but I found another solution. The project contains samples that will run fine. Try editing the samples instead of building the whole thing from scrath. It may be a bit messy, but it will at least work. Please share a better way to do this if you find one. Remember to keep the same file positions!
I'm trying to make a simple and clear C++ example.
let you know if I do.
I have added: add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(utils) add_subdirectory(test) add_subdirectory(mpp-develop) add_subdirectory(hal) add_subdirectory(base) add_subdirectory(codec) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal) add_subdirectory(mpp) add_subdirectory(osal) add_subdirectory(test) add_subdirectory(utils) add_subdirectory(mpp/hal) add_subdirectory(mpp/base) add_subdirectory(mpp/codec) add_subdirectory(mpp/vproc) add_subdirectory(osal/test) add_subdirectory(mpp/legacy) add_subdirectory(mpp/hal/vpu) add_subdirectory(mpp/codec/rc) add_subdirectory(mpp/base/test) add_subdirectory(mpp/codec/dec) add_subdirectory(mpp/codec/enc) add_subdirectory(mpp/hal/dummy) add_subdirectory(mpp/hal/rkenc) add_subdirectory(mpp/vproc/iep) add_subdirectory(mpp/vproc/rga) add_subdirectory(mpp/hal/common) add_subdirectory(mpp/hal/vpu/common) add_subdirectory(mpp/vproc/iep/test)
But nothing new happens.Dear @Nybon did you solve the problem? could you please share your experience?
I never got it to work, but I found another solution. The project contains samples that will run fine. Try editing the samples instead of building the whole thing from scrath. It may be a bit messy, but it will at least work. Please share a better way to do this if you find one. Remember to keep the same file positions!
dear @Nybon
I finally could Make it and use Opencv frame as input frame.
https://github.com/EhsanVahab/rockchip-mpp-encoder