LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 12-24-2012, 07: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, 09:41 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
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
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, 02:27 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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, 02:59 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

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



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

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 10:35 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
Open Source Consulting | Domain Registration