0

I have this C# client that's handling xml and tcp/ip messages, and I have to convert it to C++, BUT - I have to convert it to C++ in such a way that it will run on both Windows and Linux. Is there a set of standard libraries for xml and tcp/ip that I can use on both Windows and Linux? Sorry if this sounds like a stupid question - I'm very familiar with C# and .NET, but I'm not very familiar with native C++ - I don't really know any of the standard libraries, just the syntax.

In case it helps, here's the exact message from the boss.

1) read/create very simple XML, and

2) receive/send TCP messages from C++ using a library that exists on both Windows and Linux. Hopefully there is one and you can then develop on Windows and just do a quick test on Linux.

Tomas
  • 125
  • 1
  • 10
  • 1
    Check [Boost](http://www.boost.org/). – jweyrich Nov 09 '11 at 18:32
  • XML parser/library: maybe here http://stackoverflow.com/questions/170686/best-open-xml-parser-for-c. Cross-platform networking library -> [Boost.Asio](http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio.html) is a possibility. – wkl Nov 09 '11 at 18:32
  • 1
    C# can run on linux too - http://www.mono-project.com/Main_Page – Daniel Nov 09 '11 at 18:33
  • At http://lars.ruoff.free.fr/xmlcpp/ there's a comparison of free XML libraries. Maybe it's helpful to you. – celtschk Nov 09 '11 at 18:34

3 Answers3

1

Qt will do what you want.

Also seconding Dani's suggestion that you might as well try to run C# applications on Mono before porting to C++.

themel
  • 8,825
  • 2
  • 32
  • 31
0

Themel has already answer this. I just want to help with this answer. When i was implementing this in QT4 it gives error: QtNetwork and QTWidget not found. To solve this error in QT4 - 1. remove #include and add #include 2. add QT += network in your project (.pro) file.

haresh
  • 106
  • 1
  • 6
0

The Qt framework not only provides graphical toolkits, but also a C++ framework for portable network applications (same code using Qt should work on Windows, Linux, MacOSX), notably thru its QtNetwork module. (You can use Qt without any graphics involved).

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547