Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate with other projects? #15

Open
mochechan opened this issue Jul 26, 2021 · 0 comments
Open

How to integrate with other projects? #15

mochechan opened this issue Jul 26, 2021 · 0 comments

Comments

@mochechan
Copy link

I'm attempting to integrate OATPP with my project, but no success so far.
The reason should be that I'm not familiar with OATPP.

My evaluations are described as follows:

Evaluation 1: in the test/ folder

Insert #include "xalpr.hpp" here.

In the function int main() , insert the code:

  xalpr XALPR;
  XALPR.init();
  XALPR.recognize("");

Where the xlapr is a class. The result fits my expectation. It seems that the CMakeLists.txt has necessary modifications.

Evaluation 2: in the src/controller/ folder

With corresponding to the Evaluation 1, the CMakeLists.txt has some necessary modifications.
Insert #include "xalpr.hpp" here.

In the constructor MyController, insert the code:

  xalpr XALPR;
  XALPR.init();
  XALPR.recognize("");

When make, the following errors appear:

In file included from /home/xalpr/src/controller/MyController.cpp:1:
/home/xalpr/src/controller/MyController.hpp: In constructor ‘MyController::MyController(std::shared_ptr<oatpp::data::mapping::ObjectMapper>&)’:
/home/xalpr/src/controller/MyController.hpp:37:5: error: ‘xalpr’ was not declared in this scope
   37 |     xalpr XALPR;
      |     ^~~~~
/home/xalpr/src/controller/MyController.hpp:38:5: error: ‘XALPR’ was not declared in this scope
   38 |     XALPR.init();
      |     ^~~~~
make[2]: *** [CMakeFiles/my-project-lib.dir/build.make:76: CMakeFiles/my-project-lib.dir/src/controller/MyController.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/my-project-lib.dir/all] Error 2
make: *** [Makefile:101: all] Error 2

Note: Please ignore line numbers due to the code has some modifications.
Question: How to solve this problem?

Evaluation 3: in the src/controller/ folder

Pending due to the Evaluation 2 is not yet solved.
The goal is that each ENDPOINT can call the function XALPR.recognize(""). Helpful tips are welcome. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant