problem with creating mat files from C++ (visual studio 2005)

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hi,

I am having trouble creating mat files from my visual studio 2005
express. For example, the
matcreat.c file that is given as an example in the mathworks site,
produced 13 linking errors of this type:

1>Linking...
1>matcreat.obj : error LNK2019: unresolved external symbol _mxGetString
referenced in function _main
(...)

this happened although I set up the VC++ directories for include files
and libraries to point to the matlab\extern\include and
matlab\extern\lib\ respectively.

Any help will be greatly appreciated. Thank you
ilias

PS. Some secondary questions I have:
(a) mex -setup "sees" only the lcc compiler and not the msvc as it
should from visual studio 2005. I did add the cl.exe path to the
environmental variable path but the result is the same. I recently
installed the 9.1 intel compiler, same problem.
(b)If you have played with vms isual c++ 2005, there is supposed to be
a "compile tab" in the solution manager. Any thoughts why there is not
in mine ?

0
Reply iliast (9) 6/10/2006 6:39:37 AM

See related articles to this posting


This is not a problem associated with "mat files" exactly. You're obviously 
using some library routines from somewhere and have not included them 
correctly in your project.

So the question is: What library are you using, and how are you including it 
in your project?

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"ilias" <iliast@gmail.com> wrote in message 
news:1149921577.837903.252670@h76g2000cwa.googlegroups.com...
> Hi,
>
> I am having trouble creating mat files from my visual studio 2005
> express. For example, the
> matcreat.c file that is given as an example in the mathworks site,
> produced 13 linking errors of this type:
>
> 1>Linking...
> 1>matcreat.obj : error LNK2019: unresolved external symbol _mxGetString
> referenced in function _main
> (...)
>
> this happened although I set up the VC++ directories for include files
> and libraries to point to the matlab\extern\include and
> matlab\extern\lib\ respectively.
>
> Any help will be greatly appreciated. Thank you
> ilias
>
> PS. Some secondary questions I have:
> (a) mex -setup "sees" only the lcc compiler and not the msvc as it
> should from visual studio 2005. I did add the cl.exe path to the
> environmental variable path but the result is the same. I recently
> installed the 9.1 intel compiler, same problem.
> (b)If you have played with vms isual c++ 2005, there is supposed to be
> a "compile tab" in the solution manager. Any thoughts why there is not
> in mine ?
> 


0
Reply jwood (6) 6/10/2006 5:54:33 PM

Thanks for your reply. Including these two libraries , solves the
problem.

#pragma comment(lib, "libmat.lib")
#pragma comment(lib, "libmx.lib")

Does anyone have an answer to the other two questions, namely why mex
-setup can't see the msvc compiler and why there is no compile tab in
the solution explorer?

Thanks !
ilias

0
Reply iliast (9) 6/10/2006 6:45:31 PM
comp.soft-sys.matlab 203816 articles. 537 followers. Post

2 Replies
310 Views

Similar Articles

[PageSpeed] 56


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Problems when compiling and linking MAT-file program using Microsoft Visual Studio C++ 6.0
Hi, all, I tried to call the external API provided by MATLAB in C program,which I want to compile,link and run on Microsoft Visual Studio C++ 6.0. I added the C:\Program Files\MATLAB\R2007a\extern\include and C:\Program Files\MATLAB\R2007a\extern\lib in the "Include Files" and "Library Files" of MVSC++. Then I copied an example code matcreate.c(under C:\ProgramFiles\MATLAB\R2007a\ extern\examples\eng_mat) to the C++ source file. Then sucessfully compiled this file, however, when operated link command, errors appeard as followings: ---------Configuration: MATLAB_MX - Wi...

Problem with Visual C++ 2005 Express and file ntwin32.mak
Hi, I've installed the following setup. - Matlab R2008a - National Instruments SIT 5.0 - Visual C++ 2005 Express Edition I've configured the mex compiler with 'mex -setup', but every time i try to build a simulink model for the NI target I get the following error E:\Dev\Esempio\ProcessoTermico_nidll_rtw>nmake -f ProcessoTermico.mk GENERATE_REPORT=0 Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. C:\PROGRA~1\MATLAB\R2008a\rtw\c\tools\vctools.mak(16) : fatal error U1052: file 'ntwin32....

Reading mat-files in c++, visual studio 64 bit
Hi! I'm doing some numerical experiments on the GPU. My main program is in C/C++ and I use Visual Studio 2008. As a part of my program I need to read some mxArray's from a mat-file, as I am doing some preprocessing on a mesh using matlab. I previously did my coding in a 64-bit linux environment, and had no problems using the libmat and libmx functionality. When I moved over to 64-bit windows 7 with visual studio, my program stopped working. Everything compiles just fine, it is the linking and running that won't work. It seems like it can't recognize the appropriate data in ...

How to create and use DLL file in Visual Studio 2010 C++ ?
Hello ! How to create and use DLL file in Visual Studio 2010 C++? How to use DLL file used LoadLibrary() ? many thanks! Tuấn Trần wrote: > Hello ! > How to create and use DLL file in Visual Studio 2010 C++? > How to use DLL file used LoadLibrary() ? Try asking on a windows or VS forum, this isn't really the place to ask. -- Ian Collins =?UTF-8?B?VHXhuqVuIFRy4bqnbg==?= <trananhtuan260493@gmail.com> wrote in news:42c32a4d-ea0c-481b-bcd9-30834e60fae1@googlegroups.com: > Hello ! > How to create and use DLL file in Visual Studio 2010 C++? > How...

What setting I need to change in Visual Studio C++ v8 to run the same file that we have changed into .c after executing it as an .m file
??? ??? Jan ...

Just wondering if anyone knows if there are converters to convert from: MS Visual C++ 6.0 or MS Visual Studio 2003 project files into UNIX autogen/configure/make files?
Just wondering if anyone knows if there are converters to convert from: MS Visual C++ 6.0 or MS Visual Studio 2003 project files into UNIX autogen/configure/make files? KevinGPO wrote: > Just wondering if anyone knows if there are converters to convert from: > > MS Visual C++ 6.0 or > MS Visual Studio 2003 > > project files into UNIX autogen/configure/make files? > A better place to ask would be a UNIX newsgroup or a Linux newsgroup, comp.os.linux.development.apps, for example V "KevinGPO" <kevingpo@hotmail.com> wrote in message news:1126251633....

Is eMbedded Visual C++ 4.0 required when using Visual Studio 2005 Pro
I have LabVIEW 8.0.1 installed on my computer and want to install the LabVIEW 8.0.1f1 PDA module since I need to develop for Windows Mobile 5.0 targets. I first installed the four tools as described on the first section of the following link : &nbsp; <a href="http://digital.ni.com/public.nsf/allkb/AF586D34790A379886256D73005CAF13" target="_blank">http://digital.ni.com/public.nsf/allkb/AF586D34790A379886256D73005CAF13</a> &nbsp; Then, when I try to install the LabVIEW 8.0 PDA module (I guess I have to install if first since the labVIEW 8.0.1f1 PDA module...

Looking for some help, problems with C++ Dlls (Using Visual Studio C++ 6.0)
Hi everyone. Okay, I'm trying to dynamically link some dlls and I'm having some problems. I originally had a project that seems to work, but for the life of me I can't repeat the results. I used app wizard to create a simple Win32 Dynamic Linked library. the code is as follows: #include "stdafx.h" #include "stdio.h" int i = 0; BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } void _stdcall InitDll(){ i = 1; } I build that and get 'TestD...

problems when I create snscribe unstructured file format 2 in C ( file code 0)
hello i need create a unstructured file format 2 in C ( file code 0), but in the execution time the program show 22 error number. please can you help me the Code: char *new_filename; short *file_code = 0; int32 primary_extent_size= 406; int32 secondary_extent_size = 406; int32 maximum_extents = 978; int32 file_type = 0; new_filename = "$PENE05.SUBVOLUME.FILE123"; erc = FILE_CREATE_(new_filename, (short)strlen(new_filename), file_code, primary_extent_size, secon...

Newbie on permissions: ADO.NET, C++.NET, SQL SERVER 2005 EXPRESS, Visual Studio 2005
This is a very basic question, perhaps more of a Windows XP Professional OS permissions question than a dB or programming question: how to create and access SQL SERVER databases from an account other than "Administrator"; for example, from a "Power User" account? As anything other than an "Administrator" user (i.e. as a Power User), I keep getting (when I try from inside of MS Visual Studio 2005 development environment) the error message: "CREATE DATABASE permission denied in database 'master' Using the SQL Server Express Surface Area Configuration ...

Big Problem/Bug with new matfile command for partial mat file read/writes
Please look at this minimal example: -------------- %create a 1mb "incompressible" array one_meg = uint8(rand(1,1000,1000)*256); %choose a file, clear it and open it with write access testfile = 'D:\Data\PGRtest\testfile.mat'; system(['del "' testfile '"'] ); matObj = matfile(testfile,'Writable',true); %keep a copy of what we write to the file in memory for verification memcpy = zeros(50,1000,1000,'uint8'); %write the array 50 times to this file for i = 1:50 tic %store in file and memory in same fo...

Calling C from Fortran link problems (Compaq Visual Fortran 6.6 & MS Visual Studio 8)...
Dear newsgroup, I am trying to call some C/C++ code from Fortran, but I cannot link the fortran exe correcly. I have C code that wraps a C++ class. For example, a C function like: extern "C" void BB_Initialise(void) { if (BB_Object != NULL) delete BB_Object; BB_Object = new BlockInternals(); }; /* BB_Initialise */ The above C wrapper is built into a static lib, using Microsoft Visual Studio 8: cl -c -MT -W3 -EHsc -O2 -Gy -D "WIN32" -D "NDEBUG" -D "_WINDOWS" -D "_MBCS" -D "_LIB" "..\src\FortranCWrapper.cpp" -out:&...

Big Problem/Bug with new matfile command for partial mat file read/writes
Please look at this minimal example: -------------- %create a 1mb "incompressible" array one_meg = uint8(rand(1,1000,1000)*256); %choose a file, clear it and open it with write access testfile = 'D:\Data\PGRtest\testfile.mat'; system(['del "' testfile '"'] ); matObj = matfile(testfile,'Writable',true); %keep a copy of what we write to the file in memory for verification memcpy = zeros(50,1000,1000,'uint8'); %write the array 50 times to this file for i = 1:50 tic %store in file and memory in same fo...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288546334)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288546334) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289132411)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289132411) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288832412)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288832412) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288857609)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288857609) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288857609)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288857609) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...