i did it as you said buy it gives same error : -
------------ Build: Debug in datemanip (compiler: GNU GCC Compiler)---------------
g++ -shared obj/Debug/Adddays.o obj/Debug/Addmonths.o obj/Debug/Addyears.o obj/Debug/Cmpdate.o obj/Debug/Datefmt.o obj/Debug/Diffdays.o obj/Debug/Diffymd.o obj/Debug/Julian.o obj/Debug/Leap.o obj/Debug/Subdays.o obj/Debug/Submonths.o obj/Debug/Subyears.o obj/Debug/Valid.o obj/Debug/Weekday.o -o bin/Debug/libdatemanip.so -lfPIC
/usr/bin/ld: obj/Debug/Datefmt.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
obj/Debug/Datefmt.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
i also added a flag in compiler flags
bujtist gives same error :-
-------------- Build: Debug in datemanip (compiler: GNU GCC Compiler)---------------
g++ -shared obj/Debug/Adddays.o obj/Debug/Addmonths.o obj/Debug/Addyears.o obj/Debug/Cmpdate.o obj/Debug/Datefmt.o obj/Debug/Diffdays.o obj/Debug/Diffymd.o obj/Debug/Julian.o obj/Debug/Leap.o obj/Debug/Subdays.o obj/Debug/Submonths.o obj/Debug/Subyears.o obj/Debug/Valid.o obj/Debug/Weekday.o -o bin/Debug/libdatemanip.so -fPIC -lfPIC
/usr/bin/ld: obj/Debug/Datefmt.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
obj/Debug/Datefmt.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))