// $Id: hello.cpp,v 1.10.2.4 2003/12/17 15:45:37 tm Exp $
// PDFlib client: hello example in C++
//
//

#include <iostream>

#include "pdflib.hpp"

int
main(void)
{
     try {
        int font;
        PDFlib p;                               // the PDFlib object

        // open new PDF file
        if (p.open_file("hello.pdf") == -1) {
            cerr << "Error: " << p.get_errmsg() << endl;
            return 2;
        }

        // This line is required to avoid problems on Japanese systems
        p.set_parameter("hypertextencoding", "host");

        p.set_info("Creator", "hello.cpp");
        p.set_info("Author", "Thomas Merz");
        p.set_info("Title", "Hello, world (C++)!");

        // start a new page
        p.begin_page((float) a4_width, (float) a4_height);

        // Change "host" encoding to "winansi" or whatever you need!
        font = p.load_font("Helvetica-Bold", "host", "");

        p.setfont(font, 24);
        p.set_text_pos(50, 700);
        p.show("Hello, world!");
        p.continue_text("(says C++)");
        p.end_page();                           // close page
        p.close();                              // close PDF document
     }
     catch (PDFlib::Exception &ex) {
        cerr << "PDFlib exception occurred in hello sample: " << endl;
        cerr << "[" << ex.get_errnum() << "] " << ex.get_apiname()
            << ": " << ex.get_errmsg() << endl;
        return 2;
     }

     return 0;
}

g++ -I. -I/sw/include -L/sw/lib  hello.cpp   -o hello -lpdf

/usr/bin/ld: Undefined symbols:
PDFlib::begin_page(float, float)
PDFlib::get_errmsg()
PDFlib::set_text_pos(float, float)
PDFlib::continue_text(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >)
PDFlib::set_parameter(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >)
PDFlib::show(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >)
PDFlib::close()
PDFlib::setfont(int, float)
PDFlib::end_page()
PDFlib::set_info(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >)
PDFlib::Exception::get_errmsg()
PDFlib::Exception::get_errnum()
PDFlib::Exception::get_apiname()
PDFlib::load_font(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >)
PDFlib::open_file(std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >)
PDFlib::PDFlib(void (*)(PDF_s*, int, char const*), void* (*)(PDF_s*, 
unsigned long, char const*), void* (*)(PDF_s*, void*, unsigned long, 
char const*), void (*)(PDF_s*, void*), void*)
PDFlib::~PDFlib()

collect2: ld returned 1 exit status


On Nov 18, 2006, at 11:19 AM, Alexander Hansen wrote:

> On 11/18/06, Dan White <[EMAIL PROTECTED]> wrote:
>> Thanks.
>>
>>
>>
>
> I have it installed.  Some details might help.
>
> -- 
> Alexander K. Hansen
> Fink Documenter (still)
> Got job?  http://akhmac.blogdns.net/~hansen/akh_cv/
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to