Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.


  Search this Thread
Old 12-24-2012, 07:46 AM   #1
LQ Newbie
Registered: Dec 2012
Posts: 3

Rep: Reputation: Disabled
Issue with GMAKE


I just have a query,In my project im using GCC Compiler for compilation which uses Solaris DMAKE.
Now im migrating this to GMAKE. But Normally GMAKE by default picks g++ Compiler for compilation.
Im getting lot of errors since my code based out of GCC
Anybody help me out how to resolve this issue, So that my makefile based out of GMAKE should pick GCC Compiler for compilation.

Thanks in advance!!
Old 12-25-2012, 09:41 AM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,736

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
Make sure your source files are named correctly.
The default gnu make rules compile *.c with gcc, *.cc, *.C and *.cpp with g++.
The compiler changes if you change the value of predefined variables CC and CXX, so don't do that.
Old 12-25-2012, 11:57 PM   #3
LQ Newbie
Registered: Dec 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hello Pond im not changing the predefined variables. My intention is i want to change the default compiler that gmake uses that is g++ to gcc compiler.
Old 12-28-2012, 02:27 PM   #4
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,689

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Originally Posted by View Post
My intention is i want to change the default compiler that gmake uses that is g++ to gcc compiler.
That doesn't make sense.
C and C++ are different programming languages which use different compilers. As smallpond already stated, gmake (and dmake or make for that matter) pick the correct compiler depending on the source code extension.
Old 12-28-2012, 02:59 PM   #5
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,010

Rep: Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625Reputation: 2625
anyway, if you want to change the compiler you must modify those predefined variables, not the make utility itself. Using g++ instead of gcc is not a good idea, because gcc is a c compiler, g++ is a c++ compiler (as it was mentioned). replacing the make system will not solve this issue and also you may get additional problems because of the differences (incompatibilities) between them


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gmake in solaris 8 snq Solaris / OpenSolaris 1 02-19-2009 08:03 AM
where can i find gmake abd_bela Debian 4 02-17-2009 11:02 AM
gmake install nedzer Linux - Newbie 4 12-12-2008 03:55 PM
gmake query answerme Programming 1 04-13-2008 03:12 PM
Make or gmake? RobertoBech Slackware 2 06-22-2007 05:42 AM

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration