C++ cross-platform question

Schadenfroh

Elite Member
Mar 8, 2003
38,416
4
0
Hey,

I am going to start up a side project making use of these two libraries (zlib, libcurl). I will be developing it on a Linux machine, but the target audience will be on Windows. Will I be able to use the same source code to interact with these libraries and just have to recompile them to target Windows machines? From what I have read, both libraries are cross-platform. It would be nice if I could just use the libcurl and zlib libraries in OpenSUSE 11's repositories for both and compile both the Linux and Windows versions with GCC / G++, but I doubt it will be that easy. I will not use any library / code that is not cross-platform in it and it will be a console (command-line) application. I am very inexperienced in writing cross-platform applications.

Thanks for any insight that one can offer....
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
zlib works with (unmanaged) Visual C++ in Windows so it should work with GC++ too. No idea about libcurl, Google "libcurl VC++", "ibcurl windows" or similar might tell you.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
I recommend you get yourself a Windows box, install g++, compile libcurl (same version, very important) and statically link it with something on Windows to iron out all your assumptions. Then start your linux development work -- when I port to windows, aside from my occasional accidental use of a Linux-only api, my biggest problem is making some assumption about cross-platform library behavior.