views:

461

answers:

3

Hi,

I am a perl developer that has never went into the client side programming of things. I'd like to think that I'm a pretty good developer, except I know that my severe lack of knowledge of the way desktop programming really takes away from my credibility.

That said, I really want to get into doing some desktop applications.

I want to try to develop a simple application that will connect to my server and grab an rss feed, then display it in the console. My plan of attack is to use libcurl (and curlpp) to grab the feed (I'd also like to do more curl stuff in the future). But I want to be able to run this small program on linux, windows, and mac because I want to understand developing cross platform.

So here is the question (and I know it is extremely noobish): How do I write c++ code that will use libcurl and curlpp, and will work on the 3 major OSes? The main thing I don't understand is if I have to compile libcurl and curlpp, then how does it work when trying to take it over to the other platforms?

+3  A: 

You need to write the code portably - basically make it a console application. You then transfer the source code (not the exe) to the other platforms and compile it there and link with the version of llibcurl on each specific platform.

anon
First of all, thanks for the reply.So the basic process should be compile libcurl on windows, write portable code, statically link libcurl, copy source to linux, repeat?
Yes, that's it. It's not so difficult - I have a FOSS project that compiles on both Windows and Linux with only very minor changes between the two platforms.
anon
Oh, I should say that things will be simpler if you use the GCC compiler on all of the platforms.
anon
Alright. I'll do that then. Thanks a ton man.
Stick to POSIX calls, it will help a lot.
Paul Beckingham
A: 

Neil is right, but using a framework will make your life easier. Try QT it is very nice. It has a cross platform http API, and integrates curl.

Byron Whitlock
Well, if he only needs a console app, QT would be overkill. Never underestimate the time needed to learn a framework before you can become productive using it.
anon
Besides, he wants to learn cross-platform development, not let Qt do the job for him.
Georg Fritzsche
I've heard a lot about QT, but obviously have never used it. Once I have the process down manually I'll check it out. It looks great for bigger projects. Thanks for the advice.
A: 

I'd recommend Qt4 as well, I've wrote a small'ish tutorial on how to setup a windows gcc compiler on linux and compile Qt4/OpenSSL with it for windows, hope that helps. http://www.limitlessfx.com/mingw-openssl-qt4-for-windows-on-linux.html

You can easily adapt that tutorial to compiling libcurl instead of just moving to Qt4.

OneOfOne