fatal error LNK1104: cannot open file 'libmx.lib libmat.lib libeng.lib'

조회 수: 23 (최근 30일)
sam
sam 2011년 12월 7일
Hi, I want to make a dll compiled in Matlab, and then use this dll in VS2010. The function is very simple:
function [y] = sinwave(x)
y = sin(x);
end;
and MCC works well, produced .dll, .h, .lib files.
But when I compiled a simple program in VS2010,
#include <stdio.h>
#include <math.h>
//#include "vld.h"
#include <stdlib.h>
#include <string.h>
#include "sinwave.h"
#include "mclmcr.h"
#include "mclmcrrt.h"
#include "mclcppclass.h"
void main(void)
{
if (!mclInitializeApplication(NULL,0))
{
std::cerr << "could not initialize the triangle library properly" << std::endl;
return;
}
if (!sinwaveInitialize())
{
std::cerr << "could not initialize the tb library properly" << std::endl;
return;
}
sinwaveTerminate();
mclTerminateApplication();
}
//an message: LINK : fatal error LNK1104: cannot open file 'libmx.lib libmat.lib libeng.lib' showed.
I added the matlab path extern/lib/win32, win64 to system environment path of my PC, and restart the vs2010.

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2011년 12월 7일
Are you attempting to link against libmx.lib libmat.lib libeng.lib in your Linker options? I don't think those are needed. You should only need to link against the .lib file generated for your application by MATLAB Compiler.
  댓글 수: 4
sam
sam 2011년 12월 8일
Still not work. I tried to add sinwave.h in <additional dependencies> box, and got:
LINK : fatal error LNK1104: cannot open file 'sinwave.lib libmx.lib libmat.lib libeng.lib';
It is weird, since sinwave.lib is in the same folder with soruce file, testSinwave.cpp.
sam
sam 2011년 12월 8일
And I use vs2010 x64, wiin7 x64 version, I had changed property manager: debug/x64, release/x64

댓글을 달려면 로그인하십시오.


sam
sam 2011년 12월 9일
Finally, it was solved.
  댓글 수: 2
zohar
zohar 2012년 9월 3일
Hi sam
Tel as how you solve your problem ;-)
Maddila
Maddila 2012년 10월 3일
how u solve this,,please share it

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by