Tomás wrote:
posted:
Hi all,
I want to build a corresponding c++ version for a big java project
(e.g. Geotools(www.geotools.org))? Which is the quickest/easiest way? I
don't want to use the Java VM, then JNI is not suitable.
First question: Why?
I know this is a open issue, and I want to know your options.
What I'd do:
Try compile it with a C++ compiler, then go through all the errors and
warnings. You'll have to replace "boolean" with "bool"... things like
that.
ouch.
I would expect that to cause enough undefined behaviour or outright
stupidity to be a complete nightmare to fix.
Porting a large program requires a large amount of effort. There are no
shortcuts.
I would start by creating lots and lots of test cases for the Java code.
Then I would port the test cases to C++.
Then I would go about reducing the error count by implementing
functionality (from scratch).
It may be useful to extract architectural information out of the Java
codebase and use that to have an understanding of the existing program.
I suspect that whenever you use copy-paste from Java to C++ to expect
more problems than writing it by hand.
Ben Pope
--
I'm not just a number. To many, I'm known as a string...