ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

LINK : fatal error LNK1104: cannot open file 'm.lib'

asked 2021-12-04 10:08:54 -0500

osilva gravatar image

I am trying to compile the old PR2 libraries to run on ROS on Windows 10 with Visual Studio 19.

One of the dependencies ivcon fails to compile giving the following error:

LINK : fatal error LNK1104: cannot open file 'm.lib

I searched for an answer and I understand the main issue is one of C programs calling for m.libthat is not present. I tried to replace the library named 'msvcrt' with m as suggested: https://stackoverflow.com/questions/3... but it didn't work.

Appreciate to get any advise on how to solve this issue. Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-12-04 17:42:47 -0500

osilva gravatar image

After some digging, removing m.lib from LINK_LIBRARIES located in the build.ninja file in the build folder fixed the problem, and I was able to compile successfully.

#############################################
# Link the executable C:\ivcon_ws\devel\lib\ivcon\ivcon.exe

build C$:\ivcon_ws\devel\lib\ivcon\ivcon.exe: C_EXECUTABLE_LINKER__ivcon_RelWithDebInfo ivcon\CMakeFiles\ivcon.dir\src\ivcon.c.obj
  FLAGS = /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG
  LINK_FLAGS = /machine:x64 /debug /INCREMENTAL /subsystem:console
  LINK_LIBRARIES = kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
  OBJECT_DIR = ivcon\CMakeFiles\ivcon.dir
  POST_BUILD = cd .
  PRE_LINK = cd .
  TARGET_COMPILE_PDB = ivcon\CMakeFiles\ivcon.dir\
  TARGET_FILE = C:\ivcon_ws\devel\lib\ivcon\ivcon.exe
  TARGET_IMPLIB = C:\ivcon_ws\devel\lib\ivcon.lib
  TARGET_PDB = C:\ivcon_ws\devel\lib\ivcon\ivcon.pdb
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-12-04 10:08:54 -0500

Seen: 2,149 times

Last updated: Dec 04 '21