How to Resolve Linker Errors When Compiling CPP Code in MATLAB?

  • Thread starter Thread starter physical101
  • Start date Start date
  • Tags Tags
    Code
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
physical101
Messages
41
Reaction score
0
Dear All

I am a biologist trying hard to make it in the world of informatics and computing and I was wondering if one of you real scientists could help me.

I have a executable program with its associated .lib .exp and .pdb files.

I thought I could easily mex the cpp of this excutable using the above but I keep running into unresolved linker errors.

I am working on a 64 bit windows 7 machine and I am telling MATLAB to look in the right place for the .h files etc but I get warnings like this:

filename.obj : error LNK2019: unresolved external symbol "public: __cdecl dependency::~dependency(void)" (??1dependency@@QEAA@XZ) referenced in function "public: void * __cdecl dependency::`scalar deleting destructor'(unsigned int)" (??_GDRMImage@@QEAAPEAXI@Z)

I appreciate that this post is a bit abstract but any help you could give would be absolutely fantastic and I will buy you virtual chocolates and a virtual trip to las vagas.

Thank you

Physical101
 
Physics news on Phys.org


Dear Physical101,

I understand your frustration with trying to integrate your executable program into MATLAB. Linker errors can be tricky to resolve, but I am happy to offer some advice to help you out.

Firstly, make sure that all of the necessary header files are included in your MATLAB code and that they are properly referenced. Sometimes linker errors can occur if a header file is missing or not properly referenced.

Next, check that your code is compatible with the version of MATLAB you are using. If there are any compatibility issues, it could be causing the linker errors. You may need to make adjustments to your code or find a different version of MATLAB that is compatible with your program.

If the above steps do not resolve the issue, it may be helpful to reach out to the developer of your program for support. They may be able to provide more specific guidance on integrating it with MATLAB.

I hope this helps and best of luck with your informatics and computing pursuits! And thank you for the virtual chocolates and trip to Las Vegas, they are greatly appreciated.



A fellow scientist in the field of informatics and computing