Fuz*_*all 1 c++ g++ linker-errors static-libraries linker-warning
\n我在 **Monterey M1 MacBook** 上创建构建系统时遇到一些问题:\n
到目前为止,我有一个可用的 Makefile 来构建和链接库。
\n(简化:g++ -c所有 .cpp 文件转换为 .o 文件 \xe2\x86\x92 ar -r <.o files> libmyLibrary.a>\n
\xe2\x86\x92效果很好
问题:
\n当我尝试构建一个使用所述libmyLibrary.a. 源文件的编译工作正常,但我收到以下(看似无意义的)链接器警告:
ld: warning: ignoring file /Path/to/lib/libmyLibrary.a,\nbuilding for macOS-arm64 but attempting to link with file built for macOS-arm64\nRun Code Online (Sandbox Code Playgroud)\n\xe2\x86\x92 我 ofc 然后得到一些Undefined symbols for architecture arm64: ... <stuff from library> referenced from: <stuff from executable>
为与图书馆相同的目标而建设怎么会成为问题呢?
\n