Skip to main content
GameDev.net gamedev.net
🔒 Locked

Need help Compiling Program with Dev-C++

Started by ph33r May 9, 2003 at 11:27 AM 0 replies 800+ views
Original Post
ph33r
ph33r
I am wondering if you can use Dev-C++ to use functions in winspool.h such as OpenPrinter and ClosePrinter When I try to do a simple program like
  
#include <iostream>
#include <windows.h>

int main(int argc, char *argv[])
{


LPHANDLE hPrinter;

if(OpenPrinter("HP OfficeJet Pro 1170C Series", hPrinter, NULL))
std::cout << "Printer Opened Successfully" << std::endl;
else
std::cout << "Printer Failed to open" << std::endl;

if(ClosePrinter(hPrinter))
std::cout << "Printer Closed Succesfully" << std::endl;
else
std::cout << "Printer Failed to close" << std::endl;


system("PAUSE"); 
return 0;
}  
Dev-C++ gives me this error [Linker error] undefined reference to `OpenPrinterA@12'' [Linker error] undefined reference to `ClosePrinter@4'' I tried adding winspool.lib to Project Options->Parameters tab then Add Library or Object Anyone know why I am getting these errors?
Null and Void
Null and Void
quote:
Original post by ph33r
I tried adding winspool.lib to Project Options->Parameters tab then Add Library or Object

Anyone know why I am getting these errors?

Maybe because it''s called libwinspool.a in MinGW and it''s linked with -lwinspool?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.