{"action":"opened","issue":{"url":"https://api.github.com/repos/thrust/thrust/issues/792","repository_url":"https://api.github.com/repos/thrust/thrust","labels_url":"https://api.github.com/repos/thrust/thrust/issues/792/labels{/name}","comments_url":"https://api.github.com/repos/thrust/thrust/issues/792/comments","events_url":"https://api.github.com/repos/thrust/thrust/issues/792/events","html_url":"https://github.com/thrust/thrust/issues/792","id":153397932,"number":792,"title":"Linker error when using device_vector::resize()","user":{"login":"eligao","id":2323992,"avatar_url":"https://avatars.githubusercontent.com/u/2323992?v=3","gravatar_id":"","url":"https://api.github.com/users/eligao","html_url":"https://github.com/eligao","followers_url":"https://api.github.com/users/eligao/followers","following_url":"https://api.github.com/users/eligao/following{/other_user}","gists_url":"https://api.github.com/users/eligao/gists{/gist_id}","starred_url":"https://api.github.com/users/eligao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eligao/subscriptions","organizations_url":"https://api.github.com/users/eligao/orgs","repos_url":"https://api.github.com/users/eligao/repos","events_url":"https://api.github.com/users/eligao/events{/privacy}","received_events_url":"https://api.github.com/users/eligao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-06T07:54:26Z","updated_at":"2016-05-06T07:54:26Z","closed_at":null,"body":"I came into an issue when using device_vector on VS2013 and CUDA 7.5.18 on Windows 10.\r\n\r\n### The most simple way of reproducing this issue:\r\n\r\n1. On VS2013, create a new` CUDA 7.5 runtime` project\r\n2. replace everything in `kernel.cu` with:\r\n```\r\n#include <thrust/device_vector.h>\r\nint main(void)\r\n{\r\n\tthrust::device_vector<int> vec;\r\n\tvec.resize(1);\r\n\treturn 0;\r\n}\r\n```\r\n3. In the project properties, under `CUDA C/C++`, set Code Generation as `compute_35,sm_35` and Generate Relocatable Device Code as `-rdc=true`\r\n4. Compile the project, and we can get a linker error:\r\n```\r\n1>CudaDemo2.device-link.obj : error LNK2001: unresolved external symbol __fatbinwrap_66_tmpxft_00000888_00000000_17_cuda_device_runtime_compute_52_cpp1_ii_8b1a5d37\r\n1>D:\\foo\\CudaDemo2\\x64\\Debug\\CudaDemo2.exe : fatal error LNK1120: 1  unresolved externals\r\n```\r\n\r\n### When all conditions below are met, the linker error occurs.\r\n1. use Generate Relocatable Device Code (it works well without `-rdc=true`)\r\n2. choose computing capability >=3.5 (I tried 3.5, 5.0 and 5.2 with no luck, but `compute_30,sm_30` works well)\r\n3. invoke `thrust::device_vector::resize()` (not sure whether there are other functions with the same issue, but the similar function `thrust::device_vector::reserve()` works fine)\r\n\r\nI tried with the lastest commit  3e6b4ff but with no luck.\r\n"}}