[q-lang-users] modules in c++
Brought to you by:
agraef
From: Brian W. <drc...@gm...> - 2005-08-26 20:54:31
|
Hi folks, I'm sorry if this is off topic, but I'm having a hard time finding doc on the web. I'm trying to write an external module in C++. (It's actually a cover for the Blitz++ array library.) Using the bar.c example from the documentation (reproduced below), the first step in running qcc is always: $ qcc -v bar.c gcc -c bar.c ... So I decided to try the simplest thing I could think of: rename bar.c to bar.cpp, and run g++: g++ -c bar.cpp I get a pack of errors that look like: In file included from bar.cpp:1: C:/Tools/Qpad/include/libq.h:130: error: external linkage required for symbol 'truesym' because of 'dllimport' attribute. C:/Tools/Qpad/include/libq.h:130: error: external linkage required for symbol 'falsesym' because of 'dllimport' attribute. ... My question is: how do I make g++ do the right thing on "dllimport"s? Thanks very much. Brian ----------------- bar.c --------------------- #include <libq.h> MODULE(bar) typedef struct { long i, j; } Bar; FUNCTION(bar,bar,argc,argv) { long i, j; if (argc !=3D 2 || !isint(argv[0], &i) || !isint(argv[1], &j)) return __FAIL; else { Bar *v =3D malloc(sizeof(Bar)); expr x; if (!v) return __ERROR; v->i =3D i; v->j =3D j; return mkobj(type(Bar), v); } } --------------------------------------------- --=20 Brian P. Wilfley, Ph.D. Principal Scientist Voice: 650.331.3476 x102 Fax: 650.887.2205 E-mail: bwi...@tr... Triple Ring Technologies, Inc. 1850 Embarcadero Road Palo Alto, CA 94303 |