Accessing C API (no class from C++ library) from Command line or script
이전 댓글 표시
I have a C++ built library in ubuntu which exposes C APIs. Associated header-file defines the APIs without use of 'extern C'. The header file also includes other headerfiles from other packages (Eigen).
- seems cannot use loadlibrary. I tried library-name headerfile-name,i get:
> loadlibrary libfile.so file.h
Failed to preprocess the input file.
Output from preprocessor is:file.h:5:9: warning: #pragma once in main file
#pragma once
^~~~
file.h:7:10: fatal error: Eigen/Core: No such file or directory
#include <Eigen/Core>
^~~~~~~~~~~~
compilation terminated.
- do i need to use other mechanism? (fairly new to matlab)
댓글 수: 4
James Tursa
2020년 4월 4일
편집: James Tursa
2020년 4월 4일
Can you write your own C header file that includes only the function prototypes you want to use? If the original C++ header file does not have extern "C", how do you know they are not decorated names in the object file?
James Tursa
2020년 4월 4일
You haven't answered my question. If the original C++ header files did not have extern "C" in them, why do you think they are not decorated names in the object library file?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deploy to C++ Applications Using mwArray API (C++03)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!