Undefined symbol error

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I'm working on a base project by someone else and I'm kind of new to the Linux system.



I know how to use sqlite3 in Windows' Visual Studio, however in Linux it's not working.



I've come to the thought that it might be because of the make file, here it is:



LIBPS4 := $(PS4SDK)/libPS4

TEXT := 0x926200000
DATA := 0x926300000

CC := gcc
AS := gcc
OBJCOPY := objcopy
ODIR := build
SDIR := source
IDIRS := -I$(LIBPS4)/include -I. -Iinclude
LDIRS := -L$(LIBPS4) -L. -Llib
CFLAGS := $(IDIRS) -O2 -std=gnu11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
SFLAGS := -nostartfiles -nostdlib -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Wl,--build-id=none -Ttext=$(TEXT) -Tdata=$(DATA)
CFILES := $(wildcard $(SDIR)/*.c)
SFILES := $(wildcard $(SDIR)/*.s)
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES))

LIBS := -lPS4 -lpthread

TARGET = $(shell basename $(CURDIR)).bin

$(TARGET): $(ODIR) $(OBJS)
$(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS)
$(OBJCOPY) -O binary temp.t $(TARGET)
rm -f temp.t

$(ODIR)/%.o: $(SDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)

$(ODIR)/%.o: $(SDIR)/%.s
$(AS) -c -o $@ $< $(SFLAGS)

$(ODIR):
@mkdir $@

.PHONY: clean

clean:
rm -f $(TARGET) $(ODIR)/*.o


I'm getting an error of:



/usr/bin/ld: build/shell.o: undefined reference to symbol 'fflush@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


How do I fix it?










share|improve this question





















  • I imaging that's because you are passing CFLAGS to the link phase, and it includes -nostdlib (and your LIBS doesn't contain anything to replace the standard libraries that you are telling the linker to skip)
    – steeldriver
    Mar 29 at 23:12










  • @steeldriver "Compilation finished at Thu Mar 29 17:05:53", I did as u said and succeed in building it, however, it's a payload for the ps4 and I'm afraid to check if it works lol. is there any risk in using stdlib? why did the creator put that cflag in the first place anyway?
    – Matan Yashar
    Mar 30 at 0:08










  • Sorry - don't know
    – steeldriver
    Mar 30 at 0:17










  • @steeldriver tried on the ps4, didn't work (out of memory issue), i didn't change the sqlite code though, so i suspect that stdlib isn't working normally and the creator has changed the files. it can't even open the file using sqlite3_open, i'd give up on it for now, thank u for the great suggestion, it made me realize what the creator has done, and get to the conclusion that it'd take alot of time to make it work (recreating all the missing parts basically). thank you for your time, it's much appreciated.
    – Matan Yashar
    Mar 30 at 1:10










  • Sorry I can't be more help - good luck anyway
    – steeldriver
    Mar 30 at 1:16














up vote
1
down vote

favorite












I'm working on a base project by someone else and I'm kind of new to the Linux system.



I know how to use sqlite3 in Windows' Visual Studio, however in Linux it's not working.



I've come to the thought that it might be because of the make file, here it is:



LIBPS4 := $(PS4SDK)/libPS4

TEXT := 0x926200000
DATA := 0x926300000

CC := gcc
AS := gcc
OBJCOPY := objcopy
ODIR := build
SDIR := source
IDIRS := -I$(LIBPS4)/include -I. -Iinclude
LDIRS := -L$(LIBPS4) -L. -Llib
CFLAGS := $(IDIRS) -O2 -std=gnu11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
SFLAGS := -nostartfiles -nostdlib -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Wl,--build-id=none -Ttext=$(TEXT) -Tdata=$(DATA)
CFILES := $(wildcard $(SDIR)/*.c)
SFILES := $(wildcard $(SDIR)/*.s)
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES))

LIBS := -lPS4 -lpthread

TARGET = $(shell basename $(CURDIR)).bin

$(TARGET): $(ODIR) $(OBJS)
$(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS)
$(OBJCOPY) -O binary temp.t $(TARGET)
rm -f temp.t

$(ODIR)/%.o: $(SDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)

$(ODIR)/%.o: $(SDIR)/%.s
$(AS) -c -o $@ $< $(SFLAGS)

$(ODIR):
@mkdir $@

.PHONY: clean

clean:
rm -f $(TARGET) $(ODIR)/*.o


I'm getting an error of:



/usr/bin/ld: build/shell.o: undefined reference to symbol 'fflush@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


How do I fix it?










share|improve this question





















  • I imaging that's because you are passing CFLAGS to the link phase, and it includes -nostdlib (and your LIBS doesn't contain anything to replace the standard libraries that you are telling the linker to skip)
    – steeldriver
    Mar 29 at 23:12










  • @steeldriver "Compilation finished at Thu Mar 29 17:05:53", I did as u said and succeed in building it, however, it's a payload for the ps4 and I'm afraid to check if it works lol. is there any risk in using stdlib? why did the creator put that cflag in the first place anyway?
    – Matan Yashar
    Mar 30 at 0:08










  • Sorry - don't know
    – steeldriver
    Mar 30 at 0:17










  • @steeldriver tried on the ps4, didn't work (out of memory issue), i didn't change the sqlite code though, so i suspect that stdlib isn't working normally and the creator has changed the files. it can't even open the file using sqlite3_open, i'd give up on it for now, thank u for the great suggestion, it made me realize what the creator has done, and get to the conclusion that it'd take alot of time to make it work (recreating all the missing parts basically). thank you for your time, it's much appreciated.
    – Matan Yashar
    Mar 30 at 1:10










  • Sorry I can't be more help - good luck anyway
    – steeldriver
    Mar 30 at 1:16












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm working on a base project by someone else and I'm kind of new to the Linux system.



I know how to use sqlite3 in Windows' Visual Studio, however in Linux it's not working.



I've come to the thought that it might be because of the make file, here it is:



LIBPS4 := $(PS4SDK)/libPS4

TEXT := 0x926200000
DATA := 0x926300000

CC := gcc
AS := gcc
OBJCOPY := objcopy
ODIR := build
SDIR := source
IDIRS := -I$(LIBPS4)/include -I. -Iinclude
LDIRS := -L$(LIBPS4) -L. -Llib
CFLAGS := $(IDIRS) -O2 -std=gnu11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
SFLAGS := -nostartfiles -nostdlib -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Wl,--build-id=none -Ttext=$(TEXT) -Tdata=$(DATA)
CFILES := $(wildcard $(SDIR)/*.c)
SFILES := $(wildcard $(SDIR)/*.s)
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES))

LIBS := -lPS4 -lpthread

TARGET = $(shell basename $(CURDIR)).bin

$(TARGET): $(ODIR) $(OBJS)
$(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS)
$(OBJCOPY) -O binary temp.t $(TARGET)
rm -f temp.t

$(ODIR)/%.o: $(SDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)

$(ODIR)/%.o: $(SDIR)/%.s
$(AS) -c -o $@ $< $(SFLAGS)

$(ODIR):
@mkdir $@

.PHONY: clean

clean:
rm -f $(TARGET) $(ODIR)/*.o


I'm getting an error of:



/usr/bin/ld: build/shell.o: undefined reference to symbol 'fflush@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


How do I fix it?










share|improve this question













I'm working on a base project by someone else and I'm kind of new to the Linux system.



I know how to use sqlite3 in Windows' Visual Studio, however in Linux it's not working.



I've come to the thought that it might be because of the make file, here it is:



LIBPS4 := $(PS4SDK)/libPS4

TEXT := 0x926200000
DATA := 0x926300000

CC := gcc
AS := gcc
OBJCOPY := objcopy
ODIR := build
SDIR := source
IDIRS := -I$(LIBPS4)/include -I. -Iinclude
LDIRS := -L$(LIBPS4) -L. -Llib
CFLAGS := $(IDIRS) -O2 -std=gnu11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
SFLAGS := -nostartfiles -nostdlib -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Wl,--build-id=none -Ttext=$(TEXT) -Tdata=$(DATA)
CFILES := $(wildcard $(SDIR)/*.c)
SFILES := $(wildcard $(SDIR)/*.s)
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES))

LIBS := -lPS4 -lpthread

TARGET = $(shell basename $(CURDIR)).bin

$(TARGET): $(ODIR) $(OBJS)
$(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS)
$(OBJCOPY) -O binary temp.t $(TARGET)
rm -f temp.t

$(ODIR)/%.o: $(SDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)

$(ODIR)/%.o: $(SDIR)/%.s
$(AS) -c -o $@ $< $(SFLAGS)

$(ODIR):
@mkdir $@

.PHONY: clean

clean:
rm -f $(TARGET) $(ODIR)/*.o


I'm getting an error of:



/usr/bin/ld: build/shell.o: undefined reference to symbol 'fflush@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


How do I fix it?







c sqlite






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 29 at 21:27









Matan Yashar

63




63











  • I imaging that's because you are passing CFLAGS to the link phase, and it includes -nostdlib (and your LIBS doesn't contain anything to replace the standard libraries that you are telling the linker to skip)
    – steeldriver
    Mar 29 at 23:12










  • @steeldriver "Compilation finished at Thu Mar 29 17:05:53", I did as u said and succeed in building it, however, it's a payload for the ps4 and I'm afraid to check if it works lol. is there any risk in using stdlib? why did the creator put that cflag in the first place anyway?
    – Matan Yashar
    Mar 30 at 0:08










  • Sorry - don't know
    – steeldriver
    Mar 30 at 0:17










  • @steeldriver tried on the ps4, didn't work (out of memory issue), i didn't change the sqlite code though, so i suspect that stdlib isn't working normally and the creator has changed the files. it can't even open the file using sqlite3_open, i'd give up on it for now, thank u for the great suggestion, it made me realize what the creator has done, and get to the conclusion that it'd take alot of time to make it work (recreating all the missing parts basically). thank you for your time, it's much appreciated.
    – Matan Yashar
    Mar 30 at 1:10










  • Sorry I can't be more help - good luck anyway
    – steeldriver
    Mar 30 at 1:16
















  • I imaging that's because you are passing CFLAGS to the link phase, and it includes -nostdlib (and your LIBS doesn't contain anything to replace the standard libraries that you are telling the linker to skip)
    – steeldriver
    Mar 29 at 23:12










  • @steeldriver "Compilation finished at Thu Mar 29 17:05:53", I did as u said and succeed in building it, however, it's a payload for the ps4 and I'm afraid to check if it works lol. is there any risk in using stdlib? why did the creator put that cflag in the first place anyway?
    – Matan Yashar
    Mar 30 at 0:08










  • Sorry - don't know
    – steeldriver
    Mar 30 at 0:17










  • @steeldriver tried on the ps4, didn't work (out of memory issue), i didn't change the sqlite code though, so i suspect that stdlib isn't working normally and the creator has changed the files. it can't even open the file using sqlite3_open, i'd give up on it for now, thank u for the great suggestion, it made me realize what the creator has done, and get to the conclusion that it'd take alot of time to make it work (recreating all the missing parts basically). thank you for your time, it's much appreciated.
    – Matan Yashar
    Mar 30 at 1:10










  • Sorry I can't be more help - good luck anyway
    – steeldriver
    Mar 30 at 1:16















I imaging that's because you are passing CFLAGS to the link phase, and it includes -nostdlib (and your LIBS doesn't contain anything to replace the standard libraries that you are telling the linker to skip)
– steeldriver
Mar 29 at 23:12




I imaging that's because you are passing CFLAGS to the link phase, and it includes -nostdlib (and your LIBS doesn't contain anything to replace the standard libraries that you are telling the linker to skip)
– steeldriver
Mar 29 at 23:12












@steeldriver "Compilation finished at Thu Mar 29 17:05:53", I did as u said and succeed in building it, however, it's a payload for the ps4 and I'm afraid to check if it works lol. is there any risk in using stdlib? why did the creator put that cflag in the first place anyway?
– Matan Yashar
Mar 30 at 0:08




@steeldriver "Compilation finished at Thu Mar 29 17:05:53", I did as u said and succeed in building it, however, it's a payload for the ps4 and I'm afraid to check if it works lol. is there any risk in using stdlib? why did the creator put that cflag in the first place anyway?
– Matan Yashar
Mar 30 at 0:08












Sorry - don't know
– steeldriver
Mar 30 at 0:17




Sorry - don't know
– steeldriver
Mar 30 at 0:17












@steeldriver tried on the ps4, didn't work (out of memory issue), i didn't change the sqlite code though, so i suspect that stdlib isn't working normally and the creator has changed the files. it can't even open the file using sqlite3_open, i'd give up on it for now, thank u for the great suggestion, it made me realize what the creator has done, and get to the conclusion that it'd take alot of time to make it work (recreating all the missing parts basically). thank you for your time, it's much appreciated.
– Matan Yashar
Mar 30 at 1:10




@steeldriver tried on the ps4, didn't work (out of memory issue), i didn't change the sqlite code though, so i suspect that stdlib isn't working normally and the creator has changed the files. it can't even open the file using sqlite3_open, i'd give up on it for now, thank u for the great suggestion, it made me realize what the creator has done, and get to the conclusion that it'd take alot of time to make it work (recreating all the missing parts basically). thank you for your time, it's much appreciated.
– Matan Yashar
Mar 30 at 1:10












Sorry I can't be more help - good luck anyway
– steeldriver
Mar 30 at 1:16




Sorry I can't be more help - good luck anyway
– steeldriver
Mar 30 at 1:16















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1020388%2fundefined-symbol-error%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1020388%2fundefined-symbol-error%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

Trouble downloading packages list due to a “Hash sum mismatch” error

How do I move numbers in filenames, in a batch renaming operation?