Símbolo externo no resuelto al vincular mi biblioteca

I've compiled my own library file(.lib) with VS2010, but when I try to reference it like

#pragma comment(lib,"path/to/lib.lib")

I keep getting unresolved external symbols...What am I doing wrong? the #pragma comment(lib, "*.lib") worked for any library so far, and I also tried linking it under settings, no succes.

preguntado el 31 de julio de 12 a las 10:07

Utilice las dumpbin on your .lib file. You can run it from a visual studio command prompt. Check that the symbols you are expecting are actually visible in the library, then report back! -

to:cli_hlt yes I have, I even tried using \\ and \, even typing the path wrong(which gave me file not found) @Rook how do I use this? (actualy the first .lib I created) -

@user1126068: either fire up a visual studio command prompt and run dumpbin from there, or search for it (on my machine it is in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\dumpbin.exe). Now you can run something like dumpbin /ALL mylib.lib > symbols.txt and open up the result in a text editor and search though. -

Well to run dumpbin I had to copy mspdb100.dll, then I tried running the compiler again and now I got: Program database manager mismatch; please check your installation -

2 Respuestas

1) Open a VS command console (Tools/Visual Studio Command Prompt).

2) Uso cd command to change to the directory containing the library in question.

3) Introduzca:

dumpbin /all my_lib_name.lib > lib.txt

Sustitución my_lib_name.lib with the name of your library. (You'll want to write the output to a text file lib.txt for large libraries)

4) Open this newly created lib.txt to view the contents of the library. More details can be found aquí.

contestado el 23 de mayo de 17 a las 11:05

  1. Open Two directories.
    • First contained library that fails
    • Second contains binary directory with compilator (For me its C:\Program Files\Microsoft Visual Studio 9.0\VC)
  2. Copy mspdb*.dll(from first directory) to directory with library
  3. Open cmd.exe in library directory
  4. Write "%FIRST_DIRECTORY/bin/dumpbin.exe" /ALL library.lib > lib.txt (For example i am writed "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\dumpbin.exe" /ALL MyTestLibrary.lib > lib.txt)
  5. Search for methods that you want(by class name or method name)

If you dont found - developer dont writed it. OR that methods implementations are inline

If second - you should told IDE whereis source. BTW remember, no methods in library-compiling project, that accessable through user headers could be inline. All you can do to optimise speed - fastcall.

Respondido 20 Feb 13, 23:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.