cmake似乎是很强大,不过还不会用-,-

准备抽空看看。。

不过即使不会用,还是可以编译的,很简单。

 

boost

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

int main () {
    using namespace boost::numeric::ublas;
    matrix<double> m (3, 3);
    for (unsigned i = 0; i < m.size1 (); ++ i)
        for (unsigned j = 0; j < m.size2 (); ++ j)
            m (i, j) = 3 * i + j;
    std::cout << m << std::endl;
}

一个简单的矩阵的例子,CMakeLists.txt如下

PROJECT (HELLO)
SET(SRC_LIST main.cpp)
find_package(Boost REQUIRED)
ADD_EXECUTABLE(hello ${SRC_LIST})
target_link_libraries(HELLO ${Boost_LIBS})

 

 

opencv的如下

project( cv_test )
find_package( OpenCv REQUIRED )
add_executable(cv_test opencv)
target_link_libraries( cv_test ${OpenCV_LIBS})

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
猜你喜欢
  • 2021-04-30
  • 2021-11-05
  • 2021-12-01
  • 2021-06-15
  • 2021-10-15
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案