#Is there a way to implement windows functions in c++ without using #include <windows.h>

1 messages · Page 1 of 1 (latest)

bronze shardBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

hearty olive
wet swan
#
int MessageBoxA(void* hwnd, char* text, char* caption, int type);
int main(void) {
    MessageBox(0, "Message", "Caption", 0);
}```
hearty olive
#

what's not working?

wet swan
#

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "int __cdecl MessageBoxA(void *,char const *,char const *,int)" (?MessageBoxA@@YAHPEAXPEBD1H@Z) referenced in function main

foggy cradle
#

you need to link the windows shared libraries

hearty olive
#

^

foggy cradle
hearty olive
#

the question is also very odd. Yes, you can definitely implement C++ functions without windows.h, but if you want to use window's functions, you must use windows.h

wet swan
#

Is there a way to implement windows functions in c++ without using #include <windows.h>

wet swan
hearty olive
#

no worries

wet swan
#

maybe i am missing the function pointer?

hearty olive
#

that post is about forward-declaration, the definitions are still included somewhere else

wet swan
#

kk thanks

bronze shardBOT
#

@wet swan

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

#

@wet swan Has your question been resolved? If so, run !solved :)

wet swan
#

!solved