error using the loadlibrary function

I am getting a loadlibrary error on line 421, and cannot figure out why. I have microsoft visual c++ 2010 express, and windows jdk, so i should be good to go.
Also, if i compile a program that uses the 'loadlibrary' function into an executable, can computers w/out a c/c++ compiler still run the code?

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Jun. de 2013

0 votos

We will need to see some of your log of the session. I have no idea at the moment what "line 421" refers to -- your line 421? Line 421 inside one of the Mathworks routines? And what error is occurring?
Which MATLAB version are you using?
If you use loadlibrary() with the name of a .h file, then that requires a C/C++ compiler at run-time. You can, however, create an information file that has all the necessary information, and you can compile that information into the executable and then the C/C++ compiler would not be needed at run-time. (My memory is telling me that you must use that form if you are building an executable.)

4 comentarios

ryan
ryan el 14 de Jun. de 2013
Editada: Walter Roberson el 14 de Jun. de 2013
i am using 2011b. it errors out at line 421 of load library. looks something like this:
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Failed to parse type '" C " struct TimeTag { unsigned long MilliSeconds ; unsigned short MicroSeconds ; short int JulianDay ; }' original input '" C " struct TimeTag { unsigned long MilliSeconds ; unsigned short MicroSeconds ; short int JulianDay ; }'
Found on line 133 of input from line 132 of file C:\\Users\\username\\Desktop\\folder\\HeaderFile.h
Then a whole bunch of errors that look like this:
C:\Users\username\Desktop\folder\libfun.h(542) : error C2143: syntax error : missing ')' before '*'
ryan
ryan el 14 de Jun. de 2013
I am trying to simply do this in the command window. Do i have to do something else first?
Walter Roberson
Walter Roberson el 14 de Jun. de 2013
Please show the code for 20 or so lines before and after line 132 of HeaderFile.h .
Is the library written in C or C++ ? Can you tell whether the .h file is written in C or in C++ ?
ryan
ryan el 14 de Jun. de 2013
Also it appears that each error line occurs in the header file whenever a function returning a variable of type 'struct' is called. Could this possibly be a compiler isssue, i am using microsoft visual c++ 2010 express.

Iniciar sesión para comentar.

Categorías

Productos

Preguntada:

el 14 de Jun. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by