Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a dll file from some C files and Object files with mex

Status
Not open for further replies.

mfm102

Electrical
Aug 5, 2003
8
0
0
MY
Hi all,
I'm a newbie here. I am trying to compile some provided .c, .h and .m files. The C files already has the mexfunction. They can be compiled in Unix without a problem but I want to try to compile it in PC. I have looked into Matlab help and MSDN documentation on how to compile the C files and Object files.
For creating a dll file from a C file (without a header .h file) is not a problem, and I manage to do that by typing this command in the Matlab prompt
>> mex examplefile1.c
A file called examplefile1.dll is created.

However I have a problem in linking some C files with Object files as below
>> mex exfile1.c objfile2.obj objfile3.obj
(Note that there is some header files involved)

The error report that I get
exfile1.obj : error LNK2001: unresolved external symbol _vector_addition
exfile1.obj : error LNK2001: unresolved external symbol _equalizer_diversity
exfile1.dll : fatal error LNK1120: 2 unresolved externals

C:\MATLAB6P1\BIN\WIN32\MEX.PL: Error: Link of 'exfile1.dll' failed.

Do you guys have any idea?
 
Replies continue below

Recommended for you

I'm not sure, but I have tried it on VC++ by using the Matlab Add-Inn to create the dll files. It is still the same error report came out. I am really not sure what to do next :(
 
Status
Not open for further replies.
Back
Top