When I first came to the company, the company's C program was still 32-bit. Later, I read some documents and thought that 64-bit programs are the real trend, so I started to develop 64-bit programs. This article describes how to build a 64-bit C Language Development Environment under Solaris. I hope to help you.
(1) gcc
Solaris/usr/sfw/bin/gcc can be used to compile 64-bit C Programs, but the-m64 compilation option needs to be added. In addition, you can download the gcc source code from the gcc official website and compile and install it on your own. However, you must note that the compiled gcc must be 64-bit.
(2) gdb
64-bit gdb is required to debug 64-bit C programs. The installation steps of gdb are as follows (version 7.6 is used as an example ):
1) gunzip gdb-7.6.tar.gz
2) tar xvf gdb-7.6.tar
3) cd gdb-7.6
4) export CC = "/usr/sfw/bin/gcc-m64"
5)./configure-prefix = "/… /... (A folder path )"
6) make
7) make install
Note that the latest version of gdb is 7.7, and there is an error in compiling it under Solaris. The solution is also very simple. You can refer to this article.
(3) References
I personally think that Oracle's Solaris 64-bit Developer's Guide is the best material for developing 64-bit C Programs under Solaris. Every C language developer should take a look and I believe it will benefit a lot.
Solaris 64-bit Developer's Guide PDF download:
Free in http://linux.bkjia.com/
The username and password are both www.bkjia.com
The specific download directory is available in/July 6,/July 15,/Solaris to build a 64-bit C language development environment.
For the download method, see