Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8854967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:00:44+00:00 2026-06-14T14:00:44+00:00

I am coding in OS X Here is my Makefile: #makefile for stack_5_1 #

  • 0

I am coding in OS X
Here is my Makefile:

#makefile for stack_5_1
# Yitong Zhou

stack_5 : main.o Stack.o LIFO_Stack.o Peekback_Stack.o
    g++ -o stack_5 main.o Stack.o LIFO_Stack.o Peekback_Stack.o
main.o: main.cpp Stack.h LIFO_Stack.h Peekback_Stack.h
    g++ -c main.cpp
Stack.o: Stack.cpp Stack.h
    g++ -c Stack.cpp
LIFO_Stack.o: LIFO_Stack.cpp LIFO_Stack.h
    g++ -c LIFO_Stack.cpp
Peekback_Stack.o: Peekback_Stack.cpp Peekback_Stack.h
    g++ -c Peekback_Stack.cpp

clean: 
    rm -rf *.o stack_5 

The error:

.....  // very very long 
Dwarf Exception Unwind Info (__eh_frame) in Stack.o
Dwarf Exception Unwind Info (__eh_frame) in LIFO_Stack.o
Dwarf Exception Unwind Info (__eh_frame) in Peekback_Stack.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [stack_5] Error 1

What is the difference between gcc and g++? Why does my compile fail when I replace g++ with gcc?

By the way, how could I ensure that my makefile could be run correctly in Cygwin, linux, OS X and maybe other environment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:00:45+00:00Added an answer on June 14, 2026 at 2:00 pm

    gcc is for compiling C by default

    g++ is for compiling C++ by default

    The primary difference is that g++ transparently adds the options -x c++ (use C++) and -lstdc++ (use C++ standard library).

    Try this Makefile:

    stack_5: main.o Stack.o LIFO_Stack.o Peekback_Stack.o
    
    main.o: main.cpp Stack.h LIFO_Stack.h Peekback_Stack.h
    
    Stack.o: Stack.cpp Stack.h
    
    LIFO_Stack.o: LIFO_Stack.cpp LIFO_Stack.h
    
    Peekback_Stack.o: Peekback_Stack.cpp Peekback_Stack.h
    

    make will automatically fill in the sensible rules based on the file extensions.

    Also take a look at the -MM gcc option. It will automatically generate the correct make dependencies (which header files) so you don’t need to maintain this list manually. There is more in the make manual and gcc manual about how to use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my coding which gives me the error 'warning: unknown conversion type character
Here's a very specific coding question: I've recently been asked to maintain some old-ish
I'm sure I'm not following correct game coding conventions here, but I'm very much
Pretty new flixel/AS3 user here, though not entirely new to coding. Anyways, the error
Here my question is not related with coding, I want to know that how
A long shot but here's hoping someone has some experience coding PHP hooks for
The coding is in ASP.NET 3.5. Here is the scenario. I am modifying a
I'm relatively new to coding so please help me out here. The code will
Edit: OK I asked the wrong question here. I'm going to be coding a
i am using esql to select by using entity framework Here is my coding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.