Compiling/Running C++ code on iPhone without convert to Objective C - c++

I wrote my project on Visual studio 2010 and I used on it tesseract ocr library , Opencv and Cvblob , and now want change it to from desktop application to mobile application on iPhone so can I compiling and running it without convert to Objective C ?!

Well, you can compile and run straight C or C++ on iOS. You can even inline it in Objective-C classes.
But you will still need Xcode (and thus a Mac) to build and deploy, and you will not be able to just use code you built against Windows frameworks.
It seems tesseract does not currently support iOS, so if you require that and can't port it yourself, you probably can't just port your app to iOS without rewriting major parts of it. But that isn't just a question of programming languages.

Related

Xamarin.Forms + native library OpenCV

I'm trying to write an application using Xamarin.Forms. But I need to connect to the project native library OpenCV.
In tutorial i see how connect to the ios or android project. But I want use this native library in share code.
Library OpenCV has Android, Linux, Windows, iOS and Source Code versions. I would like to write code for this library once.
this is url for this library http://opencv.org/downloads.html
Please, help solve the problem
I don't think there's a way to have one codebase when using native bindings on iOS and Android. However, you can automate everything by using SWIG (http://www.swig.org). Short example here: http://blog.reblochon.org/2013/01/c-bindings-for-monotouch-using-swig.html
There's also .NET port of OpenCV called EMGU which works fine with Xamarin.

C++ Cross platform development (Windows and Mac OS)

I've got new task to research the way of development C++ cross platform (Mac/Win) utility for our internal needs.
I've developed for 7 years using different "pink" languages like C# , Java , Managed C++.
But in this task , the requirement is to support Mac , and .NET that is running on Mac , is really pain (Know this from other guys who did used this).
So I've started to think about C++ if it's possible to use C++ for Cross platform development.
The application will no contain any GUI , but will contain a lot of System API calls , and a lot of business logic analysis.
Is there possible some library allowing to achieve such kind of Task ?
Is it possible to do at all ?
Yes, you can write standard, ISO C++ and run the programs on both platforms.
When you need to implement some functionality using platform specific APIs (e.g. using Win32 on Windows and POSIX APIs on Mac OS) then what you do is write your own wrapper functions that abstract away the platform specific details, and then use that wrapper in the rest of your program.
Tools like CMake will allow you use Visual Studio to build the program on Windows and Xcode to build on the Mac without having to manually manage separate Visual Studio and Xcode project files.
If I understand your question properly, the only thing you need to develop cross platform c++ is to get the right compilers. You could use GCC on both platforms or even use 2 different project files for visual studio and xcode. That's up to you. Personally, I prefer GCC.
Regarding code itself, it depends on what you do with it. STD is available on both platforms (std::vector, std::string, etc) so code should compile properly on both platforms.
Edit: Btw, most platform specific stuff are available through open source code (like boost though I personally don't like boost that much). If needed, you could even look at other open source projects that are cross platform (ogre3d, etc).

Is there a c++ bind can cross v8 and JavaScriptCore?

Im looking for a script engine for game developing. I dont like lua (because of it's syntax and features), Im very like js, so I want to use google V8, but seems it is not very friendly in iOS? So, Is there a c++ bind can cross v8 and JavaScriptCore? In iOS use JavaScriptCore and others use V8 to bind the same C++ code.
I've started a project for this. It currently supports building and running the examples included in version 3.14 of the V8 project, as well as Node version 0.10.
https://github.com/flyover/v8like
I've also made a fork of the Node project with project files for iOS and OS X including targets for compiling against V8 using the simulator (define USE_SIMULATOR) and the v8like project.
https://github.com/flyover/node
As I know, there is no such bind library. When I worked in game dev company in the past year, we created our own bind. But it is proprietary code. We used JavascriptCore on iOS and V8 for Android.
So it's possible, but to my regret I can't help you with code.

C++ app for IPAD with C++Lucene library

I am planning to build an app in C++ for ipad. I have never build any app for ios. I want to know whether is it possible to write a C++ app using Lucene library in ipad. Can i write the code in visual c++ and compile it in xcode. Can i use the same code to work in mac os as well? I really wanted to build the app in Java so it works every where but unfortunately I pad doesnt support java.
Please provide me some good suggestions to build this app.
Thank you.
No. You can't build for iPad in Visual Studio.
You can include C++ in "Objective-C++" files, named .mm, but you will have to learn a minimum of Objective-C in which to include your C++ code.
As for using the same code for mac, it depends on how well you separate your logic from your display code - you can reuse some code, but you can't simply hit "build for Mac" and have iPad apps magically run on the Mac. You'll have to, at the very least, build a totally separate interface.
Building apps for iOS, etc requires some simple steps :
Buy a Mac
Learn some Objective-C
There is no other way around that makes sense.

Porting .NET C++ standalone to Mac

I need to give an estimate for porting a standalone program to a Mac from a .NET platform. I have all the source code which is in C++ and is both code I wrote and a modified version of GLUT/GLUI because the program uses OpenGL and GLUT/GLUI as a UI.
I don't think the C++ code will be a problem or the OpenGL environment, please tell me if you think it will be. In .NET, I use OpenGL32.DLL and deploy it with my app. I need to find out how this is done for a Mac?
I really need to know what the current deployment method is for Mac's these days and how hard it will be for me to write for it. For .NET, I use Visual Studio for the application development and deployment, I make a new VS project to build the deployable MS installer.
The deployment process also allows things like placing a desktop shortcut, associate a unique icon with the program ... What deployment options can one select on a Mac? What do you think the biggest obstacles will be?
There's no .NET framework calls within the code. The deployment phase produces a .NET assembly with all the security features. I think that is the main relationship with .NET since it is straight C++ not C#.
Development should be rather straight-forward. You'll be able to do OpenGL/GLUT/etc... through the Cocoa framework. Look at this example from Apple to see how it is done in code.
As for development tools, you will be able to use Xcode (which is free with the Mac). You can develop in C++ and compile with GCC.