vensim link matlab
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
vensim link matlab
hi,My vensim is DSS & Ihave win 7 (64bit),How Can I link vensim to matlab?
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
There is already a thread on this subject, have a look at
http://www.ventanasystems.co.uk/forum/v ... php?t=4181
http://www.ventanasystems.co.uk/forum/v ... php?t=4181
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
You don't open the .dll as a program; you load it via code in matlab - see http://www.mathworks.com/access/helpdes ... 43202.html for details. Your matlab code will be fairly close to the code in the .dll examples that install with Vensim (look in the dll folder in your Vensim program directory).
A good first step would be to see if you can load the library and view the functions, as in
http://www.mathworks.com/access/helpdes ... tml#f42310
if not(libisloaded('libmx'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('libmx', hfile);
end
libfunctionsview libmx
Replace libmx above with ven32dll (which should be in your windows directory, e.g. c:\windows\system32 on XP) and hfile with C:\Program Files\Vensim\dll\vendll.h (or the path to your dll folder in the Vensim program directory).
Hopefully this will work; unfortunately I don't have a copy of Matlab to test with.
Tom
A good first step would be to see if you can load the library and view the functions, as in
http://www.mathworks.com/access/helpdes ... tml#f42310
if not(libisloaded('libmx'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('libmx', hfile);
end
libfunctionsview libmx
Replace libmx above with ven32dll (which should be in your windows directory, e.g. c:\windows\system32 on XP) and hfile with C:\Program Files\Vensim\dll\vendll.h (or the path to your dll folder in the Vensim program directory).
Hopefully this will work; unfortunately I don't have a copy of Matlab to test with.
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you Tom for your help
I run these two (as you said):
if not(libisloaded('libmx'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('libmx', hfile);
end
libfunctionsview libmx
&
if not(libisloaded('ven32dll'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('ven32dll', hfile);
end
libfunctionsview ven32dll
but for both of them, matlab gives me this error:
??? Error using ==> loadlibrary at 263
microsoft visual C++ 2005 is required to use this feature.
I checked my computer & I have microsoft visual C++ 2005.
even I installed it again after this error but it gives me that error again!!!!!!!!
I run these two (as you said):
if not(libisloaded('libmx'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('libmx', hfile);
end
libfunctionsview libmx
&
if not(libisloaded('ven32dll'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('ven32dll', hfile);
end
libfunctionsview ven32dll
but for both of them, matlab gives me this error:
??? Error using ==> loadlibrary at 263
microsoft visual C++ 2005 is required to use this feature.
I checked my computer & I have microsoft visual C++ 2005.
even I installed it again after this error but it gives me that error again!!!!!!!!
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thanks
1)My previous verson of Matlab-soft was 2008a,I unistalled it & installed Matlab 2010(R 2009a), then after run this program:
>> if not(libisloaded('libmx'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('libmx', hfile);
end
libfunctionsview libmx
it gives me :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
And it opens a table (it’s title Function Is Library libmx)
…………………………………
And when run:
if not(libisloaded('ven32dll'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('ven32dll', hfile);
end
libfunctionsview ven32dll
…………………..
It gives me :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
??? Error using ==> loadlibrary at 480
There was an error loading the library "ven32dll"
The specified module could not be found.
Caused by:
Error using ==> loaddefinedlibrary
The specified module could not be found.
.....................................................................................
2) I couldn’t open these files: http://www.mathworks.com/access/helpdes ... 43202.html
http://www.mathworks.com/access/helpdes ... tml#f42310
Can any one help me please ?
1)My previous verson of Matlab-soft was 2008a,I unistalled it & installed Matlab 2010(R 2009a), then after run this program:
>> if not(libisloaded('libmx'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('libmx', hfile);
end
libfunctionsview libmx
it gives me :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
And it opens a table (it’s title Function Is Library libmx)
…………………………………
And when run:
if not(libisloaded('ven32dll'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('ven32dll', hfile);
end
libfunctionsview ven32dll
…………………..
It gives me :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
??? Error using ==> loadlibrary at 480
There was an error loading the library "ven32dll"
The specified module could not be found.
Caused by:
Error using ==> loaddefinedlibrary
The specified module could not be found.
.....................................................................................
2) I couldn’t open these files: http://www.mathworks.com/access/helpdes ... 43202.html
http://www.mathworks.com/access/helpdes ... tml#f42310
Can any one help me please ?
Sounds like you need to check your system directories to see if the dll is installed. Or, just reinstall Vensim, and be sure that the .dll option is checked.
Tom
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
now I try this :
>> if not(libisloaded('vendll32'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('vendll32', hfile);
end
libfunctionsview vendll32
...........................................
it gives me :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
??? Error using ==> loadlibrary at 480
There was an error loading the library "vendll32"
The specified module could not be found.
>> if not(libisloaded('vendll32'))
hfile = [matlabroot '\extern\include\matrix.h'];
loadlibrary('vendll32', hfile);
end
libfunctionsview vendll32
...........................................
it gives me :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
??? Error using ==> loadlibrary at 480
There was an error loading the library "vendll32"
The specified module could not be found.
Sorry about the name mistake. Did you look in your system folders to see if the .dll is installed?
Tom
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Member
- Posts: 36
- Joined: Fri Aug 20, 2010 11:03 am
I think your header file (matrix.h) is the wrong one. You got that one from the example with the libmx library on the mathworks page, didn't you? That won't work for vensim.
The correct header file is vendll.h, it can be found in the same folder as vendll32.lib.
Now, if you navigate to that folder after opening matlab, you can simply type
loadlibrary('vendll32','vendll').
The correct header file is vendll.h, it can be found in the same folder as vendll32.lib.
Now, if you navigate to that folder after opening matlab, you can simply type
loadlibrary('vendll32','vendll').
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you
Yes,I see the both of them in DLL subdirectory: VenDLL32.lib & Vendll.h
Now I try that with full address of Vendll.h:
if not(libisloaded('vendll32'))
hfile = ['C:\Program Files (x86)\Vensim\dll\vendll.h'];
loadlibrary('vendll32',hfile);
end
libfunctionsview vendll32
……………………..
It’s response is :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Type 'HWND' was not found. Defaulting to type error.
Found on line 111 of input from line 110 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 117 of input from line 116 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 128 of input from line 127 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 136 of input from line 135 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 142 of input from line 141 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 153 of input from line 152 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
*********
??? Error using ==> loadlibrary at 428
Building vendll32_thunk_pcwin64 failed. Compiler output is:
vendll32_thunk_pcwin64.c
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2146: syntax error : missing
')' before identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2061: syntax error :
identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2146: syntax error : missing
')' before identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2061: syntax error :
identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(87) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(87) : error C2146: syntax error : missing ';' before identifier 'p1'
vendll32_thunk_pcwin64.c(87) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(88) : error C2275: 'int32' : illegal use of this type as an expression
vendll32_thunk_pcwin64.c(44) : see declaration of 'int32'
vendll32_thunk_pcwin64.c(88) : error C2146: syntax error : missing ';' before identifier 'p2'
vendll32_thunk_pcwin64.c(88) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(91) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(91) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(91) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(91) : error C2100: illegal indirection
vendll32_thunk_pcwin64.c(91) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(91) : error C2297: '*' : illegal, right operand has type 'const char *'
vendll32_thunk_pcwin64.c(92) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(92) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(92) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(93) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(94) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(94) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(94) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(95) : error C2059: syntax error : ','
vendll32_thunk_pcwin64.c(95) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(95) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(95) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(95) : error C2059: syntax error : 'type'
vendll32_thunk_pcwin64.c(99) : error C2061: syntax error : identifier 'int32int32int32int32Thunk'
vendll32_thunk_pcwin64.c(99) : error C2059: syntax error : ';'
vendll32_thunk_pcwin64.c(99) : error C2059: syntax error : 'type'
vendll32_thunk_pcwin64.c(146) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(146) : error C2146: syntax error : missing ';' before identifier 'p3'
vendll32_thunk_pcwin64.c(146) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(153) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(153) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(153) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(153) : error C2100: illegal indirection
vendll32_thunk_pcwin64.c(153) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(153) : error C2297: '*' : illegal, right operand has type 'const char *'
vendll32_thunk_pcwin64.c(154) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(154) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(154) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(155) : error C2059: syntax error : ','
vendll32_thunk_pcwin64.c(155) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(155) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(155) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(155) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(155) : error C2146: syntax error : missing ';' before identifier 'fcn'
vendll32_thunk_pcwin64.c(155) : warning C4047: 'return' : 'int32' differs in levels of indirection
from 'int32 (__cdecl *)(int32,int32,int32,...)'
vendll32_thunk_pcwin64.c(155) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(155) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(218) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(218) : error C2146: syntax error : missing ';' before identifier 'p0'
vendll32_thunk_pcwin64.c(218) : error C2065: 'p0' : undeclared identifier
vendll32_thunk_pcwin64.c(219) : error C2143: syntax error : missing ';' before 'type'
vendll32_thunk_pcwin64.c(220) : error C2143: syntax error : missing ';' before 'type'
vendll32_thunk_pcwin64.c(221) : error C2065: 'p0' : undeclared identifier
vendll32_thunk_pcwin64.c(221) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(221) : error C2065: 'H
Yes,I see the both of them in DLL subdirectory: VenDLL32.lib & Vendll.h
Now I try that with full address of Vendll.h:
if not(libisloaded('vendll32'))
hfile = ['C:\Program Files (x86)\Vensim\dll\vendll.h'];
loadlibrary('vendll32',hfile);
end
libfunctionsview vendll32
……………………..
It’s response is :
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 399
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Type 'HWND' was not found. Defaulting to type error.
Found on line 111 of input from line 110 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 117 of input from line 116 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 128 of input from line 127 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 136 of input from line 135 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 142 of input from line 141 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 153 of input from line 152 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
*********
??? Error using ==> loadlibrary at 428
Building vendll32_thunk_pcwin64 failed. Compiler output is:
vendll32_thunk_pcwin64.c
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(110) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(116) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2146: syntax error : missing
')' before identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2061: syntax error :
identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(127) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(135) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2146: syntax error : missing
')' before identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2061: syntax error :
identifier 'pwindow'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(141) : error C2059: syntax error : ')'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2146: syntax error : missing
')' before identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2081: 'HWND' : name in formal
parameter list illegal
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2061: syntax error :
identifier 'window'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2059: syntax error : ';'
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2059: syntax error : ','
C:\Program Files\MATLAB\R2010a\extern\include\vendll.h(152) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(87) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(87) : error C2146: syntax error : missing ';' before identifier 'p1'
vendll32_thunk_pcwin64.c(87) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(88) : error C2275: 'int32' : illegal use of this type as an expression
vendll32_thunk_pcwin64.c(44) : see declaration of 'int32'
vendll32_thunk_pcwin64.c(88) : error C2146: syntax error : missing ';' before identifier 'p2'
vendll32_thunk_pcwin64.c(88) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(91) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(91) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(91) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(91) : error C2100: illegal indirection
vendll32_thunk_pcwin64.c(91) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(91) : error C2297: '*' : illegal, right operand has type 'const char *'
vendll32_thunk_pcwin64.c(92) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(92) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(92) : error C2065: 'p1' : undeclared identifier
vendll32_thunk_pcwin64.c(93) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(94) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(94) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(94) : error C2065: 'p2' : undeclared identifier
vendll32_thunk_pcwin64.c(95) : error C2059: syntax error : ','
vendll32_thunk_pcwin64.c(95) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(95) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(95) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(95) : error C2059: syntax error : 'type'
vendll32_thunk_pcwin64.c(99) : error C2061: syntax error : identifier 'int32int32int32int32Thunk'
vendll32_thunk_pcwin64.c(99) : error C2059: syntax error : ';'
vendll32_thunk_pcwin64.c(99) : error C2059: syntax error : 'type'
vendll32_thunk_pcwin64.c(146) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(146) : error C2146: syntax error : missing ';' before identifier 'p3'
vendll32_thunk_pcwin64.c(146) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(153) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(153) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(153) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(153) : error C2100: illegal indirection
vendll32_thunk_pcwin64.c(153) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(153) : error C2297: '*' : illegal, right operand has type 'const char *'
vendll32_thunk_pcwin64.c(154) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(154) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(154) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(155) : error C2059: syntax error : ','
vendll32_thunk_pcwin64.c(155) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(155) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(155) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(155) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(155) : error C2146: syntax error : missing ';' before identifier 'fcn'
vendll32_thunk_pcwin64.c(155) : warning C4047: 'return' : 'int32' differs in levels of indirection
from 'int32 (__cdecl *)(int32,int32,int32,...)'
vendll32_thunk_pcwin64.c(155) : error C2059: syntax error : ')'
vendll32_thunk_pcwin64.c(155) : error C2065: 'p3' : undeclared identifier
vendll32_thunk_pcwin64.c(218) : error C2065: 'HWND' : undeclared identifier
vendll32_thunk_pcwin64.c(218) : error C2146: syntax error : missing ';' before identifier 'p0'
vendll32_thunk_pcwin64.c(218) : error C2065: 'p0' : undeclared identifier
vendll32_thunk_pcwin64.c(219) : error C2143: syntax error : missing ';' before 'type'
vendll32_thunk_pcwin64.c(220) : error C2143: syntax error : missing ';' before 'type'
vendll32_thunk_pcwin64.c(221) : error C2065: 'p0' : undeclared identifier
vendll32_thunk_pcwin64.c(221) : error C2146: syntax error : missing ')' before identifier 'HWND'
vendll32_thunk_pcwin64.c(221) : error C2065: 'H
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
I delete:( these rows and where I see (HWND pwindow ) I substitute it with void*.
#ifndef HWND
#define HWND void *
#endif
………………………………………
>> if not(libisloaded('vendll32'))
hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h'];
loadlibrary('vendll32', hfile);
end
libfunctionsview vendll32
??? Error using ==> loadlibrary at 474
There was an error loading the library "vendll32"
The specified module could not be found.
Caused by:
Error using ==> loaddefinedlibrary
The specified module could not be found.
even I uninstalled matlab 64(bit) & install 32bit.But it gives me the same error!!!!!!!:(
#ifndef HWND
#define HWND void *
#endif
………………………………………
>> if not(libisloaded('vendll32'))
hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h'];
loadlibrary('vendll32', hfile);
end
libfunctionsview vendll32
??? Error using ==> loadlibrary at 474
There was an error loading the library "vendll32"
The specified module could not be found.
Caused by:
Error using ==> loaddefinedlibrary
The specified module could not be found.
even I uninstalled matlab 64(bit) & install 32bit.But it gives me the same error!!!!!!!:(
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Above, you said:
Yes,I see the both of them in DLL subdirectory: VenDLL32.lib & Vendll.h
It sounds like your modified vendll.h is now OK. What you may still be missing is vendll32.dll (not .lib) in your system path.
Tom
Yes,I see the both of them in DLL subdirectory: VenDLL32.lib & Vendll.h
It sounds like your modified vendll.h is now OK. What you may still be missing is vendll32.dll (not .lib) in your system path.
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Maybe try giving it the full path then, e.g.
vendll = ['c:\windows\sysWOW64\vendll32.dll']; (or whatever the real path is)
hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h'];
loadlibrary( vendll , hfile);
?
Tom
vendll = ['c:\windows\sysWOW64\vendll32.dll']; (or whatever the real path is)
hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h'];
loadlibrary( vendll , hfile);
?
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you Tom ,
I tried :
>> vendll=['C:\Windows\SysWOW64\venDLL32.dll']
vendll =
C:\Windows\SysWOW64\venDLL32.dll
>> hfile=['C:\Program Files (x86)\Vensim\dll\vendll.h']
hfile =
C:\Program Files (x86)\Vensim\dll\vendll.h
>> loadlibrary('vendll',hfile)
……………………………………………………………………………………………………….
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 394
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Type 'HWND' was not found. Defaulting to type error.
Found on line 111 of input from line 110 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 117 of input from line 116 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 128 of input from line 127 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 136 of input from line 135 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 142 of input from line 141 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 153 of input from line 152 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
*********
??? Error using ==> loadlibrary at 422
Building vendll_thunk_pcwin64 failed. Compiler output is:
vendll_thunk_pcwin64.c
.
.
.
.
The same error!
I tried :
>> vendll=['C:\Windows\SysWOW64\venDLL32.dll']
vendll =
C:\Windows\SysWOW64\venDLL32.dll
>> hfile=['C:\Program Files (x86)\Vensim\dll\vendll.h']
hfile =
C:\Program Files (x86)\Vensim\dll\vendll.h
>> loadlibrary('vendll',hfile)
……………………………………………………………………………………………………….
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 394
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Type 'HWND' was not found. Defaulting to type error.
Found on line 111 of input from line 110 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 117 of input from line 116 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 128 of input from line 127 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 136 of input from line 135 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 142 of input from line 141 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
Type 'HWND' was not found. Defaulting to type error.
Found on line 153 of input from line 152 of file C:\\Program Files (x86)\\Vensim\\dll\\vendll.h
*********
??? Error using ==> loadlibrary at 422
Building vendll_thunk_pcwin64 failed. Compiler output is:
vendll_thunk_pcwin64.c
.
.
.
.
The same error!
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
it sounds like you are pointing to the original vendll.h file or perhaps you reinstalled Vensim and overwrote the one you had edited. You should probably edit the file and place it in a directory with other files you are using so that you can be sure you are pointing at your edited file at all times.
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
I think what Bob means is that you're back to using the original hfile = C:\Program Files (x86)\Vensim\dll\vendll.h where you should be using your modified hfile = C:\Users\mrj\Desktop\New folder (3)\vendll.h'
Tom
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/