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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:01:37+00:00 2026-06-12T22:01:37+00:00

CC = gcc CFLAGS = -std=c99 -Werror VPATH = ./src:./include .MAIN: libstring.so .PHONY: clean

  • 0
CC = gcc
CFLAGS = -std=c99 -Werror
VPATH = ./src:./include

.MAIN: libstring.so
.PHONY: clean

libstring.o: libstring.c libstring.h
    $(CC) $(CFLAGS) -c $< -I ./include -o $@

libstring.so: libstring.o
    $(CC) -fPIC -shared $< -o $@

clean:
    rm -rf ./*.o ./*.so

In the code snippet above, I’m specifically interested in whether or not I’m using the < automatic variable correctly. This works if the source/prerequisite is a c source file, but seems to fail for object files.

When compiling, I receive the error:

gcc -fPIC -shared  -o libstring.so
gcc: No input files specified
  • 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-12T22:01:39+00:00Added an answer on June 12, 2026 at 10:01 pm

    Are you sure you’re using GNU make? The code you’ve written will work as you expect in GNU make. However, other versions of make do not support automatic variables in explicit rules, only in suffix (implicit) rules. If you’re using SunOS/Solaris make, for example, then $< will be empty on an explicit rule.

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

Sidebar

Related Questions

I am compiling from the command line with gcc -o output-file $(mysql_config --cflags) main.c
// gcc -o 0 $(pkg-config --cflags --libs gtk+-2.0) 1.c #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> struct
let's say I've got: target.o: target.h target.c gcc $(CFLAGS) -c target.c But I'd like
gcc 4.4.2 I have the following code: char channels[] = NumberOfChannel = [2]; sscanf(channels,
gcc 4.1.2 c99 I have the following enum's in this file ccsmd.h : enum
I have the file blah.c containing: #include <gobject-introspection-1.0/girepository.h> int main(int argc,char **argv) { GIRepository
gcc 4.4.4 I have the following Makefile OBJECT_FILES = brd.o logger.o test_brd.o CFLAGS =
gcc 4.4.1 C99 I am creating a client server application. I have a Makefile
I am able to compile a single file using gcc with -std=c++0x option. But
I have one shared library ,Which written in c build using arm-linux-androideabi-gcc compiler now

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.