Porting C++ API to Java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tvnaidu
    Contributor
    • Oct 2009
    • 365

    Porting C++ API to Java

    Is there any tool to port C++ APi to Java?. Or Is it manually portable any C++ to Java?. appreciated. It is very straight forward C++ code (like C functions).
  • Dominik Przybys
    New Member
    • Jul 2011
    • 8

    #2
    If you want to use C++ API in Java, you should interest in 'native' keyword. In this way you could call C/C++ functions in Java program.

    Comment

    • Dheeraj Joshi
      Recognized Expert Top Contributor
      • Jul 2009
      • 1129

      #3
      You can use SWIG too.
      Check this link.

      Regards
      Dheeraj Joshi

      Comment

      • tvnaidu
        Contributor
        • Oct 2009
        • 365

        #4
        I have pretty straight C++ api for portOpen, PortClose, sendMsg and etc., I need to port these into java, if I use "native" before C++ api, I can call C++ in Java right?. but I need to port completely those C++ to java.

        Comment

        • Dheeraj Joshi
          Recognized Expert Top Contributor
          • Jul 2009
          • 1129

          #5
          You want your code to be independent of any C++ code? You want to port all C++ code to Java?

          Regards
          Dheeraj Joshi

          Comment

          • Dominik Przybys
            New Member
            • Jul 2011
            • 8

            #6
            Only if you call this method, which you make native. Cannot make all API native. Only methods can be native.

            Comment

            • Dheeraj Joshi
              Recognized Expert Top Contributor
              • Jul 2009
              • 1129

              #7
              I am little bit confused about the requirement. If there is a way to call native C++ calls directly from Java, why can't you call it?

              Regards
              Dheeraj Joshi

              Comment

              • tvnaidu
                Contributor
                • Oct 2009
                • 365

                #8
                Correct, I want to port.

                Comment

                Working...