This topic has been archived. It cannot be replied.
-
相约北美 / 移民留学 / 请教4个问题1) how can one compile a C++ program in UNIX?
2) if one needed to modify a C++ program to enhance user interface, what
would you suggest? ( write codes in C then convert to C++? ;
learn C++? Or learn shell programming? Or )
3) can you mix C & C++ together?
4) *.sh what kind of file is this? How could we run it in Unix?
-linnet(会飞的鸟);
2001-10-14
{334}
(#224698@0)
-
The first one is cc *.c, I guess.
-pyramid(金字塔);
2001-10-14
(#224716@0)
-
1. cc or gcc, g++. 2. Do not know. 3. Yes. But some recently compilers do not support it. Try and see. 4. Shell?
-kingmay(mike);
2001-10-14
(#224723@0)
-
FYI1. Use gcc, it's free.
2. What is the UI, GUI? or just command UI? Anyway, I prefer to learn C++, it's not difficult. For GUI, on UNIX, I think you should have to learn Motif or X Window programming, on Windows, MFC is the best one. And shell programming can't provide GUI function.
3. You can mix, but for C code, do not forget use extern "C"
4. Maybe it's a B shell script, actually, you needn't put .sh for shell script file, but sometime it makes clear.
-dibert(呆伯);
2001-10-16
{467}
(#226843@0)
-
The answers (with much details) to questions 1 to 3 can be found from any C/C++, UNIX FAQs, try http://www.dejanews.com/
The answer to 4 is not sure, not until youopen that file and take a look at it's first line. Before you do that, make sure it's not binary (to mess up your terminal), do a "file *.sh". It's usually a Borne, Borne Again or Korn shell script as other misters have mentioned.
-mocha(Mocha Java);
2001-10-16
{235}
(#226865@0)