- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All ,
I have written an image processing related code. I used TBB for parallel implementation of computationally intensive for loops. The program runs fine on Linux. I am trying to port it on windows. When I try to build the executable , I get following linker error:
Error 61 error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl InitializeCriticalSectionAndSpinCount(struct _RTL_CRITICAL_SECTION *,unsigned long)" (__imp_?InitializeCriticalSectionAndSpinCount@@YAHPEAU_RTL_CRITICAL_SECTION@@K@Z) referenced in function "int __cdecl inlineInitializeCriticalSectionEx(struct _RTL_CRITICAL_SECTION *,unsigned long,unsigned long)" (?inlineInitializeCriticalSectionEx@@YAHPEAU_RTL_CRITICAL_SECTION@@KK@Z) D:\projects\rocs_winmain\build\vs2010\release\test\feature_detection\vlfeat_interface.lib(affinefeaturedetector.obj)
I have linked the executable with tbb libraries ( tbb.lib , tbbmalloc.lib , tbbmalloc_proxy.lib ). What could I have to possibly link more to remove this linking error?...
The linking problem is coming from TBB only , because when I comment out the tbb implementation , my programs runs just fine.
Regards
Avanindra Singh
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Avanindra Singh
Do you use /nodefaultlib linker key? if yes you need to add Kernel32.lib to libraries.
--Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vladimir,
Thanks for the reply. I am not using /nodefaultlib linker flag , though I tried explicitly to link Kernel32.lib , but the problem still persists.
Regards
Avanindra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what is operation system and target SDK (_WIN32_WINNT macro setting)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using Windows 7 and I set explicitly _WIN32_WINNT to 0x0501 at the start of the cpp file before including tbb headers. I am using msvc 2010 , x64 . Also my program , uses OpenCV and vlFeat external libraries. Could the problem also come from external libraries ?.. I mean OpenCV has option of internally using TBB ( which I have disbled , it's compiled without TBB ).
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page