library file not being recognized during mex compile
I had previously been able to compile my mex file using the command in Matlab:
>> mex CMEXsfcn_code.c MyLibrary.lib
Somewhere along the line, I started having problems with this compile process, and now when I execute the above command, the .lib file (the same version of which is still contained in my working directory) is now not recognized, and I get a string of error messages relating to functions contained in the .lib file that are used in the .c file.
Does anyone have any ideas about why, even though I'm still working in the same directory and using the same files, the conte...Compiling MEX-file with external library
I am trying to compile a MEX-file, which uses an external library
function. The library is available as "tcdlls.lib".
But performing the compilation I get the following error. I have tried
also copying the .lib file to the working directory, but this did not
help. The library-file is correctly spelled. Using Visual Studio or
LCC-compiler did not make any difference. What is going wrong?
Thank you very much,
>> mex timestwo.c -ltcdlls.lib -L"D:\Eigene Dateien\LibPath\"
Warning: MEX could not find the library "tcdlls.lib"
specifie...Compile mex-funtions with C using OpenCV
I am using C functions which in turn uses OpenCV. I need to compile these functions in matlab and I think it is necessary to create mex functions. As I compile these functions?
Would appreciate urgent help.
Helder <Refega@ymail.com> wrote in message <1843030343.24900.1291071776440.JavaMail.email@example.com>...
> I am using C functions which in turn uses OpenCV. I need to compile these functions in matlab and I think it is necessary to create mex functions. As I compile these functions?
> Would appreciate urgent help.
As you mentionned yo...Compile C source code to a library with MEX
Is there any way to do this? I want to create a *.lib from my C source
code for use in other S-Functions.
Thanks in advance,
...MEX library compiled in MaC throws exception
I am trying to compile a set of C files to create MEX dynamic library. I have done it successfully for Windows 32 bit & 64 bit. Now I am trying to do the same on a MaC. Every piece of code used for the windows is the same besides having changed a few libraries e.g. while doing it on windows I used the vcf2c.lib to compile fortran to c generated code and in the MaC I am using the f2c.lib. The .mexw32 library file generated on the Windows allows flawless execution of the .M files . In the MaC OS-X though the .mexaci file is created compiling the same piece of code when i trying...Linking problem compiling Mex with Matlab and FFTW library
I want to speed up my Matlab program which uses many FFT operation by writing a mex file and using FFTW library.
What i've done so far:
- installed Microsoft Visual Studio 2008
- choose it via "mex -setup" in Matlab
- downloaded the latest FFTW and created the *.lib files according to this Tutorial:
- added a static path "G:\FFTW\fftw-3.2.2-dll64" to the PATH, INCLUDE and LIB in the "mexopts.bat" in the directory returned by the MATLAB command "prefdir"
- I used ht...USE Shared Matlab Compiled Library IN C Mex File
I have the fallowing problem
I want to use certain time consuming matlab functions in C/C++ with other c++ Librarys IN an MEX File which I can start in Matlab.
I compiled with MCR the time consuming matlab functions too a shared library and want to use them now in a mex file...
(Up to now I have linking problems in the MEX file)
I have read the fallowing in the forum:
It is not possible to incorporate Matlab compiled file into mex, because there is a conflict between MCR and Matlab.
Is this really correct?
Is there a way of doing this, or do I need to start the application direct...build a static library instead of a dynamic one with MEX compiler
I m looking for an option of the mex compiler in order to produce a static mex file with all the code, that it needs, already inside it.
which can substitute all the external references inside my c code with the real code from the external library.
i tried to do that because I created a mex file to put inside a 2ndlevel sfunction block
mex file.c -l APP_Numerical
and until now everything is fine the program works on Simulink
(the option -l is there, because I made some references to an external library)
Then in order to use it in a real time simulator, I need to tra...mex fortran 77 compiler link static library problem
I have a fortran program that I originally wrote on windows using f90
(Compaq visual fortran). I have slightly modified to port it in
fortran 77 to be compiled on a Linux 64-bit machine. I have another
static library that I wrote in fortran 90, and was successfully
compiled on Linus using "ifort". When I try to mex the fortran 77
code (using g77; since ifort is not availble from matlab mex), I
mex -O -output test testing.f mylibrary.lib
where mylibrary.lib is located in the same directory. The
compilation finished successfully, however when I run it, it says:
??? In...error MEX: Compile C++ file with external library (matlab)
I have the following problem:
- I have a file (mexRVO.cpp) with C++ code addapted to mex.
- This file contains the include: #include "RVOSimulator.h", which is located in the same folder and contains the declarations of several functions from a library.
- The library is rvo_d.lib and can also be found in the same folder.
I've tried to compile both with:
mex mexRVO.cpp rvo_d.lib
Both of them returned the same errors:
Creating library C:\USERS\ADMIN\APPDATA\LOCAL\TEMP\MEX_GA~1\templib.x and object ...Compiling mex function with link to external library
I'm trying to compile a mex function that links to an external library. It is failing, being unable to find the "symbols" to the library function calls. I've spent an embarrassing amount of time trying to figure this out and any help would be greatly appreciated. Here's what I've got:
Creating library C:\Users\vschmidt\AppData\Local\Temp\mex_p5d3gD\templib.x and object C:\Users\vschmidt\AppData\Local\Temp\mex_p5d3gD\templib.exp
gsf_Read.obj : error LNK2019:...Can you use MFC functions/libraries with s-functions and MEX compiler?
Essentially what I have is the source code for an MFC application that interacts with some external hardware. I want to use this hardware through MATLAB and am currently trying to implement the C++ source code into S-functions using the MEX compiler. However, I've been having numerous problems compiling and linking, especially with afxwin.h and other headers.
The way i see around this is to go through the existing code bit by bit and pick out the functions and classes which make calls to the MFC C++ Library and remove them. However, from numerous searches through forums, et...mex compiling C++ code with external static libraries on older versions of Matlab (7.0.0....)
I have used this line when building C++ code to create a mex file:
mex -L -lblas_win32 -llapack_win32 needle3D.cpp needle.cpp matrix.cpp
interaction.cpp mesh.cpp ...
tissue.cpp utils.cpp coordinates.cpp
This syntax works when I used it on Matlab R2008b. However, this
syntax doesn't work when I used it on a machine that has Matlab 7.0.0.
It appears that the syntax have changed, and I have some trouble
changing the line. What would you suggest changing them to for the
line to work with the latter version? What would be the best way to
check the version?
On Jan 15, 4:46=A0pm, checkmate...matlab crashes (win 7 64 bit) without messages, logs or dumps while using mex-files linked with itpp library and compiled with mingw
I know, that this a very special problem and I would like to provide an error log or something like this, but this is the problem.
Matlab 2010a (64bit) on Win 7 64bit Enterprise
Mingw-w64 with basis msys environment
used modified gnumex to create .def and .lib files
mexopt.bat modified to work with mingw
This setup works perfectly. I can write,compile,link and run mex files.
Moreover, I compiled the itpp library with msys/mingw and created static libs as well as shared libs.
Now, the problem:
At the point, when I include an itpp related class of fu...How to compile mex function using mcc compiler
I am using mcc compiler to compile a matlab function myfun.m into c code. The myfun.m calls a mex function digamma.c, but I do not know the correct way to deal with this mex function. when I tried mcc -m -v myfunction. The compiling was finished where, but when I run this executable, there is error information like:
??? Undefined function or method 'digamma' for input arguments of type
Error in ==> rtmCGS at 151
I noticed that digamma.c used #include "util.h", which is not a default head file. Is this the reason?
I really need help about this. Thank...making mex-file compilation dependant on the compiler
I want to have a script compile my mex file using different options depending on what compiler is set up. Passing switches seems more flexible than editing mexopts.bat and having several versions. This seems to work just fine from the command-prompt, but when I make a script/function that does the same, I get a strange error.
cc = mex.getCompilerConfigurations
if strcmp(cc.Details.CompilerExecutable, 'icl')% using Intel compiler
mex -v OPTIMFLAGS="$OPTIMFLAGS /O3 /DNDEBUG" hello.c
??? Error: File: buildmex.m Line: 3 Column: 5
"mex" was pre...Compile a Program with mex.h without mex
I'm writing a C program that can be called from matlab as well as from a console. That means, I have a main(...) as well as a mexFunction(...).
I have no problems when compiling with mex, but I get linker errors when I try to compile it with another C compiler like gcc. This of course happens, because some libs are missing. But which libs does the compiler need to succeed? I tried several folders in the MATLAB/extern area, but had again linker errors. Is it possible at all to compile a file containing calls to mex.h without mex?
Notice: Functions of mex.h are only called from mexF...Compiling labca against matlab libraries. Missing library?
I'm compiling labca (Channel Access) against the libraries
Files/MATLAB/R2008a/extern/lib/win32/microsoft (as you can
see I'm doing this in cygwin and compiling against R2008a),
but it errors out due to a missing library -- libut.lib.
There are plenty of other libs in that directory, but not
libut.lib. I've searched my hdd for this lib, but it can't
be found anywhere -- it only finds libut.dll in C:\Program
Is this a standard matlab library, and, if so, why is it
missing on my fresh matlab installation?
Can anyone...Matlab Object compile to library (compiler 4)
I wonder if someone has the experience of compiling a matlab object
into a dll. I implemented a class in which I would like to use it in
my C++ code. However, I don't want the class being instantiated
multiple times whenever I make calls to the library. Is there a way
to do the following:
- Create a wrapper for the class instantiation, return the address of
the object to the caller
- Create other wrappers that accept the object address as argument
and use it to call the object methods
- caller can now reuse the object as many times as he wants.
- destroy the object when finish
Does ...compiling c code but libraries are compiled in c++
We have written cunit code for testing some APIs. defination of
those APIs are in c++ and .so library is created of them. when I
compile my cunit code it gets compiled successfully but while liking
it gives undefined reference to symbol. can anyone help me in this
On 29 May 2007 04:11:14 -0700 sumit <firstname.lastname@example.org> wrote:
| We have written cunit code for testing some APIs. defination of
| those APIs are in c++ and .so library is created of them. when I
| compile my cunit code it gets compiled successf...Trying to compile C++ code with Matlabs MEX compiler
After successful compilation of unaltered mexcpp.cpp example c++ code
from Matlab (C:\MATLAB6p5\extern\examples\mex) I would like to use some
functions of a dll. (headerfile.dll) (Sorry about name conventions)
When trying to include a header file on mexcpp.cpp
the compiler, called from matlab, sends the following errors:
C:\MATLAB6p5\work\Include\headerfile.h(18) : error C2146: syntax error
: missing ';' before identifier 'FunctionsName'
C:\MATLAB6p5\work\Include\headerfile.h(18) : fatal error C1004:
unexpected end of file found
#ifnde...Older gcc using a library compiled with a different compiler?
I have an application that has me forced to use gcc 2.95.3 on solaris/
SPARC. I am wondering, is there any problem with and older gcc like
this using a library that was compiled with gcc 3.4?
What if I get a version of this library compiled with sun pro? Is it
an issue then if I use this old gcc and attempt to call functions in
Mohan Khurana <email@example.com> writes:
> I have an application that has me forced to use gcc 2.95.3 on solaris/
How can an application force you to do anything?
Did it put a gun to your head?
Now, if...link a c compiled application with a c++ compiled library ?
I've searched nearly one hour for this but found nothing usefull :-/
So my question is simple :
Is it possible to link a c compiled application with a C++ compiled
If yes, how would it possible.. (I guess this would be indirectly
posible by using some wrapper around the c++ library, but I'm aboslutely
not wanting to do that in my case, well at least if I have to write that
wrapper manually myself).
I looked at gcc,g++ man pages, gcc online documentation, .. but can't
even find a beginning of info related to that :-/
Thank you if you can help me.
...C Shared Library Example:: Libraries (MATLAB Compiler)
I compiled the "addmatrix.m, multiplymatrix.m, eigmatrix.m" from
"C:\MATLAB701\extern\examples\compiler\" directory as given in the
I use the command "mcc -B csharedlib:libmatrix addmatrix.m
multiplymatrix.m eigmatrix.m -v" as given in the "C Shared Library
Example" in "help". There is no file "libmatrix.dll" and
"libmatrix.lib" created after compilation. All other files
(.c,.h,.exports, .ctf) are created.
Without "libmatrix.lib" the "matrixdriver.c" is giving the linking