-1

I've tested almost every solution found on the net to solve this problem.I'm trying to plot some arrays of spheres in c++ by calling the matlab engine. I did all steps according to this video:

https://www.youtube.com/watch?v=vQ5aIxCX3To

However it didn't work. I tried to install libsndfile and add the directory to my project here:

properties->C/C++->General-> Additional include directories and linker->general->additional library directories

I've called #include <engine.h> and using Engine *m_pEngine= engOpen("null"); to run matlab engine.

Errors:

Error   1   error LNK2019: unresolved external symbol _engOpen referenced in function _main C:\Users\Eric\documents\visual studio 2013\Projects\Project5\Project5\Source.obj    Project5
Error   2   error LNK1120: 1 unresolved externals   C:\Users\Eric\documents\visual studio 2013\Projects\Project5\Debug\Project5.exe 1   1   Project5

Thanks

Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77

1 Answers1

0

Thanks for editing my question. For who have the same problem: first of all make sure you are running both Matlab and c++ on the same platform (32 or 64 bit); secondly; for changing that in c++ see:How to: Configure Visual C++ Projects to Target 64-Bit Platforms

Secondly, set up your project's properties according to: How can I compile a MATLAB Engine application using Microsoft Visual Studio 9.0 or 10.0 ? Specially check the directory in the PATH which was my problem; for this go:


Start -> Right click on Computer -> Properties -> Advanced System Settings -> Environment variables -> System Variables -> Open "Path" for editing

and change it to $MATLABROOT\bin\win32 (For 32-bit Windows) or $MATLABROOT\bin\win64 (For 64-bit Windows).


Thanks