Jump to content
RockWare Support Forum

Recommended Posts

Hello, I am currently working on a project that requires MATLAB to communicate with Geochemist's Workbench. I found the sample code provided within the documentation and tried compiling it as a MATLAB MEX file only to receive many errors such as:

lcc preprocessor error: pipe.cpp:4 Could not find include file <iostream>

lcc preprocessor error: pipe.cpp:5 Could not find include file <string>

Error pipe.cpp: .\RC_helper.cpp: 26 syntax error; found `stdiopipe' expecting `;'

Error pipe.cpp: .\RC_helper.cpp: 26 syntax error; found `(' expecting `)'

Error pipe.cpp: .\RC_helper.cpp: 26 skipping `(' "unnamedpipe"

Error pipe.cpp: .\RC_helper.cpp: 26 extraneous old-style parameter list

Error pipe.cpp: .\RC_helper.cpp: 26 syntax error; found `)' expecting `;'

Error pipe.cpp: .\RC_helper.cpp: 26 skipping `)'

Error pipe.cpp: .\RC_helper.cpp: 30 syntax error; found `&' expecting `)'

Error pipe.cpp: .\RC_helper.cpp: 30 skipping `&' `pipe'

Error pipe.cpp: .\RC_helper.cpp: 32 undeclared identifier `pipe'

Error pipe.cpp: .\RC_helper.cpp: 32 left operand of . has incompatible type `int'

Error pipe.cpp: .\RC_helper.cpp: 32 type error: pointer expected

Warning pipe.cpp: .\RC_helper.cpp: 32 possible usage of pipe before definition

Error pipe.cpp: .\RC_helper.cpp: 36 redefinition of `Clear' previously defined at .\RC_helper.cpp 30

Error pipe.cpp: .\RC_helper.cpp: 36 redeclaration of `Clear' previously declared at .\RC_helper.cpp 30

Error pipe.cpp: .\RC_helper.cpp: 37 too many arguments to `Clear'

Error pipe.cpp: .\RC_helper.cpp: 38 asm: label _Clear: redefined

Error pipe.cpp: .\RC_helper.cpp: 43 syntax error; found `&' expecting `)'

Error pipe.cpp: .\RC_helper.cpp: 43 skipping `&' `pipe'

Error pipe.cpp: .\RC_helper.cpp: 45 undeclared identifier `DWORD'

Warning pipe.cpp: .\RC_helper.cpp: 45 Statement has no effect

Error pipe.cpp: .\RC_helper.cpp: 45 too many errors

I was wondering if you know if it's something I'm doing wrong or if the provided code itself does not function. If so, who do you suggest I contact to aid in the process of writing a pipe between MATLAB and GWB?

Thank you.

Share this post


Link to post
Share on other sites

Hello:

I recommend checking your syntax- as the error messages suggest,this is likely cause by missing a semicolon somewhere. If this occurs in one line of code, all of the other lines of code can become uninterpretable.

I hope that helps,

Tom Meuzelaar

RockWare,Inc.

Share this post


Link to post
Share on other sites

Thank you for your quick response. The problem is that all of the errors appear to be in the RC_helper.cpp/RC_helper.h (whichever I try) file provided with the program. So it appears that the syntax within the library file that came with the program is incorrect...

Have others used the RC_helper.cpp/RC_helper.h file successfully?

I also tried compiling the unedited RC_example2.cpp and I got:

Error RC_example2.cpp: .\RC_helper.h: 9 syntax error; found `CharArray' expecting `;'

Error RC_example2.cpp: .\RC_helper.h: 9 syntax error; found `{' expecting `;'

Error RC_example2.cpp: .\RC_helper.h: 9 skipping `{'

Error RC_example2.cpp: .\RC_helper.h: 10 syntax error; found `:' expecting `;'

Error RC_example2.cpp: .\RC_helper.h: 10 skipping `:'

Error RC_example2.cpp: .\RC_helper.h: 11 redeclaration of `CharArray' previously declared at .\RC_helper.h 9

Error RC_example2.cpp: .\RC_helper.h: 11 syntax error; found `:' expecting `;'

Error RC_example2.cpp: .\RC_helper.h: 11 skipping `:'

Error RC_example2.cpp: .\RC_helper.h: 11 syntax error; found `1024' expecting `)'

Error RC_example2.cpp: .\RC_helper.h: 11 skipping `1024'

Error RC_example2.cpp: .\RC_helper.h: 12 undeclared identifier `m_buff'

Error RC_example2.cpp: .\RC_helper.h: 12 type error in argument 1 to `malloc'; found `pointer to int function(void)' expected `unsigned int'

Error RC_example2.cpp: .\RC_helper.h: 12 operands of = have illegal types `int' and `pointer to char'

Error RC_example2.cpp: .\RC_helper.h: 13 undeclared identifier `m_size'

Error RC_example2.cpp: .\RC_helper.h: 13 operands of = have illegal types `int' and `pointer to int function(void)'

Error RC_example2.cpp: .\RC_helper.h: 13 type error: pointer expected

Warning RC_example2.cpp: .\RC_helper.h: 14 missing return value

Error RC_example2.cpp: .\RC_helper.h: 15 unrecognized declaration

Error RC_example2.cpp: .\RC_helper.h: 15 undeclared identifier `m_buff'

Error RC_example2.cpp: .\RC_helper.h: 15 type error in argument 1 to `free'; found `int' expected `pointer to void'

Warning RC_example2.cpp: .\RC_helper.h: 15 possible usage of m_buff before definition

Warning RC_example2.cpp: .\RC_helper.h: 15 missing return value

Error RC_example2.cpp: .\RC_helper.h: 16 undeclared identifier `m_size'

Warning RC_example2.cpp: .\RC_helper.h: 16 possible usage of m_size before definition

Error RC_example2.cpp: .\RC_helper.h: 18 too many errors

Share this post


Link to post
Share on other sites

Hello:

Yes, I've used the RC_helper.h and RC_helper.cpp source files without too much trouble using Visual Studio. I had to adjust a few settings in the default setup for VS, including:

1. In project settings, remove explicit use of the Unicode character set.

2. Turn off use of precompiled headers

However, these settings are specific to Visual Studio, so they may or may not help you. I can tell you that there is nothing wrong with the RC_helper.h and RC_helper.cpp code, and that your problem is probably somewhere in the configuration of the application you are using for code development.

Unfortunately, my response time will be much slower after this, as I am about to step out for a 4-day holiday weekend.

Regards,

Tom Meuzelaar

RockWare, Inc.

Share this post


Link to post
Share on other sites

×