Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
363 Discussions

DPL functions cannot be correctly linked, is there any other lib required?

shenuo
Employee
594 Views

Here is my code:

#include <CL/sycl.hpp>
#include <vector>
#include <iostream>
#include <oneapi/dpl/algorithm>
#include <algorithm>

using namespace sycl;

int main(int argc, char* argv[]) {

std::vector<int> a;
a.resize(100);

oneapi::dpl::fill(oneapi::dpl::execution::par_unseq,a.begin(),a.end(),3);

return 0;
}

error LNK2019: unresolved external symbol "void __cdecl oneapi::dpl::fill<class oneapi::dpl::execution::v1::parallel_unsequenced_policy const &,class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<int> > >,int>(class oneapi::dpl::execution::v1::parallel_unsequenced_policy const &,class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<int> > >,class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<int> > >,int const &)" (??$fill@AEBVparallel_unsequenced_policy@v1@execution@dpl@oneapi@@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@H@std@@@std@@@std@@H@dpl@oneapi@@YAXAEBVparallel_unsequenced_policy@v1@execution@01@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@H@std@@@std@@@std@@1AEBH@Z) referenced in function main

my programing environment :

VS2017

oneAPI DPC++ Compiler  (2021.3.0)

windows 10

Labels (1)
0 Kudos
1 Solution
shenuo
Employee
587 Views

problem solved. must contain the <dpl/excution>header, Besides, the tbb.lib also requires to be linked. I didn't found this point mentioned in the tutorial.  o_o

View solution in original post

4 Replies
shenuo
Employee
588 Views

problem solved. must contain the <dpl/excution>header, Besides, the tbb.lib also requires to be linked. I didn't found this point mentioned in the tutorial.  o_o

ArpitaP_Intel
Moderator
567 Views

Hello,

 

Thanks for reaching out to us.

 

Glad to know your issue is resolved. It would be a great help if you let us know the tutorial document you are referring.

 

Thanks!

 

shenuo
Employee
556 Views
ArpitaP_Intel
Moderator
525 Views

Hello,


You can get the detailed steps in the below URL

https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-library-guide/top/pa...


As your issue is resolved, we are going ahead and closing this thread. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks!



Reply