Ask Your Question

getting error: expected expression before ‘IplImage’ in attempt to create alias for IplImage

asked 2013-10-11 20:01:44 -0500

joeish80829 gravatar image

updated 2013-10-12 04:47:51 -0500

Moster gravatar image

Im just basically trying to redifine IplImage so i can call it by a different shorter function name like ii

how do i do it ..I tried every possible combination for what i reference to the beow code:

my .c file

`IplImage* ii(int img)

{ return IplImage img; }`

my .h file

IplImage* ii(int img);

I've tried every combination i could think of (didnt think i should post all my tries) from changing struct to return, int to IplImage to IplImage* ...leaving out the int img

mainly i'm getting this error (if i should post other errors pls let me to S.O.)

expected primary-expression before ‘img’

if some one could let me know of a resource to teach me how to redefine struct calls i/e IplImage* img; I would appreciate it....tried googling but no luck...or if you can tell me how to redefine this alias i can apply that knowledge to my future endeavours, thank you.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-10-14 08:06:52 -0500

Artem gravatar image

There are #define and typedef that can make it work, but it seems that you need to study at least some basic c/c++ before trying to do something with opencv.

edit flag offensive delete link more


Actually in addition to that, I am wondering if you really need IplImage structures? They are old C-style API and they are depricated. You should switch to the newer C++ interface, which uses Mat elements, and I guess renaming that is quite stupid.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-10-14 08:33:41 -0500 )edit

Question Tools


Asked: 2013-10-11 20:01:44 -0500

Seen: 197 times

Last updated: Oct 14 '13