LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices



Reply
 
Search this Thread
Old 12-24-2012, 08:46 AM   #1
btk1985@gmail.com
LQ Newbie
 
Registered: Dec 2012
Posts: 3

Rep: Reputation: Disabled
Issue with GMAKE


Hi,

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, 10:41 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 1,773

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
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-26-2012, 12:57 AM   #3
btk1985@gmail.com
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, 03:27 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by btk1985@gmail.com 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, 03:59 PM   #5
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,159

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
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
 
  


Reply


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 09:03 AM
where can i find gmake abd_bela Debian 4 02-17-2009 12:02 PM
gmake install nedzer Linux - Newbie 4 12-12-2008 04:55 PM
gmake query answerme Programming 1 04-13-2008 04:12 PM
Make or gmake? RobertoBech Slackware 2 06-22-2007 06:42 AM


All times are GMT -5. The time now is 12:25 PM.

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