- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我尝试用 mingw 为 Linux 上的 Win 编译一个简单的线程程序。
为此,我加载了 source并将源代码放到我的目录中。比我写了一个makefile。对于 Linux,它运行完美。但是对于 Win,我遇到了很多错误 - 其中一些我已经无法修复:
$ make
x86_64-w64-mingw32-gcc -Wall -O3 -DPTW32_STATIC_LIB -FORCEWIN -c -o main.o main.c
x86_64-w64-mingw32-gcc -Wall -O3 -DPTW32_STATIC_LIB -FORCEWIN -c -o usleep.o usleep.c
------------------------------------------
clean up
make clean
make[1]: Betrete Verzeichnis '/mnt/prog'
rm -f *.o *.obj *.exe
make[1]: Verlasse Verzeichnis '/mnt/prog'
------------------------------------------
compile pthreads as static lib
cd ./pthreads/; \
make CROSS=x86_64-w64-mingw32- clean GC-static
make[1]: Betrete Verzeichnis '/mnt/prog/pthreads'
rm -f *~
rm -f *.i
rm -f *.s
rm -f *.o
rm -f *.obj
rm -f *.exe
rm -f pthread.def
make XOPT="-DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB" CLEANUP=-D__CLEANUP_C XC_FLAGS=" " OBJ="pthread.o version.o" libpthreadGC2.stamp
make[2]: Betrete Verzeichnis '/mnt/prog/pthreads'
x86_64-w64-mingw32-gcc -c -o pthread.o -D__CLEANUP_C -O3 -DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB -I. -DHAVE_PTW32_CONFIG_H -Wall pthread.c
x86_64-w64-mingw32-windres --include-dir=. -D__CLEANUP_C -o version.o -i version.rc
rm -f libpthreadGC2.a
x86_64-w64-mingw32-ar -rv libpthreadGC2.a pthread.o version.o
x86_64-w64-mingw32-ar: Erzeugen von libpthreadGC2.a
a - pthread.o
a - version.o
x86_64-w64-mingw32-ranlib libpthreadGC2.a
echo touched > libpthreadGC2.stamp
make[2]: Verlasse Verzeichnis '/mnt/prog/pthreads'
make[1]: Verlasse Verzeichnis '/mnt/prog/pthreads'
x86_64-w64-mingw32-gcc -c ./main.c ./usleep.c -Wall -O3 -DPTW32_STATIC_LIB -FORCEWIN
------------------------------------------
create object files
usleep.o main.o
------------------------------------------
linking
x86_64-w64-mingw32-gcc ./main.o ./usleep.o ./pthreads/pthread.o -o possix.exe
./usleep.o:usleep.c:(.text+0x3c): undefined reference to `__imp_select'
./usleep.o:usleep.c:(.text+0x8c): undefined reference to `__imp_select'
/usr/bin/x86_64-w64-mingw32-ld: ./usleep.o: Falsche Verschiebungsadresse 0x0 in Abschnitt `.pdata'
/usr/bin/x86_64-w64-mingw32-ld: final link failed: Ungültiger Vorgang
collect2: ld returned 1 exit status
make: *** [prog] Fehler 1
如何解决链接问题?
到达亚莱
我的 header 包含(按照我认为它们被调用的顺序):
主.c
/*#include <errno.h> */
/*#include <fcntl.h> */
#include <inttypes.h>
#include "./pthreads/pthread.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*#include <termios.h> */
/*#include <unistd.h> */
#include "usleep.h" /* um usleep nutzen zu können */
usleep.h
...
#include "unistd.h"
#include <inttypes.h>
#include <stdio.h>
...
难道将 unistd.h 包含在 windows 目标中是错误的吗?
我另外减少了标题的数量并在任何可能的情况下更改了它们的顺序,但错误仍然存在。我不知道它来自哪里....
主程序
#include <inttypes.h> /* Spezielle int-Datentypen */
#include <stdio.h>
#if defined(FORCEWIN) || defined(_WIN64) || defined(_WIN32)
#include <time.h>
#include <winsock2.h>
#elif __unix /* all unices not caught above */
#include <sys/time.h>
#include <sys/socket.h>
#endif
usleep.h
有英文反馈
LC_ALL=C make
------------------------------------------
clean up
make clean
make[1]: Entering directory `/mnt/prog'
rm -f *.o *.obj *.exe
make[1]: Leaving directory `/mnt/prog'
------------------------------------------
compile pthreads as static lib
cd ./pthreads/; \
make CROSS=x86_64-w64-mingw32- clean GC-static
make[1]: Entering directory `/mnt/prog/pthreads'
rm -f *~
rm -f *.i
rm -f *.s
rm -f *.o
rm -f *.obj
rm -f *.exe
rm -f pthread.def
make XOPT="-DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB" CLEANUP=-D__CLEANUP_C XC_FLAGS=" " OBJ="pthread.o version.o" libpthreadGC2.stamp
make[2]: Entering directory `/mnt/prog/pthreads'
x86_64-w64-mingw32-gcc -c -o pthread.o -D__CLEANUP_C -O3 -DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB -I. -DHAVE_PTW32_CONFIG_H -Wall pthread.c
x86_64-w64-mingw32-windres --include-dir=. -D__CLEANUP_C -o version.o -i version.rc
rm -f libpthreadGC2.a
x86_64-w64-mingw32-ar -rv libpthreadGC2.a pthread.o version.o
x86_64-w64-mingw32-ar: creating libpthreadGC2.a
a - pthread.o
a - version.o
x86_64-w64-mingw32-ranlib libpthreadGC2.a
echo touched > libpthreadGC2.stamp
make[2]: Leaving directory `/mnt/prog/pthreads'
make[1]: Leaving directory `/mnt/prog/pthreads'
------------------------------------------
create object files
x86_64-w64-mingw32-gcc -c ./main.c ./usleep.c -Wall -O3 -DPTW32_STATIC_LIB -FORCEWIN
usleep.o main.o
------------------------------------------
linking
x86_64-w64-mingw32-gcc ./main.o ./usleep.o ./pthreads/pthread.o -o possix.exe
./usleep.o:usleep.c:(.text+0x3c): undefined reference to `__imp_select'
./usleep.o:usleep.c:(.text+0x8c): undefined reference to `__imp_select'
/usr/bin/x86_64-w64-mingw32-ld: ./usleep.o: bad reloc address 0x0 in section `.pdata'
/usr/bin/x86_64-w64-mingw32-ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
make: *** [prog] Error 1
我已经从 CFLAGS 中删除了 -DPTW32_STATIC_LIB
,现在我得到了这个
LC_ALL=C make
------------------------------------------
clean up
make clean
make[1]: Entering directory `/mnt/prog'
rm -f *.o *.obj *.exe
make[1]: Leaving directory `/mnt/prog'
------------------------------------------
compile pthreads as static lib
cd ./pthreads/; \
make CROSS=x86_64-w64-mingw32- clean GC-static
make[1]: Entering directory `/mnt/prog/pthreads'
rm -f *~
rm -f *.i
rm -f *.s
rm -f *.o
rm -f *.obj
rm -f *.exe
rm -f pthread.def
make XOPT="-DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB" CLEANUP=-D__CLEANUP_C XC_FLAGS=" " OBJ="pthread.o version.o" libpthreadGC2.stamp
make[2]: Entering directory `/mnt/prog/pthreads'
x86_64-w64-mingw32-gcc -c -o pthread.o -D__CLEANUP_C -O3 -DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB -I. -DHAVE_PTW32_CONFIG_H -Wall pthread.c
x86_64-w64-mingw32-windres --include-dir=. -D__CLEANUP_C -o version.o -i version.rc
rm -f libpthreadGC2.a
x86_64-w64-mingw32-ar -rv libpthreadGC2.a pthread.o version.o
x86_64-w64-mingw32-ar: creating libpthreadGC2.a
a - pthread.o
a - version.o
x86_64-w64-mingw32-ranlib libpthreadGC2.a
echo touched > libpthreadGC2.stamp
make[2]: Leaving directory `/mnt/prog/pthreads'
make[1]: Leaving directory `/mnt/prog/pthreads'
------------------------------------------
create object files
x86_64-w64-mingw32-gcc -c ./main.c ./usleep.c -Wall -O3 -FORCEWIN
usleep.o main.o
------------------------------------------
linking
x86_64-w64-mingw32-gcc ./main.o ./usleep.o ./pthreads/pthread.o -o possix.exe -v
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-w64-mingw32/4.6/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../../src/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw-w64' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-shared --enable-static --disable-multilib --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --libdir=/usr/lib --enable-libstdcxx-time=yes --with-tune=generic --enable-version-specific-runtime-libs --enable-threads=win32 --enable-fully-dynamic-string --enable-sjlj-exceptions --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-lto --with-plugin-ld --target=x86_64-w64-mingw32 --with-gxx-include-dir=/usr/include/c++/4.6 --with-as=/usr/bin/x86_64-w64-mingw32-as --with-ld=/usr/bin/x86_64-w64-mingw32-ld
Thread model: win32
gcc version 4.6.3 (GCC)
COMPILER_PATH=/usr/lib/gcc/x86_64-w64-mingw32/4.6/:/usr/lib/gcc/x86_64-w64-mingw32/4.6/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/4.6/:/usr/lib/gcc/x86_64-w64-mingw32/
LIBRARY_PATH=/usr/lib/gcc/x86_64-w64-mingw32/4.6/:/usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/lib/
COLLECT_GCC_OPTIONS='-o' 'possix.exe' '-v' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-w64-mingw32/4.6/collect2 -m i386pep -Bdynamic -o possix.exe /usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/lib/crt2.o /usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/lib/crtbegin.o -L/usr/lib/gcc/x86_64-w64-mingw32/4.6 -L/usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/lib ./main.o ./usleep.o ./pthreads/pthread.o -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/lib/crtend.o
./main.o:main.c:(.text+0x1c): undefined reference to `__imp_pthread_mutex_lock'
./main.o:main.c:(.text+0x23): undefined reference to `__imp_pthread_mutex_unlock'
./main.o:main.c:(.text+0x6b): undefined reference to `__imp_pthread_exit'
./main.o:main.c:(.text+0x8b): undefined reference to `__imp_pthread_mutex_lock'
./main.o:main.c:(.text+0x9e): undefined reference to `__imp_pthread_mutex_unlock'
./main.o:main.c:(.text+0x19c): undefined reference to `__imp_pthread_exit'
/usr/bin/x86_64-w64-mingw32-ld: ./main.o: bad reloc address 0x0 in section `.pdata'
/usr/bin/x86_64-w64-mingw32-ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
make: *** [prog] Error 1
在我看来像是来自 pthread confused 的错误
引用下面 Gavin Smith 的评论,我对 makefile 做了一些修改:
$ LC_ALL=C make
------------------------------------------
clean up
make clean
make[1]: Entering directory `/mnt/prog'
rm -f *.o *.obj *.exe
make[1]: Leaving directory `/mnt/prog'
------------------------------------------
compile pthreads as static lib
cd ./pthreads/; \
make CROSS=x86_64-w64-mingw32- clean GC-static -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
------------------------------------------
create object files
x86_64-w64-mingw32-gcc -c ./main.c ./usleep.c -Wall -g -O3 -FORCEWIN
usleep.o main.o
------------------------------------------
linking
x86_64-w64-mingw32-ld ./main.o ./usleep.o ./pthreads/libpthreadGC2.a -o possix.exe -v
GNU ld (GNU Binutils) 2.22.90.20120919
./main.o: In function `thr_ausgabe':
/mnt/prog/./main.c:66: undefined reference to `__imp_pthread_mutex_lock'
/mnt/prog/./main.c:66: undefined reference to `__imp_pthread_mutex_unlock'
/mnt/prog/./main.c:72: undefined reference to `printf'
/mnt/prog/./main.c:83: undefined reference to `__imp_pthread_exit'
./main.o: In function `thr_arbeite':
/mnt/prog/./main.c:44: undefined reference to `__imp_pthread_mutex_lock'
/mnt/prog/./main.c:46: undefined reference to `__imp_pthread_mutex_unlock'
/mnt/prog/./main.c:56: undefined reference to `__imp_pthread_exit'
./main.o: In function `main':
/mnt/prog/./main.c:89: undefined reference to `__main'
/mnt/prog/./main.c:100: undefined reference to `__imp_pthread_mutex_init'
/mnt/prog/./main.c:105: undefined reference to `__imp_pthread_create'
/mnt/prog/./main.c:116: undefined reference to `__imp_pthread_join'
/mnt/prog/./main.c:111: undefined reference to `__imp___iob_func'
/mnt/prog/./main.c:111: undefined reference to `fprintf'
/mnt/prog/./main.c:106: undefined reference to `__imp___iob_func'
/mnt/prog/./main.c:106: undefined reference to `fprintf'
./usleep.o: In function `msleep':
/mnt/prog/./usleep.c:16: undefined reference to `__imp_select'
./usleep.o: In function `usleep':
/mnt/prog/./usleep.c:33: undefined reference to `__imp_select'
make: *** [prog] Error 1
现在主要的符号是:
$ x86_64-w64-mingw32-nm main.o
0000000000000000 b .bss
0000000000000000 d .data
0000000000000000 N .debug_abbrev
0000000000000000 N .debug_aranges
0000000000000000 N .debug_frame
0000000000000000 N .debug_info
0000000000000000 N .debug_line
0000000000000000 N .debug_loc
0000000000000000 N .debug_ranges
U fprintf
U __imp___iob_func
U __imp_pthread_create
U __imp_pthread_exit
U __imp_pthread_join
U __imp_pthread_mutex_init
U __imp_pthread_mutex_lock
U __imp_pthread_mutex_unlock
0000000000000000 T main
U __main
U msleep
0000000000000000 p .pdata
0000000000000000 p .pdata.startup
U printf
0000000000000000 r .rdata
0000000000000000 t .text
0000000000000000 t .text.startup
0000000000000080 T thr_arbeite
0000000000000000 T thr_ausgabe
0000000000000000 r .xdata
0000000000000000 r .xdata.startup
我也在查看 lib 的目标文件,发现这些符号与主要符号有点不同:
000000000000a9c0 T pthread_create
000000000000e6a0 T pthread_exit
000000000000b510 T pthread_join
00000000000024b0 T pthread_mutex_init
0000000000006c70 T pthread_mutex_lock
0000000000005800 T pthread_mutex_unlock
从目标文件中去除或重命名符号是否有用?
实际情况:
终端:
$ LC_ALL=C make
------------------------------------------
clean up
make clean
make[1]: Entering directory `/mnt/prog/win'
rm -f *.o *.obj *.exe
make[1]: Leaving directory `/mnt/prog/win'
------------------------------------------
create object files
x86_64-w64-mingw32-gcc -c ./main.c ./usleep.c -Wall -O3 -DPTW32_STATIC_LIB -FORCEWIN
usleep.o main.o
------------------------------------------
compile pthreads as static lib
cd ./pthreads/; \
make CROSS=x86_64-w64-mingw32- clean GC-static
make[1]: Entering directory `/mnt/prog/win/pthreads'
rm -f *~
rm -f *.i
rm -f *.s
rm -f *.o
rm -f *.obj
rm -f *.exe
rm -f pthread.def
make XOPT="-DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB" CLEANUP=-D__CLEANUP_C XC_FLAGS=" " OBJ="pthread.o version.o" libpthreadGC2.stamp
make[2]: Entering directory `/mnt/prog/win/pthreads'
x86_64-w64-mingw32-gcc -c -o pthread.o -D__CLEANUP_C -O3 -DPTW32_BUILD_INLINED -DPTW32_STATIC_LIB -I. -DHAVE_PTW32_CONFIG_H -Wall pthread.c
x86_64-w64-mingw32-windres --include-dir=. -D__CLEANUP_C -o version.o -i version.rc
rm -f libpthreadGC2.a
x86_64-w64-mingw32-ar -rv libpthreadGC2.a pthread.o version.o
x86_64-w64-mingw32-ar: creating libpthreadGC2.a
a - pthread.o
a - version.o
x86_64-w64-mingw32-ranlib libpthreadGC2.a
echo touched > libpthreadGC2.stamp
make[2]: Leaving directory `/mnt/prog/win/pthreads'
make[1]: Leaving directory `/mnt/prog/win/pthreads'
------------------------------------------
linking
x86_64-w64-mingw32-ld ./main.o ./usleep.o ./pthreads/libpthreadGC2.a -o possix.exe
./main.o:main.c:(.text+0x33): undefined reference to `printf'
./main.o:main.c:(.text.startup+0x6): undefined reference to `__main'
x86_64-w64-mingw32-ld: ./main.o: bad reloc address 0x6 in section `.text.startup'
x86_64-w64-mingw32-ld: final link failed: Invalid operation
make: *** [prog] Error 1
目标文件的符号
$ x86_64-w64-mingw32-nm main.o
0000000000000000 b .bss
0000000000000000 d .data
U fprintf
U __imp___iob_func
0000000000000000 T main
U __main
U msleep
0000000000000000 p .pdata
0000000000000000 p .pdata.startup
U printf
U pthread_create
U pthread_exit
U pthread_join
U pthread_mutex_init
U pthread_mutex_lock
U pthread_mutex_unlock
0000000000000000 r .rdata
0000000000000000 t .text
0000000000000000 t .text.startup
0000000000000080 T thr_arbeite
0000000000000000 T thr_ausgabe
0000000000000000 r .xdata
0000000000000000 r .xdata.startup
我真的不明白他为什么找不到printf和main....
睡着了
$ x86_64-w64-mingw32-nm usleep.o
0000000000000000 b .bss
0000000000000000 d .data
U __imp_select
0000000000000000 T msleep
0000000000000000 p .pdata
0000000000000000 t .text
0000000000000050 T usleep
0000000000000000 r .xdata
最佳答案
错误:
./usleep.o:usleep.c:(.text+0x3c): undefined reference to `__imp_select'
表示 undefined symbol __imp_select。它可能位于您未包含在最终链接步骤中的其他一些 C 文件中。
关于在 Linux 上使用 mingw for Win 交叉编译 pthread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18956777/
我正在将一些 pthreads 代码添加到我使用 autotools 构建的 Linux 应用程序中。我收到关于未在 libpthreads 中链接的错误。所以我想在 autotools 中指定 pt
libpthread 库位于 Linux 系统的哪个目录中? 最佳答案 有多种方法可以找出这一点。 只需输入 find / -name 'libpthread.so' -print找到名为 libpt
pthread 属性对象是否需要在使用它们的对象的生命周期内存在,或者在使用它们后立即销毁它们是否安全?例如: // Create the mutex attributes. pthread_mute
到目前为止我读过的所有文档似乎都表明我的 vxWorks (6.8) 版本中存在 posix 线程支持,但是一个简单的测试应用程序无法按预期执行。来源如下: tTest.h #include cla
我试图找到指定 pthreads 标准的文档。我见过各种指向 IEEE 1003.1c-1995 的链接(即 Wikipedia 或 OpenGroup )。然而,当我在 IEEE 标准站点上搜索此文
我试图找到指定 pthreads 标准的文档。我见过各种指向 IEEE 1003.1c-1995 的链接(即 Wikipedia 或 OpenGroup )。然而,当我在 IEEE 标准站点上搜索此文
我在 MSVC 2010 上运行一个 pthread,我已经包含 pthreadVC2 .lib & .dll。来自以下网站 http://sourceware.org/pthreads-win32/
我的问题是: 如何在不更改其他 pthread 中的当前目录的情况下更改 pthread 中的当前目录,我找到了一个使用 openat() 函数的解决方案,但我没有找到任何解释它如何工作的示例。 使用
是否可以通过任何方式更改进程可以创建的 pthread 数量限制? 目前在我的 linux 系统上我可以创建大约 380 个线程,但我想增加它,只要内存可用。 最佳答案 减少用户的堆栈大小' ulim
问候。我正在尝试创建一个 autoconf 配置脚本,该脚本自动检查要使用的 pthread 选项,并且理想情况下,在使用 gcc 编译时指定 -pthread。 我希望 AX_PTHREAD 能够工
如何知道 pthread 是否死亡? 有办法检查 pthread 状态吗? 最佳答案 if(pthread_kill(the_thread, 0) == 0) { /* still runni
我正在从一个由互斥锁控制的固定大小的全局池中分配我的 pthread 线程特定数据。 (有问题的代码不允许动态分配内存;它允许使用的所有内存都由调用者作为单个缓冲区提供。pthreads 可能会分配内
在阅读了一些 MPI 规范后,我了解到,当使用 MPI_THREAD_SERIALIZED 进行初始化时,程序必须确保发生在不同线程中的 MPI_Send/Recv 调用不能重叠。换句话说,您需要一个
我尝试根据 this guide 安装 pthread win32 . 我将 pthreadVC2.dll 文件添加到 C:\Windows 并将 pthreadVC2.lib 文件添加到 C:\Pr
我有一个 pthreads 程序。我必须使用 Linux 中的 gcc -pthread(-pthreads 是无法识别的选项)和 Sun 中的 gcc -pthreads(-pthread 是无法识
我有一个包含文件名列表的文件,我想在其中搜索一个词并替换它我稍微修改了代码只是为了在这里只显示相关部分问题是如果我在该列表中只有一个文件,它不会用多线程处理它,因为线程只有在我有多个文件时才工作所以我
我正在编写一个 SMT 程序,并且正在尝试解决一个有趣的问题。 我需要所有函数一起退出,但是有些线程卡在障碍物上,即使我不希望它们这样做。 我的问题是:当我删除障碍时会发生什么?卡在屏障处的线程会释放
我阅读了有关 pthread 及其相关 API 的所有内容,以创建、锁定和同步不同的线程。但我经常发现线程池、消费者/生产者等词提示。我理解这些是 pthread 实现的模型。 任何人都可以让我知道
我在 man pthread_join 中读到,多个 pthread 不能加入一个已经加入的 pthread。还有另一种方法可以达到相同的结果吗?多个 pthread 挂起自己,直到某个特定的 pth
我知道 OpenMP 实际上只是一组编译成 pthread 的宏。有没有办法在编译的其余部分发生之前查看 pthread 代码?我正在使用 GCC 进行编译。 最佳答案 首先,OpenMP 不是一组简
我是一名优秀的程序员,十分优秀!