pthread_create中遇到错误
当我在Linux中使用pthread_create中遇到错误,c,linux,gdb,pthreads,C,Linux,Gdb,Pthreads,当我在Linux中使用gdb一步一步地运行代码时,出现了这样一个错误。在(gdb)s之后, 我收到了这些信息: __pthread_create_2_1 (newthread=0x7fffffffdcc0, attr=0x0, start_routine=0x400cdf <sendMessage>, arg=0x7fffffffdcd0) at pthread_create.c:472 472 pthread_create.c: No such file or directory.
gdb
一步一步地运行代码时,出现了这样一个错误。在(gdb)s
之后,
我收到了这些信息:
__pthread_create_2_1 (newthread=0x7fffffffdcc0, attr=0x0,
start_routine=0x400cdf <sendMessage>, arg=0x7fffffffdcd0)
at pthread_create.c:472
472 pthread_create.c: No such file or directory.
\uuuu pthread\uu create\u2\u1(newthread=0x7fffffffdcc0,attr=0x0,
启动(例程=0x400cdf,参数=0x7fffffffdcd0)
在pthread_create.c:472
472 pthread_create.c:没有这样的文件或目录。
我使用“gcc-pthread-Wall-o
”来构建和链接我的C源文件,除了一些警告之外,没有发生任何错误。
我不知道怎么处理它。
我看这里没有问题
您启动了程序,并在调用pthread\u create
之前设置了一个断点,因此调试器暂停在那里
然后您尝试进入pthread\u create
。调试器对此没有问题
调试器知道pthread\u create
是在pthread\u create.c
的第472行定义的-但是,它实际上没有pthread\u create.c
的副本。因此,它让您知道它无法显示源代码,这就是此消息的含义:
472 pthread_create.c: No such file or directory.
您可能希望使用
n
(next
)而不是s
(step
)跳过pthread\u create
调用。@AlterMann-pthread
是正确的。具体问题是什么?键入s
后您希望发生什么?非常感谢!我现在就试试~~明白了!非常感谢~~