Undefined symbol error

Clash 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?
c sqlite
add a comment |Â
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?
c sqlite
I imaging that's because you are passingCFLAGSto the link phase, and it includes-nostdlib(and yourLIBSdoesn'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
add a comment |Â
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?
c sqlite
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
c sqlite
asked Mar 29 at 21:27
Matan Yashar
63
63
I imaging that's because you are passingCFLAGSto the link phase, and it includes-nostdlib(and yourLIBSdoesn'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
add a comment |Â
I imaging that's because you are passingCFLAGSto the link phase, and it includes-nostdlib(and yourLIBSdoesn'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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I imaging that's because you are passing
CFLAGSto the link phase, and it includes-nostdlib(and yourLIBSdoesn'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