新手求教,包含iostream编译出错

o linfeng 2015-07-07 08:24:25
第一次装CUDA(6.0),VS 2012上带的那个模版能正常运行,但是一包含iostream就编译出错。
从网上找的代码也是这样,有include <iostream>就编译出错。


1>
1>D:\应用软件\VS 2012\VC\include\xstring(251): warning : controlling expression is constant
1>
1>D:\应用软件\VS 2012\VC\include\ostream(65): error : too few arguments in function call
1>
1>D:\应用软件\VS 2012\VC\include\istream(48): error : too few arguments in function call
1>
1>D:\应用软件\VS 2012\VC\include\istream(949): error : too few arguments in function call
1>
1>D:/CAFFE PROJECT/ZYQ1/ZYQ1/kernel.cu(10): warning : variable "response" was declared but never referenced
1>
1>D:\应用软件\VS 2012\VC\include\xatomic0.h(76): warning : extern inline function "std::_Atomic_load_4" was referenced but not defined
1>
1>D:\应用软件\VS 2012\VC\include\xatomic0.h(77): warning : extern inline function "std::_Atomic_compare_exchange_weak_4" was referenced but not defined
1>
1>D:\应用软件\VS 2012\VC\include\xatomic0.h(79): warning : extern inline function "std::_Atomic_fetch_add_4" was referenced but not defined
1>
1>D:\应用软件\VS 2012\VC\include\xatomic0.h(81): warning : extern inline function "std::_Atomic_fetch_sub_4" was referenced but not defined
1>
1> 3 errors detected in the compilation of "C:/Users/ZHANGY~1/AppData/Local/Temp/tmpxft_00001820_00000000-3_kernel.cpp4.ii".
1> kernel.cu
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets(597,9): error MSB3721: 命令“"D:\cuda\toolkit\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2012 -ccbin "D:\应用软件\VS 2012\VC\bin" -ID:\cuda\toolkit\include -ID:\cuda\toolkit\include -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o Debug\kernel.cu.obj "D:\CAFFE PROJECT\ZYQ1\ZYQ1\kernel.cu"”已退出,返回代码为 2。

求教各位大神,应该怎么解决?
...全文
340 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Spidey212 2015-07-08
  • 打赏
  • 举报
回复
#include<stdio.h>
o linfeng 2015-07-08
  • 打赏
  • 举报
回复
必须要用iOSTREAM呢,用的C++

579

社区成员

发帖
与我相关
我的任务
社区描述
CUDA™是一种由NVIDIA推出的通用并行计算架构,该架构使GPU能够解决复杂的计算问题。 它包含了CUDA指令集架构(ISA)以及GPU内部的并行计算引擎。
社区管理员
  • CUDA编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧