I’m about to write a large amount of code in C++ for maximum portability. I need this code to be able to run on a website and on an Android application through JNI. Although Java is technically also an option here, I may want to use this library in other projects in the future which will all be C++ based and I want to get the advantage of native speed because it’s a math related library.
My question is what the best option is to run this code on a web site. The website itself doesn’t have to be written in C++ just like the Android application itself is mostly written in Java.
I can see the following options:
- Write a PHP module to interface with this library
- Write a server in C++ for the API of the site that the site written in PHP accesses
- Write a fastcgi server
What do you think is my best option here?
The choice is obviously yours and all of the options sound great but I think using factcgi with something like
WTorCPPCMSwill be awesome. Take a look at both of them they are wonderful libraries for this task, I preferCPPCMSbut I think that depend on your need