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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:18:28+00:00 2026-06-15T06:18:28+00:00

I have a trivial problem.. I am trying to modify a working Makefile to

  • 0

I have a trivial problem.. I am trying to modify a working Makefile to link a function I decided to add in my code simpletrial.cpp (The function is IniFile.cpp)
My old working Makefile is:

include Makefile.arch
TESTS           := simpletrial.cpp
TESTO           := $(TESTS:.C=.o)
TEST            := simpletrial

OBJ             = $(TESTO)
PROGRAMS        = $(TEST)

CXXFLAGS      += 
CXXFLAGS      += 
GLIBS         += 

.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)

all:            $(PROGRAMS)

$(TEST):        $(TESTO)
        $(LD) $(LDFLAGS) $^ $(GLIBS) $(OutPutOpt)$@
        @echo "$@ done"

clean:
        @rm -f $(OBJ) $(TESTO) core *~ src/*~ include/*~

.$(SrcSuf).$(ObjSuf):
        $(CXX) $(CXXFLAGS) -c $< -o $@

I have tried without success to compile and link IniFile.cpp but I always receive the error “undefined reference to ‘IniFile:: etc etc
thanks!

  • 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-15T06:18:29+00:00Added an answer on June 15, 2026 at 6:18 am

    Your link line is the following:

    $(LD) $(LDFLAGS) $^ $(GLIBS) $(OutPutOpt)$@
    

    Here you link with $^ which is all of the pre-reqs for the rule, which in this case is $(TESTO) and that is simpletrial.o, you don’t appear to have IniFile.cpp in there, so it won’t link with it. To fix it just add IniFile.cpp to your TESTS as follows:

    TESTS           := simpletrial.cpp InFile.cpp
    

    Then it should compile and link both files together and produce simpletrial as a result.

    Additionally I think that your TESTO line might need to change as well:

    TESTO           := $(TESTS:.cpp=.o)
    

    That should take the values in the $(TESTS) variable and change the suffix from .cpp to .o, the current definition will only change .C to .o…

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

Sidebar

Related Questions

I have run into a trivial(?) problem when trying to get the whole URL
Probably a very trivial problem. I have an object that looks like this: @PersistenceCapable
I'm trying to understand how to solve this trivial problem in C, in the
I am trying to add a trivial AppleScript support to a Cocoa application. The
Trying to write a trivial application, But I have stuck into one of the
I'm having an interesting but difficult problem with my JavaScript code. Basically, I'm trying
I'm trying to do something trivial. I have a bunch of URLs that I
Seems to be a trivial problem, but can't pinpoint a solution. I have a
I am currently trying to learn C and I have come to a problem
I have written a program based on trying to solve the Knight’s Tour problem.

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.