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 1092091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:37:51+00:00 2026-05-16T23:37:51+00:00

This is the first time I am writing a makefile. This doesn’t work (for

  • 0

This is the first time I am writing a makefile. This doesn’t work (for example, if I modify ClientSocket.cc it just says “uptodate”. Also throws up lots of dependency errors if I run make myprog). Can you please tell what is wrong in this?
Thank you

myprog: myprog.o Client.o ClientSocket.o Socket.o  
     g++  -Wall -g   Socket.o ClientSocket.o Client.o myprog.o -o myprog

myprog.o: myprog.cc  
    g++ -Wall -g -c myprog.cc

Client.o:  Client.cc Client.h
    g++ -Wall -g -c Client.cc

ClientSocket.o: ClientSocket.cc ClientSocket.h
    g++ -Wall -g -c ClientSocket.cc


Socket.o: Socket.cc Socket.h
    g++ -Wall -g -c Socket.cc

Errors when running make myprog:

   cc   mprog.o   -o myprog
   myprog.o: In function `std::__verify_grouping(char const*,   unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
   myprog.cc:(.text+0xe): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'

There are many others. Like:

          myprog.cc:(.text+0x1a4): undefined reference to `std::cout'
          myprog.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
          collect2: ld returned 1 exit status
  • 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-05-16T23:37:52+00:00Added an answer on May 16, 2026 at 11:37 pm

    Make sure you are using tabs to indent the command lines (it’s impossible to tell whether you are or not from the post, since they would probably be converted to spaces).

    EDIT:

    From the cc line and the error messages, it looks like make is using its implicit rule for linking, completely ignoring the one you provided (the first one). I can’t see anything in the makefile that would cause this. A few more things to check:

    1. Try running other rules by typing, e.g., make Client.o and seeing if they work.
    2. Check that all the files are in your current directory, and that the makefile is named Makefile
    3. Again, I’m sure that it’s just the formatting in the post, but your first rule is indented one more space than the other ones. You said you checked it, and I trust you, but I really can’t see anything else wrong here.

    I know these suggestions are like tech support asking you whether your computer is plugged in, but everything really looks fine to me. I even copied it, fixed the whitespace, and ran it on my machine. Everything seemed to work.

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

Sidebar

Related Questions

Disclaimer: This is my first time writing unit tests...be gentle! :) I am trying
This is the first time, I am involved in writing a complete client for
thanks in advance for attention. It's the first time i am writing on this
I come from an Actionscript3 background and this is my first time writing any
Hey everyone.. This is my first time writing an ASP.NET MVC web app, and
This is my first time writing a web service client, it's funny, I have
First time posting in Stack Overflow, hope I'm doing this right. I'm writing an
This is my first time writing code that allows a user to download a
This is my first time re-writing urls to be SEO friendly. Here's my htaccess
Ok first, please assume that this is the first time I will be writing

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.