-
Notifications
You must be signed in to change notification settings - Fork 744
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
Project management with javacpp #1479
Comments
Please try to use the Maven plugin as per the JavaCPP Presets or Gradle JavaCPP: |
I looked through it and some other stuff but to be honest I am still quite confused about how I'm supposed to use it.. I'd like to ask is the plugin able to parse native header files or does that have to be done with the javacpp.jar ? |
Sure, please start here: https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets |
yeah I also gave that a read before making a post. Still couldn't quite get it but after giving it another look I decided to take a peek in the pom.xml that's in the base javacpp-presets and I think I found what I needed, but it still doesn't work. More specifically this part seems to not be working:
In org.example there is a class called Mapper that has a Properties and Platform annotation with an included .hpp header and a target and global. For some reason when I run mvn clean install though, I get this: |
You'll need to compile those classes with a call to maven-compiler-plugin before that. |
|
So, everything works? We can close this? |
No, I guess not. Like I said, try to do like with the presets. |
I think I may have accidentally deleted the rest of my comment aside from the maven stuff. Yeah it still doesn't work (I actually did have the compiler-plugin before that as well) and also that is pretty much exactly like how the presets do it. I suppose I will take a look again a bit later but at the moment I have ran into another issue. |
I have been using the javacpp parser for a while and it's been great. One thing that I still don't know how to do though is project management. For now I have been pretty much just winging it by giving the path to the dlls the parser compiles via a VM argument and the rest of the dlls are dealt with in a similar way, but there are some problems with that. For example if I want to compile the whole thing into a jar file and just run it from there(though I'm just not sure how to link with dlls from a jar file anyway). Here is what I have done so far:
I have some c++ header files which are included and linked against in an InfoMapper with a target and a global.
After that's done I open the command prompt and run
java -jar javacpp.jar <path to the info mapper>
and that generates all the .java files corresponding to the classes in the included header files.
After that I run
java -jar javacpp.jar <paths to all of the .java files>
, which then compiles all the java files into .class files and also generates native code and compiles that native code to a dll that's found in /windows-x86_64/*.dll (and all the other stuff like *.lib *.exp ...)At the moment the way this dll is loaded is, as I said before, by giving the absolute path to that dll.
2 things I would like to do to begin with are: moving the .class files to another folder and linking the dll with a relative path.
Also I am using maven.
The text was updated successfully, but these errors were encountered: