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

Using native libraries #13

Closed
Lelelo1 opened this issue Sep 4, 2021 · 3 comments
Closed

Using native libraries #13

Lelelo1 opened this issue Sep 4, 2021 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@Lelelo1
Copy link
Owner

Lelelo1 commented Sep 4, 2021

Using native libraries
The current understanding (unfortunately) is that you cannot use a C# dependency, and target Java in the compile. Your solution become specific and tied to the dependency's platform. In the C, C++, Objective-C realm it seem to possible to a great extend though - to pick an Objective-C dependency and then consume the project later on in C++.
I still need to learn and understand more about Haxe and it's limitations.

@Lelelo1
Copy link
Owner Author

Lelelo1 commented Sep 4, 2021

C++ dependency
Checkout the discussion with haxiomanic at HaxeCBridge repo. There is gluon repo with shows how to setup project.h and the include path, in c++ - to create externs for haxe

In c++ compile is needed into dynamic libraries, that contain the functionality of the code, meaning you don't use *.cpp files directly consuming other c++ projects. The include folder that exposes functionality,which is the the *.dylib library file (mac), from the compile. The LucenePlusPlus contains CMake which you build, and construct library file with.
When compiling on mac, there seems to be a problem with default (apple or clang?) compiler and I wrote a message I used gcc with cmake: luceneplusplus/LucenePlusPlus#111.

What you get are these files:

Screen Shot 2021-08-29 at 12 17 38

(Hopefully they will work and are the actually intended lib output)

On mac the include /usr/local/include needs to specified as an includePath in the .vscode/c_cpp_properties.json, otherwise VSCode complains.
That I did not set with with the LucenePlusPlus might reason it would not work with cmake default/intended commands, so I might have to recompile into the libraries. (Update this to be instructive, not as a notebook later on)


I learned from this video that, you take the lib and include folder of a c++ project and put into a folder in your own project.
I think it should be the same when using it in haxe, the only difference with haxiomanics sample is that he puts the source code file blew.c directly in the folder. (I think the headers is all related to that file..)

@Lelelo1 Lelelo1 added the documentation Improvements or additions to documentation label Sep 4, 2021
@Lelelo1
Copy link
Owner Author

Lelelo1 commented Sep 4, 2021

I see the best strategy right now is to use as little dependencies as possible, so the solution can be compiled to as many platforms as possible and used.

@Lelelo1 Lelelo1 closed this as completed Sep 4, 2021
@Lelelo1
Copy link
Owner Author

Lelelo1 commented Sep 4, 2021

Setup cpp -> haxe (-> cpp/objC)

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

No branches or pull requests

1 participant