Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an old open source program that we use to print PDFs from our software. We have found there is a problem when using the new PDF Reader 10.x. I have made a change to the program source but I am not able to compile it, I get the errors listed below. I do not know where these errors are coming from.
I am using "cl pdfp.c" to compile the program. Do I need to use some options? Any help will be appreciated because my knowledge of C is limited! Thanks!

VB
pdfp.c
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:pdfp.exe
pdfp.obj
pdfp.obj : error LNK2001: unresolved external symbol __imp__MoveWindow@24
pdfp.obj : error LNK2001: unresolved external symbol __imp__ShowWindow@8
pdfp.obj : error LNK2001: unresolved external symbol __imp__FindWindowA@8
pdfp.obj : error LNK2001: unresolved external symbol _DdeUninitialize@4
pdfp.obj : error LNK2001: unresolved external symbol _DdeDisconnect@4
pdfp.obj : error LNK2001: unresolved external symbol _DdeClientTransaction@32
pdfp.obj : error LNK2001: unresolved external symbol _DdeCreateDataHandle@28
pdfp.obj : error LNK2001: unresolved external symbol _DdeFreeStringHandle@8
pdfp.obj : error LNK2001: unresolved external symbol _DdeConnect@16
pdfp.obj : error LNK2001: unresolved external symbol _DdeCreateStringHandleA@12
pdfp.obj : error LNK2001: unresolved external symbol _DdeInitializeA@16
pdfp.obj : error LNK2001: unresolved external symbol __imp__PostMessageA@16
pdfp.obj : error LNK2001: unresolved external symbol __imp__ShellExecuteA@24
pdfp.obj : error LNK2001: unresolved external symbol __imp__FindExecutableA@12
pdfp.obj : error LNK2001: unresolved external symbol _SetPrinterProperties
pdfp.obj : error LNK2001: unresolved external symbol _ClosePrinter@4
pdfp.obj : error LNK2001: unresolved external symbol _GetPrinterA@20
pdfp.obj : error LNK2001: unresolved external symbol _OpenPrinterA@12
pdfp.obj : error LNK2001: unresolved external symbol _GetPrinterDevMode
pdfp.obj : error LNK2001: unresolved external symbol _GetDefaultPrinterName
pdfp.exe : fatal error LNK1120: 20 unresolved externals
Posted

You need to add the references to the libraries to be searched by the Linker to create the executable file. It would probably be easier if you used VS2008 to do the hard work for you by creating a proper project setup.
 
Share this answer
 
Comments
tazenman 11-Nov-11 14:08pm    
Richard, Thank you very much for your quick reply! Please forgive my ignorance again but in order to put this program in a project I would do the following;
1. Create a new project, C++.
2. Copy and paste the code from the program into the new project.
Please correct me if I am wrong or missed something.
Thanks
Richard MacCutchan 11-Nov-11 15:15pm    
Yes, create a new empty project. You don't need copy and paste, just move the source code files into the project directory and add them to the relevant folders in the project.
Richard, Thanks again for your help!!!!

I was able to get this source into VS2008 and it compiled clean with some warnings to use a safer command. I am going to test this to make sure this resolved my issue and then I will go back and replace some of the depreciated commands with proper commands.

Thanks again for your help!!
 
Share this answer
 
Comments
Richard MacCutchan 12-Nov-11 5:20am    
Happy to help, and glad it solved at least part of your problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900