I am trying to compile a C++ project containing 10 FORTRAN files via Eclipse Juno IDE in Ubuntu 16.04.
The project got compiled and .o files have been generated, while linking throws the message:
Vc3ded.o(fortran obj file) relocation R_X86_64_32S against '.rodata' cannot be used when making a shared object: recompile with -fPIC
I have tried and compiled the project with -fPIC via the Eclipse IDE settings and cross-verified the path of the shared object .so files.
The Makefile is shown below:
-include ../makefile.init
RM := rm -rf
-include sources.mk
-include src/simgear/xml/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
all: OWI_SIM
OWI_SIM: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -L/usr/lib -L/usr/local/include -L/usr/local/lib64 -L/usr/lib/x86_64-linux-gnu -o "OWI_SIM" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
clean:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) OWI_SIM
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets