Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing boost lib within a shared object in Eclipse - undefined reference
    primarykey
    data
    text
    <p>I am trying to create a shared object (myLib.so) for a project I am doing. and I have created a separate eclipse 'project' to try and use/test the shared object - they are in the same workspace.</p> <p>When I compile the project for the shared object (which uses the boost libraries thread etc) everything compiles file and I get no errors.</p> <p>When I compile the test program and try to link it to myLib.so I get the following errors:</p> <pre><code>/path/lib.so: undefined reference to `boost::thread::interrupt()' /path/lib.so: undefined reference to `vtable for boost::detail::thread_data_base' /path/lib.so: undefined reference to `boost::detail::thread_data_base::~thread _data_base()' /path/lib.so: undefined reference to `typeinfo for boost::detail::thread_data_base' /path/lib.so: undefined reference to `boost::thread::start_thread()' /path/lib.so: undefined reference to `boost::this_thread::sleep(boost::posix_time::ptime const&amp;)' </code></pre> <p>I am unsure if I am compiling myLib.so wrong, or if I have incorrect settings for the test project. As I say, when I compile myLib.so separately everything seems to work fine but when I compile the test program (which recompiles myLib.so for some reason) it seems to go wrong. </p> <p>I have myLib.so's source code included in the compiler for the test project, and I have myLib.so included in the linker libraries for the test project.</p> <p>If anyone could provide some assistance it would be greatly appreciated. Need any more info please ask.</p> <p>Thanks,</p> <p>Extra info:</p> <p>Make file for the lib.so</p> <pre><code>-include ../makefile.init RM := rm -rf # All of the sources participating in the build are defined here -include *several-different-files*.mk mostly blank, LIB is blank ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) -include $(C++_DEPS) endif ifneq ($(strip $(C_DEPS)),) -include $(C_DEPS) endif ifneq ($(strip $(CC_DEPS)),) -include $(CC_DEPS) endif ifneq ($(strip $(CPP_DEPS)),) -include $(CPP_DEPS) endif ifneq ($(strip $(CXX_DEPS)),) -include $(CXX_DEPS) endif ifneq ($(strip $(C_UPPER_DEPS)),) -include $(C_UPPER_DEPS) endif endif -include ../makefile.defs # Add inputs and outputs from these tool invocations to the build variables # All Target all: libmyLIB.so # Tool invocations libmyLIB.so: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Invoking: GCC C++ Linker' g++ -shared -o "libmyLIB.so" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' # Other Targets clean: -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(LIBRARIES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libPS.so -@echo ' ' .PHONY: all clean dependents .SECONDARY: -include ../makefile.targets </code></pre> <p>Makefile for the test setup</p> <pre><code>-include ../makefile.init RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include src/subdir.mk -include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) -include $(C++_DEPS) endif ifneq ($(strip $(C_DEPS)),) -include $(C_DEPS) endif ifneq ($(strip $(CC_DEPS)),) -include $(CC_DEPS) endif ifneq ($(strip $(CPP_DEPS)),) -include $(CPP_DEPS) endif ifneq ($(strip $(CXX_DEPS)),) -include $(CXX_DEPS) endif ifneq ($(strip $(C_UPPER_DEPS)),) -include $(C_UPPER_DEPS) endif endif -include ../makefile.defs # Add inputs and outputs from these tool invocations to the build variables # All Target all: TestingmyLIB # Tool invocations TestingmyLIB: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Invoking: Cross G++ Linker' g++ -L"/PATH" -o TestingLIB$(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' # Other Targets clean: -$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) TestingLIB -@echo ' ' .PHONY: all clean dependents .SECONDARY: -include ../makefile.targets </code></pre> <p>Also one of the mk files the makefile for the test setup references (objects.mk) contains LIBS := -lmyLIB</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload