Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > need helping with g++

need helping with g++
Thread Tools
Addicted to MacNN
Join Date: Aug 2000
Location: Retired
Status: Offline
Reply With Quote
Apr 10, 2002, 12:15 PM
 
hi!

I have a makefile for a project (who name I cannot mention) and it called gcc and g++ instead of cc and c++. I've removed all references to gcc and g++ I could find in the makefile yet it still is calling for them when run. Any help would be appreciated. Here's the makefile:

GCCOPTFLAGS = -I$(QTDIR)/include -DQT_THREAD_SUPPORT -Isrc -DNDEBUG -DNAME=\"Ozone\" -Isrc/muscle -DBETA -DQT_DLL -O2
LFLAGS =
LIBS = -L$(QTDIR)/lib -lqt-mt
EXECUTABLES = Ozone
OBJFILES = aboutdlg.o aboutdlgimpl.o chattext.o checkgroup.o colors.o combo.o debug.o formatting.o gotourl.o main.o menubar.o moc_aboutdlg.o moc_aboutdlgimpl.o moc_chattext.o moc_combo.o moc_debug.o moc_htmlview.o moc_netclient.o moc_privatewindow.o moc_privatewindowimpl.o moc_winsharewindow.o netclient.o privatewindow.o privatewindowimpl.o textevent.o user.o winshare_network.o winshare_parsing.o winshare_slots.o winsharewindow.o prefs.o prefsimpl.o moc_prefs.o moc_prefsimpl.o settings.o search.o moc_search.o moc_downloadimpl.o downloadimpl.o md5.o filethread.o accept.o
UICFILES = privatewindow.h privatewindow.cpp debug.h debug.cpp aboutdlg.h aboutdlg.cpp prefs.h prefs.cpp
#MOCFILES = moc_aboutdlg.h moc_aboutdlgimpl.h moc_chattext.h moc_combo.h moc_debug.h moc_htmlview.h moc_netclient.h moc_privatewindow.h moc_privatewindowimpl.h moc_winsharewindow.h moc_prefs.h moc_prefsimpl.h moc_search.h
VPATH = src
CXXFLAGS = -W -Wno-multichar $(GCCOPTFLAGS)

all : $(EXECUTABLES)

Ozone : $(UICFILES) $(OBJFILES)
$(CXX) $(LFLAGS) $(LIBS) -o $@ $(OBJFILES) ./linux/muscle.a

# stuff for moc
.PHONY=moc uic
moc:
moc src/aboutdlg.h -o src/moc_aboutdlg.cpp
moc src/aboutdlgimpl.h -o src/moc_aboutdlgimpl.cpp
moc src/chattext.h -o src/moc_chattext.cpp
moc src/combo.h -o src/moc_combo.cpp
moc src/debug.h -o src/moc_debug.cpp
moc src/htmlview.h -o src/moc_htmlview.cpp
moc src/netclient.h -o src/moc_netclient.cpp
moc src/privatewindow.h -o src/moc_privatewindow.cpp
moc src/privatewindowimpl.h -o src/moc_privatewindowimpl.cpp
moc src/winsharewindow.h -o src/moc_winsharewindow.cpp
moc src/prefs.h -o src/moc_prefs.cpp
moc src/prefsimpl.h -o src/moc_prefsimpl.cpp
moc src/search.h -o src/moc_search.cpp
moc src/downloadimpl.h -o src/moc_downloadimpl.cpp

# stuff for uic
uic:
uic src/privatewindow.ui -o src/privatewindow.h
uic -impl privatewindow.h src/privatewindow.ui -o src/privatewindow.cpp
uic src/prefs.ui -o src/prefs.h
uic -impl prefs.h src/prefs.ui -o src/prefs.cpp
uic src/debug.ui -o src/debug.h
uic -impl debug.h src/debug.ui -o src/debug.cpp
uic src/aboutdlg.ui -o src/aboutdlg.h
uic -impl aboutdlg.h src/aboutdlg.ui -o src/aboutdlg.cpp

clean :
rm -f *.o $(EXECUTABLES)
Power Macintosh Dual G4
SGI Indigo2 6.5.21f
     
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status: Offline
Reply With Quote
Apr 10, 2002, 02:20 PM
 
It would just be easier to create two symlinks that point gcc and g++ to cc and c++.
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
     
Addicted to MacNN
Join Date: Aug 2000
Location: Retired
Status: Offline
Reply With Quote
Apr 10, 2002, 08:18 PM
 
How do i do that?
Power Macintosh Dual G4
SGI Indigo2 6.5.21f
     
Mac Enthusiast
Join Date: Sep 2000
Location: Louisiana
Status: Offline
Reply With Quote
Apr 12, 2002, 02:18 PM
 
Open Terminal.

Type cd /usr/bin

Type sudo ln -s /usr/bin/cc gcc

(type password)

Type sudo ln -s /usr/bin/c++ g++

Now whenever a makefile looks for gcc or g++ to compile, it will use cc or c++ respectively.
B&W G3/300 OS X 10.3 Server
AL G4/1.5 OS X 10.3
Next computer G5/3.X Ghz OS X 10.x.x
     
Registered User
Join Date: May 2001
Location: Cambridge, UK
Status: Offline
Reply With Quote
Apr 16, 2002, 09:23 PM
 
Originally posted by MacGorilla:
<STRONG>hi!

I have a makefile for a project (who name I cannot mention) and it called gcc and g++ instead of cc and c++. I've removed all references to gcc and g++ I could find in the makefile yet it still is calling for them when run. Any help would be appreciated. Here's the makefile:

&lt;snip&gt;

Ozone : $(UICFILES) $(OBJFILES)
$(CXX) $(LFLAGS) $(LIBS) -o $@ $(OBJFILES) ./linux/muscle.a
</STRONG>
Symbolic links are probably the way to go, but for future reference...

Here's your problem - the variable CXX defaults to g++. From the make manual:

CC
Program for compiling C programs; default `cc'.
CXX
Program for compiling C++ programs; default `g++'.
You can tell make to call c++ by putting "CXX = c++" somewhere near the top of your makefile.

Matt
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:43 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2