Jump to content
  • Advertisement
Sign in to follow this  
zappernapper

dev, win32 api, and graphic primitives

This topic is 4894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i'm trying to draw graphic primitves in dev, using the win32 api. i'm #including <windows.h> and the library where these functions are supposed to be has even been specifically including using #pragma comment, even though i'm 99% certain that libgdi32 is being included by default. anyway, the compiler doesn't recognize the functions like TextOut() or CreatePen(), the only funtion like that i've gotten to work is DrawText() and i don't think that it's in libgdi32. ne1 know what i could do? the compiler errors are kind of weird because they don't call the function by the same exact name i'm using to call them.... which may be the problem... here's a snippet and the corresponding error: ... TextOut(hDC, 10, 10, TEXT("Hello"), 5); ... [Linker error] undefined reference to `TextOutA@20' and the compile log: Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\projects\cropCricles\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\projects\cropCricles\Makefile.win" all g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" -I"C:/dxsdk/SDK (C++)/Include" windres.exe -i cropCircles_private.rc -I rc -o cropCircles_private.res -O coff g++.exe GameEngine.o main.o cropCircles_private.res -o "cropCircles.exe" -L"C:/Dev-Cpp/lib" -L"C:/dxsdk/Lib" main.o(.text+0x140):main.cpp: undefined reference to `TextOutA@20' make.exe: *** [cropCircles.exe] Error 1 Execution terminated

Share this post


Link to post
Share on other sites
Advertisement
Have you ever tried using the default windows api application? In Dev, its like File - New - Windows App. You could check the code in there to see what they include and then maybe add your functions in on top of that code. You could just cut and paste it over. This might not solve your problem, but it couldn't hurt to try. I don't program using the windows api that much.

Share this post


Link to post
Share on other sites
TextOut "mutating" to TextOutA is a simple macro trick. The windows headers are full of this. This enables you to enable unicode by simply setting a define, without modifying any code. TextOut is a define that either maps to TextOutA or TextOutW.

About the pragma comment, i had the impression that was a MSVC specific pragma and not widely supported? Did you try to include the library the "correct" way?

Share this post


Link to post
Share on other sites
no, that was the way that was suggested to me.... any help would be appreciated

and i don't want to use dev's windows template, i'd like to use my own i made.... but maybe i should just load it then copy and paste my own code over what's already in there like u suggested

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!