ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am willing to write some programs in C/C++ for Solaris machine.
I am pretty good in C++ programming for PC.
But I have some questions, while starting programming in solaris.
1. Which one is the most suitable & easy to use compiler?
(Most probabaly I will use vi editor to edit programs, any suggestions welcomed)
2. From where I can get that compiler and how to install the compiler
3. From where I can get C/C++ libraries for Solaris/UNIX?
4. How to start compiling and running program?
5. Will those programs written portable on both LINUX/SOLARIS?
I am willing to write some programs in C/C++ for Solaris machine.
I am pretty good in C++ programming for PC.
But I have some questions, while starting programming in solaris.
1. Which one is the most suitable & easy to use compiler?
(Most probabaly I will use vi editor to edit programs, any suggestions welcomed)
Sun provides a compiler that you can use, but be prepared to spend money on it. If you want something free, then use GCC.
Quote:
Originally Posted by Asteroid
2. From where I can get that compiler and how to install the compiler
3. From where I can get C/C++ libraries for Solaris/UNIX?
These are included with the compiler. Other libraries with the OS.
Quote:
Originally Posted by Asteroid
4. How to start compiling and running program?
1) Edit your program; save to a .c (or .cpp) file
2) gcc file.c -o file
3) ./file
For C++ files, use 'g++' in lieu of 'gcc'.
Quote:
Originally Posted by Asteroid
5. Will those programs written portable on both LINUX/SOLARIS?
Only you can assure this. Make sure that you stick with the standards and POSIX compliant libraries. Using the following GCC flags is helpful too: -ansi -pedantic
Last edited by dwhitney67; 02-10-2009 at 08:17 AM.
Some further developments. I came to know I have GCC on both LINUX and SUN.
So, Am I ready to start writing code? and distributing executables to any of the machines LINUX/SUN for execution. Should I compile SUN distribution on SUN machine and LINUX distribution on LINUX machine.
Need you suggestions....
SUN:
Quote:
root@M1 # gcc --version
gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@M-01 # uname -a
SunOS M 5.10 Generic_127112-10 i86pc i386 i86pc Solaris
You have new mail in /var/mail//root
LINUX:
Quote:
[root@mrbtselfcare ~]# gcc --version
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@mrbtselfcare ~]# uname -a
Linux mrbtselfcare 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux
You have new mail in /var/spool/mail/root
Appreciating a lot, the way you are assisting. please let me know how can I use the above tool mentioned by you.
Thank you.
Well, the tool is FOSS, but the officially released version is quite old. I guess you can contact me through PM and give some Email of yours.
I'll send you the tarball and instructions - basically, just a single (though long) command line. The tool is supposed to do everything automatically, beginning from downloading sources from the net.
If you have problems, contact me back, I'll try to help you.
In 2006 the tool was capable of building gtk+ and all its dependencies on Solaris.
The tool is my workhorse, i.e. I'm building the needed for me infrastructure using it.
My "egoistic" interest is to try the tool on Solaris again - I do not have access to Solaris, especially, I do not have access to SPARC Solaris.
No , we cannot upgarde.
Will this GCC version will not bring out most of my programs, any problems expected to be faced due to this version?
On the one hand, gcc-3.4.6 is a good compiler.
On the other, later gcc versions, especially the gcc-4.3.* thread, are much stricter WRT to language.
So, if you use gcc-3.4.6 to develop your programs, they might fail to work if compiled with a later gcc version.
The beauty of the offered AppsFromScratch is that you change _nothing_ at system level, and you do not even need root permissions to build and install the stuff.
I.e. you can build your own up to date programming "universe" without breaking the existing system and without having any conflict with it.
I am willing to write some programs in C/C++ for Solaris machine.
I am pretty good in C++ programming for PC.
But I have some questions, while starting programming in solaris.
1. Which one is the most suitable & easy to use compiler?
(Most probabaly I will use vi editor to edit programs, any suggestions welcomed)
2. From where I can get that compiler and how to install the compiler
3. From where I can get C/C++ libraries for Solaris/UNIX?
4. How to start compiling and running program?
5. Will those programs written portable on both LINUX/SOLARIS?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.