• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

C++ Compatibility between windows and linux

Hi,

I need to develop a solution in C++ that needs to run on a Linux operating system. however, i don't have said OS installed, therefore I'm going to have to build the solution under windows.

Can someone please tell me if there are any incompatibility issues between the two operating systems, and also anything else I might need to look out for.

Lastly, once I have finished building the solution, is there anything I will need to do in order to port it over to the linux system? or is it a matter of just copying over the source code and running it?

Thanks
0
gem56
Asked:
gem56
  • 3
  • 2
  • 2
  • +2
3 Solutions
 
TintinCommented:
What's the nature of your code?  eg: GUI, game, device driver, etc.
0
 
ozoCommented:
Does the code make any system calls?
0
 
lucky_jamesCommented:
You need to avoid the following :
1. Use of mfc or any class library provided for windows exclusively. (eg. Use of GetDlgItem or any such API). Avoid any COM/DCOM calls as well.
2. Avoid using any wizard help as well. eg. Class Wizard. Create an empty project here in windows.Code, compile. Now create an empty project on Linux, copy paste the code.
3. Avoid making any windows system calls or messages. eg.  NtAlpcConnectPort or WM_CLOSE message etc.

These are very broad guide lines. Let me know if you have any doubt.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
gem56Author Commented:
The solution will be very small, only perhaps half a dozen modules. so I'm estimating only maybe 200-300 lines of code.

Its a very simple console application that just basically reads values and coordinates from text files and tries to draw them up in a VERY basic raster output.

Like I say, its just going to be a very basic app, however its my first stab at Linux, so I just want to know what dramas (if any) I'm going to be facing.

Thanks
0
 
ozoCommented:
How do you communicate with the raster device?
0
 
lucky_jamesCommented:
As you say its is console based. So, c++ support should be able to get through. eg cout.
Check the way you are getting file pointer. Is it any windows API you are making use for that.
Playing with the file pointer should not cause any worry for you.
Graphics may prove to be other point of concern. if you are using basic c++ graphics, it should do.
0
 
lucky_jamesCommented:
The use of graphics.h may also cause problem.

check out:
http://www.linuxforums.org/forum/linux-programming-scripting/850-windows-h.html
0
 
gem56Author Commented:
Thanks for the help guys.

Yeah doesnt look like the simplicity of my application will be anywhere near the danger zone for compatibility between the two OS's.

My output method is just basically through the iostream, so again, doesnt look like theres any worries here.

Thanks a lot for all the help guys :)
0
 
Infinity08Commented:
Just for the record : as long as you stick to standard C++, and only make use of the standard C++ libraries, the porting should not be complicated (if you have to do anything at all).
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now