/lib/i386-linux-gnu/libpthread.so.0: could not read symbols: 无效的操作

alkq1989 2014-06-03 05:38:02
如题,遇到的问题如下
Building target: PMS8
Invoking: Cygwin C++ Linker
g++ -o "PMS8" ./src/MyString.o ./src/main.o ./src/utils.o -lmpi -lmpi_cxx
/usr/bin/ld: ./src/main.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1'
/usr/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker command line
/lib/i386-linux-gnu/libpthread.so.0: could not read symbols: 无效的操作
collect2: ld returned 1 exit status
make[1]: *** [PMS8] 错误 1
make[1]:正在离开目录 `/home/lin/Documents/PMS8/Debug'
make: *** [all] 错误 2

网上搜了好长时间,具体的还是不知道我的问题在哪里,用的Ubuntu13.04版本, gcc/g++ 4.6.4版本。下载的软件包解压出来就有makefile文件文件内容如下:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-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: PMS8

# Tool invocations
PMS8: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cygwin C++ Linker'
g++ -o "PMS8" $(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) PMS8
-@echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

有谁能帮忙解决一下吗吗吗吗??多谢了!!!!
...全文
225 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
alkq1989 2014-06-14
  • 打赏
  • 举报
回复
在object.mk 文件中LIBS行加上-lpthread

18,771

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧