Q
Q
Quark2021-09-20 20:32:49
C++ / C#
Quark, 2021-09-20 20:32:49

Why can't I modify a statement in my DLL?

According to Ian Mellington's book, I'm trying to modify the operator, adding to it the ability to multiply my coordinate structures. However, when I try to do this in a DLL, I get an error E0345(Too few parameters for this operator function).

Here's what my operator declaration looks like in the DLL:

extern "C" GRAPHICLIBRARY_API void operator*= (const Vector2 value);


And here is how in my project in the title: What am I doing wrong and how can I get around it? Thanks in advance for your help.
void operator*= (const Vector2 value);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2021-09-20
@Quark_Hell

I get error E0345(Too few parameters for this operator function).
extern "C" GRAPHICLIBRARY_API void operator*= (const Vector2 value);

The operator *=multiplies something by something. And in this prototype it has only one parameter. So the compiler is correct. See _
And here's how in my project in the header:
void operator*= (const Vector2 value);

It remains to add that in your project this prototype is inside some class and everything will fall into place.
I suspect you should do something like this:
extern "C" GRAPHICLIBRARY_API void operator*= (Vector2& left, const Vector2 right);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question