Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Linking C++ with Matlab

Subject: Linking C++ with Matlab

From: Jane T

Date: 9 May, 2012 18:31:06

Message: 1 of 2

Hi,

I have two sensors, a pressure sensor and a k-type thermocouple. I'm trying to read them into Matlab so that I can create a stripchart and do some analysis. My plan is to obtain the data using a 'Measurement Computing USB-1208LS'.

This instrument comes with some data aquisition software written in C. I'm currently trying to write a C++ project in Visual C++ 2010 Express that allows me to grab the data in Matlab, using the tutorial I downloaded from www.engineering.uiowa.edu/~dip/lecture/C++_with_Matlab.pdf as a guide, although this is for an earlier version of Visual Studio.

I got the basic structure to compile, but as soon as I tried using any of the mex functions it would no longer compile and I get the following error message

mexFunction.obj : error LNK2019: unresolved external symbol _mxCreateDoubleScalar referenced in function _mexFunction

I assume that means that it can't 'see' the mex libraries, but I can't work out why. Up until a week ago I knew nothing about c++, so I'm currently on a very steep learning curve.

Are there any obvious things I should be looking for? Would anyone be willing to look over my code and check my settings if I were to email them the project?

Many thanks
Jane

Subject: Linking C++ with Matlab

From: Sida

Date: 18 Dec, 2012 21:34:09

Message: 2 of 2

"Jane T" wrote in message <joed5a$g92$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have two sensors, a pressure sensor and a k-type thermocouple. I'm trying to read them into Matlab so that I can create a stripchart and do some analysis. My plan is to obtain the data using a 'Measurement Computing USB-1208LS'.
>
> This instrument comes with some data aquisition software written in C. I'm currently trying to write a C++ project in Visual C++ 2010 Express that allows me to grab the data in Matlab, using the tutorial I downloaded from www.engineering.uiowa.edu/~dip/lecture/C++_with_Matlab.pdf as a guide, although this is for an earlier version of Visual Studio.
>
> I got the basic structure to compile, but as soon as I tried using any of the mex functions it would no longer compile and I get the following error message
>
> mexFunction.obj : error LNK2019: unresolved external symbol _mxCreateDoubleScalar referenced in function _mexFunction
>
> I assume that means that it can't 'see' the mex libraries, but I can't work out why. Up until a week ago I knew nothing about c++, so I'm currently on a very steep learning curve.
>
> Are there any obvious things I should be looking for? Would anyone be willing to look over my code and check my settings if I were to email them the project?
>
> Many thanks
> Jane

Did you find any solution to this?
I'm also encountering something to do with "unresolved external symbol".
I would be very thanful if you can give me a tip.

-sida

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us