IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Systèmes de compilation Discussion :

Compilation et liaison de bibliothèque statique avec CUDA/C++


Sujet :

Systèmes de compilation

  1. #1
    Membre averti
    Avatar de smarlytomtom
    Homme Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Novembre 2014
    Messages
    139
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Territoire de Belfort (Franche Comté)

    Informations professionnelles :
    Activité : Développeur de jeux vidéo
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2014
    Messages : 139
    Points : 373
    Points
    373
    Billets dans le blog
    1
    Par défaut Compilation et liaison de bibliothèque statique avec CUDA/C++
    Bonjour à tous,

    Je dois créer un projet CMake composé des projets suivants :
    • Projet principale qui utilisera les deux bibliothèques statiques qui suivent
    • Une première bibliothèque avec des kernel CUDA compilé en statique
    • Une seconde bibliothèque C++ pour effectuer des rendu. Elle utilise GLEW, GLFW et GLM avec une liaison statique


    J'ai donc créé mes trois projet avec l'architecture suivante :
    • dossier src : contient les sources du projet principale ainsi que le CMakeLists qui inclu les sous-répertoires des bibliothèques
    • le dossier src/Process : contient les sources de la bibliothèque CUDA avec le CMakeLists
    • le dossier src/Renderer : contient les souces de la bibliothèque de rendu avec le CMakeLists


    Le CMakeLists du dossier src est le suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
     
    cmake_minimum_required(VERSION "3.12.0")
     
    # Set 64bit plateform
    set(CMAKE_GENERATOR_PLATFORM "x64")
    set(CMAKE_BUILD_TYPE RELEASE)
     
    # Add VCPKG toolchain
    # Tell VCPKG to use static linking
    set(VCPKG_TARGET_TRIPLET "x64-windows-static")
    set(CMAKE_TOOLCHAIN_FILE "D:/Dev/vcpkg/scripts/buildsystems/vcpkg.cmake")
    message(STATUS "Set VCPK toolchain file to use libs: ${CMAKE_TOOLCHAIN_FILE}")
    include(${CMAKE_TOOLCHAIN_FILE})
    set(VCPKG_VS_CRT_LINKAGE STATIC)
     
    # Set CUDA Flags for all configurations
    set(CMAKE_CUDA_FLAGS "")
    set(CMAKE_CUDA_FLAGS_DEBUG "")
    set(CMAKE_CUDA_FLAGS_RELEASE "")
    set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "")
    set(CMAKE_CUDA_FLAGS_MINSIZEREL "")
     
    set(CMAKE_CXX_FLAGS_RELEASE "/NODEFAULTLIB:library")
    set(CMAKE_CXX_FLAGS_DEBUG "/NODEFAULTLIB:library")
     
    # Set C++ compiler (VS2017 x64)
    set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64")
     
    # Set CUDA compiler path
    set(
        CMAKE_CUDA_COMPILER 
        "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe"
    )
    # Set cl.exe path for CUDA
    set(
        CMAKE_CUDA_HOST_COMPILER
        "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64"
    )
     
    # Show CMake version
    message(STATUS "Cuda/C++ program compilation begin... [CMAKE ${CMAKE_VERSION}]")
     
    # Setup the project with used languages
    project("CUDA_TESTS" CUDA CXX)
    find_package(CUDA)
     
    # Include subdirectories
    add_subdirectory(Renderer)
    add_subdirectory(Processor)
     
    # Set source files
    set(SRCS
        main.cu
    )
    # Set header files
    set(HEADERS
     
    )
     
    # Setup executable
    add_executable("${PROJECT_NAME}" ${SRCS} ${HEADERS})
    target_link_libraries("${PROJECT_NAME}" libprocessor librenderer)
    Celui de src/Process :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
     
    cmake_minimum_required(VERSION "3.12.0")
     
    # Set 64bit plateform
    set(CMAKE_GENERATOR_PLATFORM "x64")
    set(CMAKE_BUILD_TYPE RELEASE)
     
    # Set CUDA Flags for all configurations
    set(CMAKE_CUDA_FLAGS "")
    set(CMAKE_CUDA_FLAGS_DEBUG "")
    set(CMAKE_CUDA_FLAGS_RELEASE "")
    set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "")
    set(CMAKE_CUDA_FLAGS_MINSIZEREL "")
     
    set(CMAKE_CXX_FLAGS_RELEASE "/MT /NODEFAULTLIB:library")
    set(CMAKE_CXX_FLAGS_DEBUG "/MTd /NODEFAULTLIB:library")
     
    # Set C++ compiler (VS2017 x64)
    set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64")
     
    # Set CUDA compiler path
    set(
        CMAKE_CUDA_COMPILER 
        "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe"
    )
    # Set cl.exe path for CUDA
    set(
        CMAKE_CUDA_HOST_COMPILER
        "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64"
    )
     
    # Show CMake version
    message(STATUS "Generate Processor...")
     
    project(libprocessor CUDA CXX)
     
    # Set source files
    set(SRCS
        Processor.cu
    )
    # Set header files
    set(HEADERS
        Processor.h
    )
     
    add_library(libprocessor STATIC ${SRCS} ${HEADERS})
    Et enfin celui de src/Renderer :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
     
    cmake_minimum_required(VERSION "3.12.0")
     
    # Set 64bit plateform
    set(CMAKE_GENERATOR_PLATFORM "x64")
    set(CMAKE_BUILD_TYPE RELEASE)
     
    # Add VCPKG toolchain
    # Tell VCPKG to use static linking
    set(VCPKG_TARGET_TRIPLET "x64-windows-static")
    set(CMAKE_TOOLCHAIN_FILE "D:/Dev/vcpkg/scripts/buildsystems/vcpkg.cmake")
    message(STATUS "Set VCPK toolchain file to use libs: ${CMAKE_TOOLCHAIN_FILE}")
    include(${CMAKE_TOOLCHAIN_FILE})
    set(VCPKG_VS_CRT_LINKAGE STATIC)
     
    set(CMAKE_CXX_FLAGS_RELEASE "/MT /NODEFAULTLIB:library")
    set(CMAKE_CXX_FLAGS_DEBUG "/MTd /NODEFAULTLIB:library")
     
    # Link static libraries
    message(STATUS "Find packages :")
    find_package(OpenGL REQUIRED)
    find_package(GLEW REQUIRED)
    find_package(glfw3 CONFIG REQUIRED)
    find_package(glm CONFIG REQUIRED)
     
    # Set C++ compiler (VS2017 x64)
    set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64")
     
    # Show CMake version
    message(STATUS "Generate Renderer...")
     
    project(librenderer CUDA CXX)
     
    # Set source files
    set(SRCS
        Renderer.cpp
    )
    # Set header files
    set(HEADERS
        Renderer.h
    )
     
    add_library(librenderer STATIC ${SRCS} ${HEADERS})
     
    target_link_libraries(librenderer PUBLIC GLEW::GLEW)
    target_link_libraries(librenderer PUBLIC glfw)
    target_link_libraries(librenderer PUBLIC glm)
    J'utilise vcpkg pour les bibliothèques C++.

    Ces fichiers génèrent parfaitement la solution Visual Studio, le problème survient lorsque je lance la compilation à l'aide de MSBuild. J'obtiens les erreurs suivantes :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
     
    "D:\Dev\cpp\TestCuda\build\CUDA_TESTS.sln" (cible par défaut) (1) ->
    "D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj.metaproj" (cible par défaut) (2) ->
    "D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj" (cible par défaut) (8) ->
    (Link cible) ->
      librenderer.lib(Renderer.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne c orrespond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      librenderer.lib(Renderer.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebu g' ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: void __cdecl std::basic_ostream<char,struct std::char_traits<char > >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ) dÚjÓ dÚfini(e) dans librenderer.lib(Ren derer.obj) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & _ _cdecl std::basic_ostream<char,struct std::char_traits<char> >::put(char)" (?put@?$basic_ostream@DU?$char_traits@D@std@ @@std@@QEAAAEAV12@D@Z) dÚjÓ dÚfini(e) dans librenderer.lib(Renderer.obj) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      msvcprt.lib(MSVCP140.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & _ _cdecl std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@ std@@@std@@QEAAAEAV12@XZ) dÚjÓ dÚfini(e) dans librenderer.lib(Renderer.obj) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxpr oj]
      libcpmtd.lib(locale0.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corre spond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' n e correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl std::_Facet_Register(class std::_Facet_base *)" (?_Facet_Reg ister@std@@YAXPEAV_Facet_base@1@@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(locale0_implib.obj) [D:\Dev\cpp\TestCuda\build\CUDA _TESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getglo ballocale(void)" (?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVCP140.dll) [D:\ Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Loci nfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVCP140.dll) [D:\ Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Loci nfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVCP140.dll) [D:\Dev\cpp\TestCuda\ build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne correspo nd pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' ne c orrespond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2005: "public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::se tstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVCP 140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2005: "public: char __cdecl std::basic_ios<char,struct std::char_traits<char> >::wi den(char)const " (?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVCP140.dl l) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corres pond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' ne  correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2005: "public: int __cdecl std::basic_streambuf<char,struct std::char_traits<char > >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVC P140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(iosptrs.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corre spond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(iosptrs.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' n e correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(nothrow.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corre spond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(nothrow.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' n e correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlock.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corresp ond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlock.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' ne
    correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QEAA@H@Z) dÚjÓ  dÚfini(e) dans msvcprt.lib(MSVCP140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QEAA@XZ) dÚj Ó dÚfini(e) dans msvcprt.lib(MSVCP140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xthrow.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corres pond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xthrow.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' ne  correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ) dÚjÓ dÚfini (e) dans msvcprt.lib(MSVCP140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xthrow.obj) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXP EBD@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSVCP140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(ios.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne correspon d pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(ios.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' ne co rrespond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corre spond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' n e correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corre spond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug' n e correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2005: "public: int __cdecl std::basic_streambuf<char,struct std::char_traits<cha r> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z) dÚjÓ dÚfini(e) dans msvcprt.lib(MSV CP140.dll) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xdateord.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne corr espond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xdateord.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug'
    ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(winapisupp.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne co rrespond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(winapisupp.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug ' ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlCompareStringA.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2 ' ne correspond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlCompareStringA.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_Stat icDebug' ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(winapinls.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2' ne cor respond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(winapinls.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_StaticDebug'  ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlCompareStringW.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2 ' ne correspond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlCompareStringW.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_Stat icDebug' ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlLCMapStringW.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2'
    ne correspond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlLCMapStringW.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_Static Debug' ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlLCMapStringA.obj) : error LNK2038: discordance dÚtectÚe pour '_ITERATOR_DEBUG_LEVEL'á: la valeur '2'
    ne correspond pas Ó la valeur '0' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlLCMapStringA.obj) : error LNK2038: discordance dÚtectÚe pour 'RuntimeLibrary'á: la valeur 'MTd_Static Debug' ne correspond pas Ó la valeur 'MD_DynamicRelease' in main.obj [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2001: symbole externe non rÚsolu _invalid_parameter [D:\Dev\cpp\TestCuda\build\C UDA_TESTS.vcxproj]
      librenderer.lib(Renderer.obj) : error LNK2001: symbole externe non rÚsolu _invalid_parameter [D:\Dev\cpp\TestCuda\bui ld\CUDA_TESTS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2001: symbole externe non rÚsolu _invalid_parameter [D:\Dev\cpp\TestCuda\build\CUDA _TESTS.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2001: symbole externe non rÚsolu _invalid_parameter [D:\Dev\cpp\TestCuda\build\CU DA_TESTS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2001: symbole externe non rÚsolu _invalid_parameter [D:\Dev\cpp\TestCuda\build\C UDA_TESTS.vcxproj]
      libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CU DA_TESTS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TESTS .vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TESTS .vcxproj]
      libcpmtd.lib(xwcsxfrm.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TEST S.vcxproj]
      libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\ CUDA_TESTS.vcxproj]
      librenderer.lib(Renderer.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_T ESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TESTS .vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vc xproj]
      libcpmtd.lib(locale.obj) : error LNK2001: symbole externe non rÚsolu _free_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TESTS. vcxproj]
      libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\ CUDA_TESTS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TES TS.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TES TS.vcxproj]
      libcpmtd.lib(xwcsxfrm.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TE STS.vcxproj]
      libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\buil d\CUDA_TESTS.vcxproj]
      librenderer.lib(Renderer.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA _TESTS.vcxproj]
      libcpmtd.lib(locale0.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TES TS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TESTS. vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2001: symbole externe non rÚsolu _malloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TEST S.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReport [D:\Dev\cpp\TestCuda\build\CUDA_T ESTS.vcxproj]
      librenderer.lib(Renderer.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReport [D:\Dev\cpp\TestCuda\build\CU DA_TESTS.vcxproj]
      libcpmtd.lib(cout.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReport [D:\Dev\cpp\TestCuda\build\CUDA_TEST S.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReport [D:\Dev\cpp\TestCuda\build\CUDA_TE STS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReport [D:\Dev\cpp\TestCuda\build\CUDA_T ESTS.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2019: symbole externe non rÚsolu _calloc_dbg rÚfÚrencÚ dans la fonction "char * _ _cdecl std::_Maklocstr<char>(char const *,char *,struct _Cvtvec const &)" (??$_Maklocstr@D@std@@YAPEADPEBDPEADAEBU_Cvtv ec@@@Z) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(wlocale.obj) : error LNK2001: symbole externe non rÚsolu _calloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TES TS.vcxproj]
      libcpmtd.lib(xlocale.obj) : error LNK2001: symbole externe non rÚsolu _calloc_dbg [D:\Dev\cpp\TestCuda\build\CUDA_TES TS.vcxproj]
      libcpmtd.lib(locale.obj) : error LNK2019: symbole externe non rÚsolu _realloc_dbg rÚfÚrencÚ dans la fonction "private : static void __cdecl std::locale::_Locimp::_Locimp_Addfac(class std::locale::_Locimp *,class std::locale::facet *,unsi gned __int64)" (?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z) [D:\Dev\cpp\TestCuda\build\CUDA_TESTS .vcxproj]
      libcpmtd.lib(xstrcoll.obj) : error LNK2019: symbole externe non rÚsolu _wcsdup_dbg rÚfÚrencÚ dans la fonction _Getcol l [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(xmbtowc.obj) : error LNK2019: symbole externe non rÚsolu _CrtDbgReportW rÚfÚrencÚ dans la fonction _Mbrt owc [D:\Dev\cpp\TestCuda\build\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReportW [D:\Dev\cpp\TestCuda\b uild\CUDA_TESTS.vcxproj]
      libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: symbole externe non rÚsolu _CrtDbgReportW [D:\Dev\cpp\TestCuda\bui ld\CUDA_TESTS.vcxproj]
      D:\Dev\cpp\TestCuda\build\Debug\CUDA_TESTS.exe : fatal error LNK1120: 8 externes non rÚsolus [D:\Dev\cpp\TestCuda\bui ld\CUDA_TESTS.vcxproj]
    Des erreurs au niveau de la liaison. J'ai cherché un peu partout mais je ne trouve pas de solution... Je ne vois pas non plus vraiment d'ou cela peut provenir.

    Je vous remercie d'avance des solutions que vous pourrez m'apporter !
    Thomas Gredin.
    Développeur Unity 3D/VR

    Mon site personnel : http://thomasgredin.com/fr
    Mon portfolio : http://thomasgredin.com/fr/portfolio

  2. #2
    Membre averti
    Avatar de smarlytomtom
    Homme Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Novembre 2014
    Messages
    139
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Territoire de Belfort (Franche Comté)

    Informations professionnelles :
    Activité : Développeur de jeux vidéo
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2014
    Messages : 139
    Points : 373
    Points
    373
    Billets dans le blog
    1
    Par défaut
    Je m'auto répond en espérant que ça pourra servir à d'autres !

    J'ai changé de technique d'approche en ce qui concerne la compilation !
    Au lieu de compiler tous mon programme final et ma bibliothèque de rendu en utilisant NVCC j'utilise simplement le compilateur cl (Visual C++). Ma bibliothèque avec des Kernel CUDA est compilé avec NVCC, les kernels sont définis dans des fichiers sources .cu et une interface purement c++ est créée pour être accessible dans un programme C++ pur. Je peux alors linker cette bibliothèque en statique sur mon executable et l'utiliser par le biais de l'interface C++ créée.

    Je pense que c'est une des meilleurs façons de faire dans mon cas.
    Thomas Gredin.
    Développeur Unity 3D/VR

    Mon site personnel : http://thomasgredin.com/fr
    Mon portfolio : http://thomasgredin.com/fr/portfolio

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Compilation avec bibliothèque statique
    Par Blangel dans le forum Boost
    Réponses: 3
    Dernier message: 09/10/2015, 10h58
  2. Compiler un programme avec les bibliothèques statiques
    Par Luke spywoker dans le forum OpenCV
    Réponses: 0
    Dernier message: 25/09/2015, 15h00
  3. Réponses: 3
    Dernier message: 25/01/2015, 10h44
  4. Création d'une bibliothèque statique avec automake
    Par Analou dans le forum Bibliothèques, systèmes et outils
    Réponses: 3
    Dernier message: 20/06/2013, 12h34
  5. [Compilation] Compiler et intégrer une bibliothèque tierce avec QtCreator
    Par VivienD dans le forum Outils
    Réponses: 5
    Dernier message: 18/05/2013, 18h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo