first time user cannot compile to use CUPS function

Bryan brewmanz at gmail.com
Mon Apr 11 18:38:14 PDT 2011


I'm a M$ C# programmer returning to C++ after 10 years, and (having got a "Hello World" prog to work) finds the following code fails to compile.
The cups data type cups_dest_t is okay but function cupsGetDests is undefined reference. I expect that I'm missing an include, but can't find any others to try.
Eclipse SDK Version: 3.5.2 with Eclipse C/C++ development tools 6.0.2 under Ubuntu10.04 under VirtualBox under Vista Business SP2 32bit:

#include <iostream>
#include <cups/cups.h>
#include <cups/array.h>
#include <cups/backend.h>
#include <cups/cgi.h>
#include <cups/dir.h>
#include <cups/file.h>
#include <cups/ppd.h>
#include <cups/raster.h>
#include <cups/sidechannel.h>
using namespace std;

int main()
{
	cout << "!!!Hello CUPS World!!!" << endl; // prints !!!Hello World!!!

	cups_dest_t *dests;
	int num_dests = cupsGetDests(&dests);
/*	cups_dest_t *dest = cupsGetDest("name", NULL, num_dests, dests);

	// do something with dest

	cupsFreeDests(num_dests, dests);
*/
	return 0;
}





More information about the cups mailing list