Bug 244309 - muParserDLL.h is unusable as is
muParserDLL.h is unusable as is
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: muParser (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Frank Büttner
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-14 17:43 EDT by Zoltan Boszormenyi
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 1.27-5.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-18 12:43:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Allow using muParserDLL.h on non-Windows systems (1.78 KB, patch)
2007-06-14 17:43 EDT, Zoltan Boszormenyi
no flags Details | Diff

  None (edit)
Description Zoltan Boszormenyi 2007-06-14 17:43:48 EDT
Description of problem:

muParserDLL.h assumes it runs on Windows and the underlying code
is omitted if compiled on non-Windows.

Version-Release number of selected component (if applicable):

1.27

How reproducible:

always

Steps to Reproduce:
1. create a testprogram that uses muParserDLL.h
2. compile 
3.
  
Actual results:

doesn't compiles

Expected results:

it should compile and work

Additional info:
Comment 1 Zoltan Boszormenyi 2007-06-14 17:43:48 EDT
Created attachment 157047 [details]
Allow using muParserDLL.h on non-Windows systems
Comment 2 Frank Büttner 2007-06-15 03:52:34 EDT
You have take the wrong file.
When you look at the documentation you will see that you must include muParser.h
on all platforms. The muParserDLL.h is only needed to export the symbols for the
Microsoft compiler when build on windows.
Comment 3 Zoltan Boszormenyi 2007-06-15 06:15:23 EDT
NOTABUG isn't right. I would like to use the "DLL" interface functions
from C code, not the C++ interface. And link the resulting .o or .so into
a larger C program. And this is not accessible on Linux as muParser 1.27 stands.
Here's an example of what I would like to do, a custom SPI module for
PostgreSQL.

----8<--------- test1.cc ---------8<----
#include <muParser.h>

extern "C"
{

#include "postgres.h"
#include "fmgr.h"
#include "utils/elog.h"

extern Datum test1(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(test1);

Datum test1(PG_FUNCTION_ARGS) {
  char  *formula = "3 * 7";
  parser_handle hParser;
  double val;

  hParser = mupInit();

  mupSetExpr(hParser, formula);
  val = mupEval(hParser);

  ereport(NOTICE, (errmsg("%lf", val)));

  mupRelease(hParser);

  PG_RETURN_NULL();
}

}
----8<--------- test1.cc ---------8<----

I get this when using only <muParser.h>:

$ USE_PGXS=1 make
g++ -fpic -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal
-D_GNU_SOURCE   -c -o test1.o test1.cc
test1.cc: In function ‘Datum test1(FunctionCallInfoData*)’:
test1.cc:15: error: ‘parser_handle’ was not declared in this scope
test1.cc:15: error: expected `;' before ‘hParser’
test1.cc:18: error: ‘hParser’ was not declared in this scope
test1.cc:18: error: ‘mupInit’ was not declared in this scope
test1.cc:20: error: ‘mupSetExpr’ was not declared in this scope
test1.cc:21: error: ‘mupEval’ was not declared in this scope
test1.cc:25: error: ‘mupRelease’ was not declared in this scope
make: *** [test1.o] Error 1

So to use the "DLL interface" I explicitly need to include <muParserDLL.h>.
But with the original code, I get this:

In file included from test1.cc:1:
/usr/include/muParserDLL.h:43:21: error: windows.h: No such file or directory
/usr/include/muParserDLL.h:63: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:64: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:65: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:66: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:67: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:68: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:70: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:73: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:74: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:75: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:76: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:77: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:79: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:80: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:81: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:83: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:84: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:85: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:86: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:87: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:88: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:89: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:92: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:93: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:94: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:97: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:98: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:99: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:100: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:103: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:104: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:105: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:106: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:107: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:108: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:111: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:114: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:115: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:116: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:117: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:118: error: expected constructor, destructor, or type
conversion before ‘(’ token
/usr/include/muParserDLL.h:119: error: expected constructor, destructor, or type
conversion before ‘(’ token
test1.cc: In function ‘Datum test1(FunctionCallInfoData*)’:
test1.cc:18: error: ‘mupInit’ was not declared in this scope
test1.cc:20: error: ‘mupSetExpr’ was not declared in this scope
test1.cc:21: error: ‘mupEval’ was not declared in this scope
test1.cc:25: error: ‘mupRelease’ was not declared in this scope
make: *** [test1.o] Error 1

The patch is needed for C code to use and successfully link with -lmuparser.
I also sent the patch to the muParser mainstream maintainer for consideration.
Comment 4 Frank Büttner 2007-06-15 09:44:00 EDT
Please add more infos for the next report, so that it will much cleaner what you
have done and what will not work. Please check the new one in the testing repo.
Comment 5 Fedora Update System 2007-06-16 09:22:10 EDT
muParser-1.27-5.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Fedora Update System 2007-06-18 12:43:28 EDT
muParser-1.27-5.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.