CppPilot

C++ / Búsqueda de documentación

Encuentre el error. Encuentre el siguiente paso.

Busque por código de diagnóstico, mensaje copiado o síntoma. Filtre por contenido y sistema de proyecto.

  1. Ejemplos y diagramasMSBuild + CMake

    LNK2038: Un archivo usa una configuración propia que prevalece sobre la del proyecto.

    A .cpp file can have its own Runtime Library setting. Remove the override in its properties so it inherits the project's.

  2. Ejemplos y diagramasMSBuild + CMake

    LNK2038: Los proyectos usan bibliotecas en tiempo de ejecución distintas.

    Set the same C/C++ > Code Generation > Runtime Library in every project of the program: /MD everywhere, or /MT everywhere, with /MDd or /MTd in Debug.

  3. Ejemplos y diagramasMSBuild + CMake

    LNK4098: /NODEFAULTLIB oculta el conflicto.

    Ignorar la biblioteca predeterminada silencia la advertencia sin hacer compatibles las bibliotecas en tiempo de ejecución: úselo solo para una biblioteca que sepa que no es necesaria.

  4. Ejemplos y diagramasMSBuild + CMake

    LNK4098: Una biblioteca de Release se enlaza en Debug.

    Enlace la compilación Debug de la biblioteca en la configuración Debug.

  5. Ejemplos y diagramasMSBuild + CMake

    LNK4098: Una biblioteca usa otra biblioteca en tiempo de ejecución.

    Build all projects and libraries with the same C/C++ > Code Generation > Runtime Library : /MD with /MDd in Debug, or /MT with /MTd . Use the library build that matches.

  6. Ejemplos y diagramasMSBuild

    Usar bibliotecas vcpkg en Visual Studio: agregar una biblioteca

    En Developer PowerShell, en la carpeta del proyecto, ejecute vcpkg new --application . Crea vcpkg.json y vcpkg-configuration.json . Agregue las bibliotecas: vcpkg add port fmt . En las propiedades del proyecto, establezca vcpkg > Use Vcpkg…

  7. Ejemplos y diagramasMSBuild

    Usar bibliotecas vcpkg en Visual Studio: elegir el triplete

    El triplete determina cómo se compilan las bibliotecas. Debe coincidir con la biblioteca en tiempo de ejecución de su proyecto o el enlazado falla con LNK2038 o LNK4098 : x64-windows : DLL, con el tiempo de ejecución dinámico ( /MD ), el…