Search code examples
c++visual-studiovisual-studio-2022

LNK1104 cannot open file 'P7x64.dll.lib'


I've been given a project that uses external libraries, but it didn't come with them. I fixed a few issues, but now I've encountered an error. The program uses the Baical P7 library, but I can't figure out where to get P7x64.dll.lib. I searched on the Baical website and downloaded all downloadable but couldn't find p7x64.dll or p7x64.dll.lib file. Please if anyone knows where it's coming from.


Solution

  • Ok my best guess is that your P7x64.dll.lib is named manually. @john is right, you need to use CMake, to build p7 library. here is how:

    1. Download cmake https://cmake.org/download/

    2. Install and don't forget checkbox CHECKED where it says: add CMake to PATH.

    3. Now download https://baical.net/downloads.html file P7 library vX.X

    4. When you unarchive downloaded file it will give you a dir libP7Client_vX.X.

    5. Go inside and open folder Sources, right click inside the folder, but on empty space and say Open in Terminal or open terminal/CMD independently and navigate to same folder using cd command.

    6. When you are inside terminal and standing on correct source directory type: cmake --help.

    7. It will generate command list, where, you are looking for Visual Studio 17 2022 = Generates Visual Studio 2022 project files. Use -A option to specify architecture. (You may have different versions)

    8. When you find it, use command set below to generate "solution". It is copied from documentation:

      mkdir "build"

      cd "build"

      cmake -G "Visual Studio 17 2022" ".." It may be slightly different for you but it will be basically the same. Modify and use it.

    9. When you do this it should give you new solution in _build_ folder.

    10. Now open freshly generated p7.sln which is sitting inside _build_ folder into Visual Studio and build like regular solution. It should give you you library, which probably will be named p7.lib.

    11. You can now rename p7.lib to P7x64.dll.lib and put somewhere you think is better.

    12. Go to options where you link various 3rd party library dirs (I assume you know how to do that, based you have already done some of libraries).

    I'm not best documentation writer and I know it's a lot but whatever, hope it helps.