Dev-Cpp icon indicating copy to clipboard operation
Dev-Cpp copied to clipboard

Undefined reference to alphablend

Open Yedboy opened this issue 1 year ago • 13 comments

I'm trying to test blur C++ effect but it says "Undefined reference to alphablend" what to do?

Yedboy avatar Aug 16 '24 20:08 Yedboy

This should be a problem with the compiler Can you link the msimg32.lib library file?

ImAurs avatar Aug 26 '24 11:08 ImAurs

I linked msimg32.lib. Still the same thing.

Yedboy avatar Aug 26 '24 20:08 Yedboy

Are you include wingdi.h in code?

ImAurs avatar Aug 27 '24 00:08 ImAurs

oh thanks

Yedboy avatar Aug 27 '24 07:08 Yedboy

keeps saying undefined reference to `_imp__AlphaBlend@44'

Yedboy avatar Aug 27 '24 07:08 Yedboy

Are you linked msimg32.lib in code? try link msimg32.lib in linker options

ImAurs avatar Aug 27 '24 12:08 ImAurs

where to find compiler options

Yedboy avatar Aug 28 '24 09:08 Yedboy

First open your project and click "Tools"Button, and click to "Compiler Options", "Add the following commands when calling the linker" the following input box

ImAurs avatar Aug 28 '24 10:08 ImAurs

I wrote some code: #include <windows.h> #include <wingdi.h>

int main() { AlphaBlend(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); return 0; } linker not say "Undefined reference to alphablend" Can you try the code?(replace "NULL" to your paramet pls)

ImAurs avatar Aug 28 '24 10:08 ImAurs

It says 5 72 C:\Users\DELL\OneDrive\Escritorio\main.cpp [Error] could not convert '0' from 'int' to 'BLENDFUNCTION' {aka '_BLENDFUNCTION'}

Yedboy avatar Aug 31 '24 12:08 Yedboy

replace "NULL" to your paramet pls.........

ImAurs avatar Aug 31 '24 13:08 ImAurs

I did replace NULL to my paramet

Yedboy avatar Aug 31 '24 19:08 Yedboy

emm

ImAurs avatar Sep 08 '24 04:09 ImAurs

emm

Can you make a video of how to do it so i understand? I'm a cpp newbie

Yedboy avatar Dec 12 '24 20:12 Yedboy

Do you have test code?

ImAurs avatar Dec 13 '24 10:12 ImAurs

I said make a video ._.

Yedboy avatar Dec 14 '24 15:12 Yedboy

That's right, but I don't have instance code and I don't know much about Windows graphics APIs

ImAurs avatar Dec 14 '24 23:12 ImAurs

I mean the video of how to link it

Yedboy avatar Dec 16 '24 20:12 Yedboy

emm

ImAurs avatar Dec 17 '24 09:12 ImAurs

emm

Does this mean you will produce a video or not?

checkdigits avatar Dec 26 '24 15:12 checkdigits

I don't know.

ImAurs avatar Dec 27 '24 09:12 ImAurs

This is the reason for the Windows API and "It says 5 72 C:\Users\DELL\OneDrive\Escritorio\main.cpp [Error] could not convert '0' from 'int' to 'BLENDFUNCTION' {aka '_BLENDFUNCTION'}" This error is because an int value was passed in a parameter of AlphaBlend instead of BLENDFUTURE (without type conversion)

ImAurs avatar Dec 27 '24 09:12 ImAurs

oh i realized i was a dumbass i needed to add it to linker, and now it works, thx

Yedboy avatar May 03 '25 15:05 Yedboy