I'm trying to compile opencv\_2.4.9 with cmake\_3.5.0 to run a project in Qt\_5.3.2 MinGW and it keeps showing this error:

[Common needed but can't find boost](http://i.stack.imgur.com/1UOpr.png)

I choose "MinGW Makefiles" as generator and "specify native compilers" in configure window. I defined BOOST\_ROOT environmental variable and this is my CmakeLists.txt:

```
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

SET(sampleName MyApp)

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC ON)
set(Boost_COMPILER -gcc49)
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:/Program Files/PCL 1.6.0/3rdParty/Boost/include")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:/Program Files/PCL 1.6.0/3rdParty/Boost/lib")

find_package(PCL 1.6.0 REQUIRED)
FIND_PACKAGE(Boost)
IF (Boost_FOUND)
    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
    ADD_DEFINITIONS( "-DHAS_BOOST" )
ENDIF()

FIND_PACKAGE(MRPT REQUIRED base;bayes;obs;gui)

include_directories(${PCL_INCLUDE_DIRS})
include_directories("C:/Program Files/PCL 1.6.0/3rdParty/Boost/include")

link_directories(${PCL_LIBRARY_DIRS})
link_directories("C:/Program Files/PCL 1.6.0/3rdParty/Boost/lib")

add_definitions(${PCL_DEFINITIONS})

add_executable (MyApp Local.cpp part.h grab.h interface.h test.cpp test.h)

target_link_libraries (MyApp ${PCL_LIBRARIES} libeng.lib libmx.lib libmex.lib libmat.lib Aria.lib winmm.lib wsock32.lib)

TARGET_LINK_LIBRARIES(${sampleName}
${MRPT_LIBS} # This is filled by FIND_PACKAGE(MRPT ...)
"" # Optional extra libs...
)

```

Does anyone know what solves this error?