我试图在Qt 5.2和MSVC2012环境中编译cuda文件.在我开始我的项目之前,我仔细阅读了问题并回复:在Windows上的Qt Creator中编译Cuda代码.但即使我只是复制代码并在qt中生成了2个文件,仍然会出现一些错误
/main.cpp
/vectorAddition.cu
Run Code Online (Sandbox Code Playgroud)
错误是:
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in vectorAddition_cuda.o
Run Code Online (Sandbox Code Playgroud)
我完全不知道如何修复这个bug.我在网上阅读了一些关于修复MSVC2012不匹配的文章.但是很少有人提到如何在Qt .pro文件中做到这一点.有没有人碰巧遇到这个问题?
我也在这里附上了pro文件(根据我自己的目录进行了修改)
#-------------------------------------------------
#
# Project created by QtCreator 2014-10-05T13:22:19
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled
TEMPLATE = app
SOURCES += main.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
# Define output directories
DESTDIR = debug
OBJECTS_DIR = debug/obj
CUDA_OBJECTS_DIR = debug/obj
# Source files
# This makes the .cu …
Run Code Online (Sandbox Code Playgroud)