Problem with OMNeT++ installation on Ubuntu: How to resolve 'Standard C math library -lm not found' error during ./configure?

huangapple go评论62阅读模式
英文:

Problem with OMNeT++ installation on Ubuntu: How to resolve 'Standard C math library -lm not found' error during ./configure?

问题

I have a problem with the installation of OMNeT++ on Ubuntu. The error occurs during the ./configure command and relates to the math library: configure: error: Standard C math library -lm not found.
我在Ubuntu上安装OMNeT++时遇到问题。错误发生在./configure命令期间,与数学库有关:configure: error: 找不到标准C数学库 -lm

I have installed all the necessary packages (e.g., libc6-dev, build-essential) and followed all the installation instructions. Moreover, when I write a simple C code and link it with the math library using -lm, it works correctly. So why does this error occur during ./configure?
我已安装所有必要的软件包(例如libc6-dev,build-essential)并遵循所有安装说明。而且,当我编写一个简单的C代码并使用-lm链接到数学库时,它可以正常工作。那么为什么在./configure期间会出现这个错误呢?

This is the output of the ./configure:
这是./configure的输出:

configure: Environment variables (PATH and PYTHONPATH) are correctly set.
configure: Reading configure.user for your custom settings.
...
configure: error: Standard C math library -lm not found

Maybe is a problem with the LLD library? The script says that LLD linker is unavailable, but it is installed. This is the output of ld.lld --version: Ubuntu LLD 14.0.0 (compatible with GNU linkers)
也许是LLD库的问题?脚本说LLD链接器不可用,但它已安装。这是ld.lld --version的输出:Ubuntu LLD 14.0.0(与GNU链接器兼容)

Thank you for your help.
谢谢您的帮助。

I tried to remove and re-install the libraries, but it's not working.
我尝试删除并重新安装库,但没有起作用。

英文:

I have a problem with the installation of OMNeT++ on Ubuntu. The error occurs during the ./configurecommand and relates to the math library: configure: error: Standard C math library -lm not found.
I have installed all the necessary packages (e.g., libc6-dev, build-essential) and followed all the installation instructions. Moreover, when I write a simple C code and link it with the math library using -lm, it works correctly. So why does this error occur during ./configure?

This is the output of the ./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

Maybe is a problem with the LLD library? The script says that LLD linker is unavailable, but it is installed. This is the output of ld.lld --version: Ubuntu LLD 14.0.0 (compatible with GNU linkers)

Thank you for your help.

I tried to remove and re-install the libraries, but it's not working.

答案1

得分: 0

sudo apt install libstdc++-12-dev

应该解决这个问题。

英文:

sudo apt install libstdc++-12-dev

should solve the problem.

huangapple
  • 本文由 发表于 2023年5月22日 19:59:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76305955.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定