problems building a driver for a ticket printer

dostoyevski

New Member
Joined
Oct 27, 2020
Messages
27
Reaction score
6
Credits
208
hello i have a .c file that i have to build. I have the makefile which is this:
----------------------------------------------------------------
CC=gcc
RM=rm -f
CFLAGS=-Wl,-rpath,/usr/lib -Wall -fPIC -O3
LDFLAGS=
LDLIBS=`cups-config --image --libs`

SRCS=rastertoxp58.c
OBJS=$(subst .c,.o,$(SRCS))

all: rastertoxp58

rastertoxp58: $(OBJS)
gcc $(LDFLAGS) -o rastertoxp58 rastertoxp58.o $(LDLIBS)

rastertoxp58.o: rastertoxp58.c
gcc $(CFLAGS) -c rastertoxp58.c
---------------------------------------------------------------
and when i execute the "make" command into the folder which contains the both files i get this error:

----------------------------------------------------------
astertoxp58.c: At top level:
rastertoxp58.c:89:16: warning: ‘rasterModeStartCommand’ is static but used in inline function ‘rasterheader’ which is not static
89 | outputCommand(rasterModeStartCommand);
| ^~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:16: rastertoxp58.o] Error 1
--------------------------------------------------------------


what can i do to solve it?
thank you!
 


You can try this...

Save a backup of your make file.
Edit the CFLAGS in your makefile to this.

CFLAGS=-Wl,-rpath,/usr/lib -Wall -fPIC -O3 -std=gnu89
 
So you're calling a static function inside an inline function that is NOT static?
It's been a while since I've dealt with inline functions in C. Doesn't the inline function also need to be static? I can't remember offhand!! ....

What are the delarations of the two functions?
 

Members online


Latest posts

Top