1

I'm trying to code a program that can edit mp3 tag. And now,I have a problem. That is,when I compile,there is always errors. and the error is Linker error. Here is error descriptions:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ID3_Tag::ID3_Tag(char const *)" (__imp_??0ID3_Tag@@QAE@PBD@Z) referenced in function _wmain 

error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ID3_Tag::~ID3_Tag(void)" (__imp_??1ID3_Tag@@UAE@XZ) referenced in function _wmain   

Does anyone know how or what to do??

Charles Menguy
  • 40,830
  • 17
  • 95
  • 117
sheu46
  • 27
  • 1
  • 6

1 Answers1

1

You probably didn't link against the appropriate libraries, where the symbols the linker is complaining about are exported.

Here's how to link against the libs which are probably found in this archive (version number subject to change).

Community
  • 1
  • 1
Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625
  • But I don't know how can I find the appropriate library. – sheu46 Jan 04 '13 at 20:21
  • @嘉豪許 please change your name so people can tag you - the libs should have been downloaded with the library - check the link I posted. – Luchian Grigore Jan 04 '13 at 20:22
  • From the download it looks like id3lib.lib. However since this is a download from 2003 it may not work with a current compiler. You may have to build the library yourself. I recommend that because mixing libraries and dlls from different versions of Visual Studio can cause application crashes since there are differences in the Microsoft runtimes across versions. – drescherjm Jan 04 '13 at 20:23
  • I just download the link @LuchianGrigore post,and found the id3lib.lib.But can you tell me how to build the library by myself?? – sheu46 Jan 04 '13 at 20:27
  • @sheu46 not really, because I've never done it, but it should be in the docs. However, if you already found the `lib` file, you shouldn't need to build it yourself, you just need to link against it (steps in the first link of my answer). – Luchian Grigore Jan 04 '13 at 20:29
  • @LuchianGrigore ,I can't find the id3lib.lib file when I use my vs 2010,but I can find it when I use folder. – sheu46 Jan 04 '13 at 20:36
  • @sheu46 did you follow the exact steps? Did you add the path to the file to `Linker -> General -> Additional Library Directories`? – Luchian Grigore Jan 04 '13 at 20:36
  • Yes,I follow the step as you said~~ – sheu46 Jan 04 '13 at 20:37
  • @LuchianGrigore Uhhh~~Just I can't find the lib file. – sheu46 Jan 04 '13 at 20:39
  • 1
    @sheu46 so that means you didn't add the folder correctly. That's the solution. That's what you have to do. It's clearly explained. There's no going around it. – Luchian Grigore Jan 04 '13 at 20:42
  • @LuchianGrigore add the folder correctly!?where should I put the folder I just downloaded that my visual studio 2010 can find it??? – sheu46 Jan 04 '13 at 20:44
  • @sheu46 it's already explained in the answer. Go to project properties, navigate to the path I posted earlier, add the folder where the lib is there and the lib to `input->additional dependencies`. – Luchian Grigore Jan 04 '13 at 20:49
  • @LuchianGrigore Thank you!!I just a little confused yet.But now I know what to do!Thx! – sheu46 Jan 04 '13 at 20:52