Question:

A c++ program that compiles using MinGw g++, will compile on UNIX G++?

by  |  earlier

0 LIKES UnLike

Hi,

I have written C++ program. Requirement is program must run on UNIX using g++ compiler. But I have windows OS, and so I have installed MinGw g++ complier that works under windows.

My question is a program that compiles using mingw g++ on windows will compile on UNIX g++ ?

 Tags:

   Report

2 ANSWERS


  1. as long as you save all of your original files as flat files you should have no problems and you are using standard calls but be sure to back up all of your files regardless that is just good practice.

    you may have to copy and past into flat files all you written codes, as long as your C++ program was not written for Windows and for command line it should work

    you just need to use standard calls in unix g++ but you know that part


  2. Make sure there are no system calls or other quirky things on your C++ program.  If you need direct screen access such as conio.h uses call curses.h (and make sure you have ncurses or pdcurses installed.  You should be able to get either.

    I've seen a lot of good code written on Windows GCC which failed to compile on UNIX GCC.  A safer method of compiling would be to get the Knoppix or FreeSBIE livecds and use their compilers.  Those are live cds which run Unix or Unix-derived OSes which come with GCC and g++ installed natively.  And you can save the code to disk or at worst email it to yourself.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.