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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:53:01+00:00 2026-06-09T19:53:01+00:00

I have main.c, snmpy.c, snmpy.o, and a makefile. I running this on a Linux

  • 0

I have main.c, snmpy.c, snmpy.o, and a makefile. I running this on a Linux Server through command line. Here is what is all of them…

main.c:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "snmpy.h"

int main(void) {

   char* message = sayHello();

   printf("%s", message);

   return 0;
}

snmpy.c:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "snmpy.h"

char* sayHello(){

   char* hiya = "Hello!!\n";

   return hiya;

}

snmpy.h:

char* sayHello();

makefile:

# Compiler
CC = /usr/bin/gcc

# Name of program
PROG = snmpy

# The name of the object files
OBJS = snmpy.o main.o

# All the header and c files
SRCS = main.c snmpy.c
HDRS = snmpy.h

# Add -I to the dir the curl include files are in
CFLAGS = -c -g -std=c99 -Wall

# Build the executable file
$(PROG): $(OBJS)
        $(CC) $(CFLAGS) $(OBJS) -o $(PROG)

# Seperately compile each .c file
main.o: main.c snmpy.h
        $(CC) $(CFLAGS) -c main.c

snmpy.o: snmpy.c snmpy.h
        $(CC) $(CFLAGS) -c snmpy.c

# Clean up crew
clean:
        rm -fv core* $(PROG) $(OBJS)

cleaner: clean
        rm -fv #* *~

When I compile it it gives me this error:

/usr/bin/gcc -c -g -std=c99 -Wall snmpy.o main.o -o snmpy
gcc: snmpy.o: linker input file unused because linking not done
gcc: main.o: linker input file unused because linking not done

Not sure what’s going on whether there is something I’m not doing right, or if I didn’t install something. I’m a noob at making make files. I haven’t done them in a while.

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-09T19:53:02+00:00Added an answer on June 9, 2026 at 7:53 pm

    Re:

    /usr/bin/gcc -c -g -std=c99 -Wall snmpy.o main.o -o snmpy
    

    The -c option in the command means compile (but don’t link). The result of this will be .o (object) files.

    Try the command without the -c, it should link and create your snmpy executable.

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

Sidebar

Related Questions

I have 2 classes within same package. Both classes have main method in them.
Hi all i have main form with a treeview control with a set of
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have main function like this: void main() { char *s; inputString(s); printf(%s,s); }
I have main activity which call other object, for example GPS class. This GPS
I have main style.css and the one provided with third party // Include main
I have main(){... float **tree; //How to set some values here for e.g. If
This is what i have: Main.mxml: <fx:Style source=Main.css/> <s:TextInput x=72 y=95 focusColor=#CECB02 prompt=E-mail: skinClass=components.TextInputSkin/>
I have main window and in this window I have QListWidget. I want this
I have main UIScrollView with lots off buttons which i create like this: UIButton

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.