Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
805 Discussions

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

shenuo
Employee
2,561 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
2,554 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

0 Kudos
4 Replies
shenuo
Employee
2,555 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

0 Kudos
ArpitaP_Intel
Moderator
2,534 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!

 

0 Kudos
shenuo
Employee
2,523 Views
0 Kudos
ArpitaP_Intel
Moderator
2,492 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/parallel-stl-overview/parallel-stl-usage.html


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!



0 Kudos
Reply