Why am I receiving errors when compiling matdgns.c or matcreat.c for the MATLAB Engine on a PC using the free Borland Compiler 5.5?
2 views (last 30 days)
Show older comments
The error that I am receiving is:
Error: Unresolved external 'WinMain' referenced from
C:\BORLAND\BCC55\LIB\C0W32.OBJ
C:\MATLAB6P5\BIN\WIN32\MEX.PL: Error: Link of 'matdgns.exe' failed.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This error is due to the fact that the bcc55freeengmatopts.bat was created with the assumption that users will only try to build graphical applications. However, since matdgns.c and matcreat.c are console based applications and only have the "main" entry point, the above linker error is generated.
You can resolve this problem by modifying line 38 of the bccfreeengmatopts.bat file which includes
set LINKFLAGS=-tWE -L"%BORLAND%"\lib\32bit -L"%BORLAND%"\lib
to
set LINKFLAGS=-tWC -L"%BORLAND%"\lib\32bit -L"%BORLAND%"\lib
Note that you will need to reverse this change if you wish to compile a graphical application.
0 Comments
More Answers (0)
See Also
Categories
Find more on Call MATLAB from C in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!