MATLAB Answers

Why do I receive a LIBC.lib error when doing a MEX compilation in MATLAB 7.9 (R2009b)?

18 views (last 30 days)
When compiling my C-file with MEX, I receive a LIBC.lib not found during compilation. I am able to compile a simple example like timestwo.c.
LINK : fatal error LNK1104: cannot open file 'LIBC.lib'

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 May 2010
In MATLAB 7.9 (R2009b), the fatal error LNK1104: cannot open file 'LIBC.lib' relates to dependent libraries used in your C application.
This is a common issue when libraries were compiled using different versions of Visual Studio Compiler. This issue is discussed here:
One workaround is to place the LIBC.lib : "Project Property -> Configuration Properties -> Linker -> Input -> Ignore Specific Library"
"Ignore the LIBC.LIB" in Visual Studio so that it does not depend on a specific version of Visual Studio.

  0 Comments

Sign in to comment.

More Answers (1)

Dang Manh Truong
Dang Manh Truong on 21 Mar 2017
Edited: Dang Manh Truong on 21 Mar 2017
You could just search for the file, then put it in matlab's working directory. I encountered a similar situation (matlab R2016b, visual studio 2015 C++, cuda 8.0, trying to get mexcuda to work):
Error using mex
LINK : fatal error LNK1104: cannot open file 'ucrt.lib'
After some searching, I found out that there were 2 versions of this file (most probably a result of Visual Studio C++ 2015 messing things up), so I copied one version to the working directory and it worked! Not the most elegant solution around, but it gets the job done. (Tested on the mexGPUExample.cu and there was no problem)

  0 Comments

Sign in to comment.


Translated by