Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unresolved externals error

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I have downloaded tiffio.h and tiff.h library files to use them in my program. When I call methods TIFFOpen()& TIFFClose() from tiffio.h, I get an error in Linking:
Linking...
P.obj : error LNK2001: unresolved external symbol _TIFFClose
P.obj : error LNK2001: unresolved external symbol _TIFFOpen
Debug/P.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

I downloaded all .h files at the site where I got the tiffio.h from ( ) but I still get the error. Am I required to download all the .c files too?

Or is there something else wrong that I am doing?

TIA,
Sheila
 
Just a wild guess :

Did you actually include the lib in the project ?

/JOlesen
 
I have only included tiffio.h as:
#include <tiffio.h>

because that has the methods I need. Isn't that enough?
Sheila
 
No, you must include the library in the project (Or include in link-process somehow else)

/JOlesen
 
How do I include the library? or in link-process ?

Sheila
 
project->settings->link->input put the .lib file in the list of librarys and add its path to the additional path part.

WR
 
I didn't find any .lib file at the site. So I have placed the .h files under the 'MS VisualStudio/VS98/Include/' folder.

Do I need to create a lib file?

Sheila
 
Oh - you wrote

>> I have downloaded tiffio.h and tiff.h library files to

thus I expected a .lib file ...

Do you have a .c or .cpp file ?

/JOlesen
 
I just had a look at the site you mentioned ...

I would download all the c and h files, and include all in a project (Thus I don't think you will not need a library).

/JOlesen
 
Thank you so much for helping me on this.

I did a search on Libtiff and found that the entire library is available (
But after I download tiff-3.5.7-lib, I find that it has three folders: Include, lib, and Manifest. Those in Include folder are the same files at the earlier site I had mentioned.

I placed the files in Include in the Include folder (under VS98/Include/), and files in the 'lib' folder in the 'lib' folder (again under VS98/Include/). What do I do with Manifest folder contents?

Sheila
 
Try to ignore the manifest stuff and see what happens(Is it Documentation ?)

It's bad practice to locate downloaded files in the same folders as used by the compiler (If that's what you are doing).
Use something like c:\Source\TiffProj\ ...
Otherwise you will end up in a mess after a few hundred projects ;-)

/JOlesen

 
hmmm. Yes, I understand that changing the files in compiler's folders can cause that. I'll follow your method from now on.

But even after placing those files there I get the same error of &quot;unresolved external symbol&quot;.

Any suggestions?

Thanks a lot,
Sheila
 
I need a status :

1) Do you have a project ?
2) Did you include the library in the project ?
3) Is this gnu-library accepted by Microsoft linker ?
4) What's the unresolved symbol(s) ?

/JOlesen
 
1) Do you have a project ? YES
2) Did you include the library in the project ?
Yes, as indicated by WR above!

3) Is this gnu-library accepted by Microsoft linker ?

The site from where I downloaded it said it was for Windows. But the linker is issuing the errors!

4) What's the unresolved symbol(s) ?
Linking...
P.obj : error LNK2001: unresolved external symbol _TIFFClose
P.obj : error LNK2001: unresolved external symbol _TIFFOpen
Debug/P.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
 
Hmmm ... don't really know.

I would remove the library from the project, and include all the source-files instead.
Verify the source-files actually do implement the 2 functions in question.

/JOlesen

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top