Tool Native Library Generator (C/C++ to B4A)

H&Bit

New Member
Licensed User
Dear wonder
I am a contributor. I saw your blog in b4x. I think that your achievement is incredible and great. Recently, I downloaded open source in your link but
it did not compile that. It presented 'Error occurred on line: 1030'.-> (Dim returnSpider =0 As int) Please help me to solve this problem.
Also Could you please give me two files of native_library_generator_XXX.jar and xml files? Please help me. Best regards
 

Attachments

  • Error.png
    84.1 KB · Views: 251

monic

Active Member
Licensed User
Longtime User
Doesn't the error box state the error(s), can you provide a sample and what doers the log box show a error before compile?
 
Last edited:

wonder

Expert
Licensed User
Longtime User

This bug has been corrected more than a month ago, but it seems that I forgot to post about it.
Sorry about that.

The fixed version can be obtained from the GitLab repository.
I will update the .jar file on the first post until tomorrow.
 

wonder

Expert
Licensed User
Longtime User
NLG 4 wishlist:
- Support for multiple source files
- Better handling of header files
- Import project settings from Visual Studio / Code::Blocks
- Transparent makefiles
- Selection for C or C++ compilation
- Unification and documentation of '// @NLG: ... ' commands
- UI improvements

Wish me luck!
 

inakigarm

Well-Known Member
Licensed User
Longtime User
Luck ! ;-)
 

canalrun

Well-Known Member
Licensed User
Longtime User
Thank you Wonder. This is really neat.

I wonder if the following would be technically possible:

If I read correctly your tool takes C/C++ code and compiles it to a .so library, then also creates a B4A wrapper library so that the .so can be used in B4A.

Is it possible to start with a third-party .so library and have the tool produce the B4A wrapper to use the .so in B4A?

This would require that the .so library file contains all the required information needed to produce a wrapper – I don't know enough about .so libraries to know if they contain all the information needed.

Thanks,
Barry.
 

wonder

Expert
Licensed User
Longtime User
If I read correctly your tool takes C/C++ code and compiles it to a .so library, then also creates a B4A wrapper library so that the .so can be used in B4A.
Correct.

Is it possible to start with a third-party .so library and have the tool produce the B4A wrapper to use the .so in B4A?
Yes, I already managed to get Python working inside B4A... but the current NLG version doesn't support it yet. Work in progress... ^_^

This would require that the .so library file contains all the required information needed to produce a wrapper – I don't know enough about .so libraries to know if they contain all the information needed.
You have to know the target architecture (at least) and know your way around the source code (at least a little bit).
 
Last edited:

wonder

Expert
Licensed User
Longtime User
NLG 4.00 is out!
- Complete visual overhaul
- Specifying additional include paths is now possible
- Specifying additional prebuilt libraries is now possible
- Specifying the target ABI's is now possible
- Compatible ABI's are now auto-detected if possible
- Handling multiple projects is now possible
 

wonder

Expert
Licensed User
Longtime User
[Version 4.01] [2017-05-07] [NEW FEATURES]
The 'cpu-features' library can now be used
Custom Makefiles may now be used
Custom Java wrappers may now be used
Bug fixes

First post updated.
 

wonder

Expert
Licensed User
Longtime User
Hi!

I've been working on this project a little bit, improving things here and there.

Experimental features:
- Projects with multiple source files
- When existing, the config file your_project\nlg\config.txt has now priority over your_nlg_path\projects.txt

If you're interested in this build, you can get it here:
https://gitlab.com/brunowonder/NativeLibraryGenerator-CommunityEdition



EDIT:
Known issues:
- When utilizing multiple native libraries in your B4A project, if the target ABIs of one of them doesn't match the other ones, your app will crash!

I concluded that IS NOT an NLG issue:
How to fix: https://www.b4x.com/android/forum/t...e-native-libraries-problem.99207/#post-624540
 
Last edited:

wonder

Expert
Licensed User
Longtime User
New Release!!!

[Version 4.20] [2018-11-11] [NEW FEATURES]
Now supporting multiple source files
Select which files should be exposed to B4A
Requires NDK r18b (please update)
Bug fixes

I'll try to record some new video tutorials soon.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…