在Ubuntu上安装OMNeT++的问题:如何解决./configure中的“Standard C math library -lm not found”错误?

brc7rcf0  于 2023-06-05  发布在  其他
关注(0)|答案(1)|浏览(605)

我在Ubuntu上安装OMNeT++有问题。错误发生在./configure命令期间,与数学库相关:configure: error: Standard C math library -lm not found。我已经安装了所有必要的软件包(例如libc 6-dev,build-essential),并遵循了所有的安装说明。而且,当我编写一个简单的C代码并使用-lm将其与数学库链接时,它可以正确工作。那么为什么在./configure期间会发生此错误呢?
下面是./configure的输出:

configure: Environment variables (PATH and PYTHONPATH) are correctly set.
configure: Reading configure.user for your custom settings.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for clang... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for clang++... clang++
checking for c++14 support... yes
checking for ranlib... ranlib
checking whether LLD linker is available... no
checking whether clang++ supports -fno-omit-frame-pointer... no
checking whether clang++ supports -glldb... no
checking whether clang++ supports -ggdb3... no
checking whether clang++ supports -fstandalone-debug... no
checking whether clang++ supports -fno-limit-debug-info... no
checking whether clang++ supports -Wl,--no-as-needed... no
checking whether clang++ supports -Wl,--as-needed... no
checking for swapcontext... no
checking if shared libs need -fPIC... failure
configure: WARNING: COULD NOT FIGURE OUT HOW TO BUILD SHARED LIBRARY -- reverting to static libs
checking for dlopen with CFLAGS="" LIBS=""... no
checking if --export-dynamic linker option is supported/needed... test failed
checking for flags needed to link with static libs containing simple modules... no solution found
configure: WARNING: Avoid linking with static libraries containing simple modules
configure: WARNING: and other dynamically registered components. Those components
configure: WARNING: will not be found by the simulation program, because the linker
configure: WARNING: leaves them out from the executable.
checking whether linker supports -rpath... no
checking for bison... bison -y
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
checking for make... make
checking for perl... perl
checking for swig... not found
checking for python3... python3
checking if all necessary Python modules are available... yes
checking for math with CFLAGS="" LIBS=""... no
checking for math with CFLAGS="" LIBS="-lm"... no
configure: error: Standard C math library -lm not found

也许是LLD图书馆的问题?脚本显示LLD链接器不可用,但它已安装。下面是ld.lld --version的输出:Ubuntu LLD 14.0.0 (compatible with GNU linkers)
谢谢你的帮助。
我尝试删除并重新安装库,但不起作用。

tzcvj98z

tzcvj98z1#

sudo apt install libstdc++-12-dev
应该能解决问题

相关问题