cpdflib library

Hi Guys!

Wondering why I am getting these linking errors when I compile my code?

HEADER File
1
2
3
4
5
6
7
#ifdef DLLEXPORTIMPORT
	#define EXPORT_IMPORT _declspec(dllexport)
#else
	#define EXPORT_IMPORT _declspec(dllimport)
#endif

void ShowPDFTX8504( int NumOfYears );



CPP File
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define DLLEXPORTIMPORT
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "debug\cpdflib.h"
#include "win32pdf.h"

// ***********************************************************
void ShowPDFTX8504(int NumOfYears)
{
	CPDFdoc *pdf;
	pdf = cpdf_open(0, NULL);
	cpdf_init(pdf);
	cpdf_close(pdf);
}

1>------ Build started: Project: win32pdf, Configuration: Debug Win32 ------
1> win32pdf.cpp
1>win32pdf.obj : error LNK2019: unresolved external symbol "void __cdecl cpdf_close(struct _cpdf_doc *)" (?cpdf_close@@YAXPAU_cpdf_doc@@@Z) referenced in function "void __cdecl ShowPDFTX8504(int)" (?ShowPDFTX8504@@YAXH@Z)
1>win32pdf.obj : error LNK2019: unresolved external symbol "void __cdecl cpdf_init(struct _cpdf_doc *)" (?cpdf_init@@YAXPAU_cpdf_doc@@@Z) referenced in function "void __cdecl ShowPDFTX8504(int)" (?ShowPDFTX8504@@YAXH@Z)
1>win32pdf.obj : error LNK2019: unresolved external symbol "struct _cpdf_doc * __cdecl cpdf_open(int,struct CPDFdocLimits *)" (?cpdf_open@@YAPAU_cpdf_doc@@HPAUCPDFdocLimits@@@Z) referenced in function "void __cdecl ShowPDFTX8504(int)" (?ShowPDFTX8504@@YAXH@Z)
1>D:\UCK9N\WinTap\cpdflib_ErrorDebug\Debug\win32pdf.dll : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



Under properties --> C/C++ --> General --> Additional Include Directories = ...\WinTap\cpdflib_ErrorDebug
cpdflib.h actually lies at \WinTap\cpdflib_ErrorDebug\Debug\cpdflib.h


I don't understand why I am getting these errors... I have the right settings in properties I am fairly certain.

Any help be great guys!
Sorry dear :( i have no any Idea right now...
The include settings are right, but the linker needs at least the path to the library. Maybe the the name of it too. See the linker section of your properties
Yep, I do have the correct linker settings I believe.

Under properties --> C/C++ --> Linker --> Input --> Additional Dependencies = ...\WinTap\cpdflib_ErrorDebug\Debug\win32pdf.lib

This is super annoying ><

The errors
...void __cdecl cpdf_close(struct _cpdf_doc *)...

I don't get why cpdf_close is unresolved external symbol... since I have all the right properties settings, and that cpdflib.h is inlcuded correctly.

Anything else you guys can see?
Should I mention that this win32pdf is a DLL? Don't know if that is important... based on the error I don't think it is.


cpdflib.h is from http://www.fastio.com/ by the way, and is described as "ClibPDF is a library of ANSI C functions, distributed as source code, for creating PDF files directly via C language programs..."

I am wondering... is there also a .lib file for cpdflib.h also? Could that be the issue?
Last edited on
Sorry, may I bump this...
I've never try if libraries can have a path in that setting (I don't think so). There's the 'Additional Library Directories' where you're supposed to place the directories.

the win32pdf.h is not affected by EXPORT_IMPORT?

By the way: ShowPDFTX8504 is not exported since you don't use the macro EXPORT_IMPORT in front of it
Hi Guys,

the win32pdf.h is not affected by EXPORT_IMPORT?

Yes, that is intentional. I was just simplifying my error/problem when I posted above code.

But I have made progress on this issue... it turned out there were more files, in fact there was a whole solution that I was unaware of that I managed to get my hands on.

Cheers everyone :)
Topic archived. No new replies allowed.