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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:13:20+00:00 2026-06-03T19:13:20+00:00

“I get an error when I try to my application with a make file.

  • 0

“I get an error when I try to my application with a make file. This is my first attempt at creating a make file myself and i found many examples online, but i cannot get mine to work. The error i get, however is a compile error, that what i compile manually, i do not get. The error is:

`dave@ubuntu:~/School/CS647/Programs/Homework4$ make
g++ -Wall -o StatWrapper StatWrapper.o tools.o
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [StatWrapper] Error 1

`
Here is my make file:

CC = g++
CFLAGS = -Wall
UTILDIR = ../../Utilities/
OBJECTS =  Sweeper.o FileID.o P4Ford.o DirentWrapper.o StatWrapper.o tools.o

all: StatWrapper DirentWrapper FileID Sweeper P4Ford

#P4Ford: $(OBJECTS)
#   $(CC) $(OBJECTS) -o P4Ford

DirentWrapper: DirentWrapper.o tools.o
    $(CC) $(CFLAGS) -o DirentWrapper DirentWrapper.o tools.o

StatWrapper: StatWrapper.o tools.o
    $(CC) $(CFLAGS) -o StatWrapper StatWrapper.o tools.o

P4Ford: P4Ford.o Sweeper.o
    $(CC) $(CFLAGS) -o P4Ford P4Ford.o Sweeper.o

Sweeper: Sweeper.o FileID.o StatWrapper.o DirentWrapper.o tools.o
    $(CC) $(CFLAGS) -o Sweeper Sweeper.o FileID.o StatWrapper.o DirentWrapper.o tools.o

FileID: FileID.o tools.o
    $(CC) $(CFLAGS) -o FileID FileID.o tools.o

#tools: tools.o
#   $(CC) $(CFLAGS) $(UTILDIR)tools.cpp

# dependencies ---------------------------------------------------
DirentWrapper.o: $(UTILDIR)DirentWrapper.cpp  $(UTILDIR)DirentWrapper.hpp
StatWrapper.o: $(UTILDIR)StatWrapper.cpp  $(UTILDIR)StatWrapper.hpp
P4Ford.o: P4Ford.cpp  Sweeper.hpp
Sweeper.o: Sweeper.cpp  FileID.hpp
FileID.o: FileID.cpp  $(UTILDIR)tools.hpp
tools.o: $(UTILDIR)tools.cpp $(UTILDIR)tools.hpp

# cleanup
clean:
    rm -f $(OBJECTS)

I believe this is an issue with my make file because it works when i compile manually, but i can’t be sure.

Thanks in advance.

  • 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-03T19:13:22+00:00Added an answer on June 3, 2026 at 7:13 pm

    Just add -c to the rules building object files. Without this the compiler assumes you are creating an executable which requires main() to be defined. The -c flag indicates the no linking shall be done, yet.

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

Sidebar

Related Questions

I'm using this code to make #sidebar 's height match #post_content 's height: <script
I want to change all headers, normally this is quite easy (and it probably
I have a custom converter to select a Country in a SelectOneMenu component: File:
I have just tried to save a simple *.rtf file with some websites and
I'm looking for a way to convert text like this: <!DOCTYPE html PUBLIC \-//W3C//DTD
In the following code I am trying to get the select box to display
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have html encoded strings in a database, but many of the character entities
I have a web application which provides Excel files via IE 7. It requests
I've put together this small little piece but I'm having problems with the renderings

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.