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

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.

Related

C++ Qt executable compatible with all windows computers?

I have had problems in the past using visual C++, when I ran the executable on other computers it required a .NET framework. I have now started looking at c++ Qt GUI builder and from what I have read C++ doesnt require any additional downloads apart from the executable file to be able to run on other computers, is this true? If I use Qt to build my GUI and send it to other users they will need no other external downloads?
I have now started looking at c++ Qt GUI builder and from what I have read C++ doesnt require any additional downloads apart from the executable file to be able to run on other computers, is this true?
Not necessarily; see below.
If I use Qt to build my GUI and send it to other users they will need no other external downloads?
You will potentially need to get redistributables installed on each user machine where this is needed, but this is not a Qt issue, just a generic principle how VS/MSVC and Windows work. However, there is no gentle way around to it in my understanding.
I'm not 100% sure, but I can tell you that some of my users need to download the Visual C++ Redistributable package. They would sometimes get a missing "msvcr.dll" error. Very frustrating. I tried including the file with the install, but it was picked up as a virus by some antivirus programs.

Compiling/Running C++ code on iPhone without convert to Objective 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.

Programming in C++ with Xcode 4

I want to use Xcode as my major complier for C++. However, I'm having a hard time starting programming. Which kind of project and target should I select if I want to write some applications with user interface?
I've been coding with Xcode for one semester but all the projects were half-done the time I saw them, so I really don't know how to start by myself. I tried the Command Line target but it did not seem to generate an application.
Sorry for asking these naive questions. Thanks for any help!
You can start with a barebones project by going to New -> New Project -> Application (under Mac OS X) -> Command Line Tool. This will give you a basic main() function that you can enter code into. This is what I use alot of the time for algorithm practice.
If you want your app to use a GUI framework, you can either choose the template that #sblom suggested and make a Cocoa Application (here is a good guide to get you started), or you could use a C++ framework such as wxWidgets or Qt (usually used with it's own IDE, Qt Creator).
Note that while Cocoa is in Objective C, you could just as well program in C++ for the core functionality of your app, just make sure the implementation files have a .mm suffix.
You'll need to use Mac OS X -> Application -> Cocoa Application. Unfortunately, it won't exactly be in plain ol' C++, although you can use C++. You'll have to use Objective-C to make actual calls into the Cocoa Framework (well, there are ways to make the calls using straight C/C++, but that's really cumbersome.)
I will highly recommend to use QT but not WX.
We use WX for years in our Valentina Studio application. And we going switch to QT asap. Reasons are that WX on MAC has weak progress. Troubles with Cocoa support. QT looks much more better choice ...

How to run a c or c++ program on a Android Device like Samsung galaxy tab?

Hi im wondering how to execute a simple helloworld c or c++ program on a Android phone i googled it but i dont find any crystal clear working methods guys direct me in this....
You need to use Android NDK (Native Development Kit).
The NDK package also contains some demos you can compile and run.
This requires some perseverance on your part to figure this out.
As peoro has said, you need the Android NDK but that really is only the beginning. You will need to move your project relative to the Android NDK directory, mark up your code with the "native" keyword, create some make-files, use these to generate headers for the JNI (Java Native Interface) and then create accompanying cpp files into which you paste your code.
This is the outline.
Good instructions (i.e. that were good enough for me to succeed at this with C) are here:
http://en.wikipedia.org/wiki/Java_Native_Interface
http://blog.jayway.com/2010/01/25/boosting-android-performance-using-jni/
as well as the Android docs/Android NDK instructions themselves
http://developer.android.com/sdk/ndk/index.html
It is a pain to do this but if it saves you time overall/gains you critical performance then it is well worth it and very satisfying. On the other hand, if your code is fairly short and you're not after critical performance you are better off just translating it into Java. That's not hard.

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.