Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

XE 2013 Update 3 breaks linkage of __declspec(dllexport)

TZeit
Beginner
642 Views

I use Composer XE 2013 to compile OpenCV 2.4.4 which worked fine until Update 2. Now I recompiled with no changes using Update 3 which results in failure to link opencv_ts244.dll with this output:

opencv_ts244.exp : error LNK2001: unresolved external symbol "?vals.2@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA" (?vals.2@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA)
opencv_ts244.exp : error LNK2001: unresolved external symbol "?vals.3@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA" (?vals.3@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA)
opencv_ts244.exp : error LNK2001: unresolved external symbol "?vals.4@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA" (?vals.4@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA)
opencv_ts244.exp : error LNK2001: unresolved external symbol "?vals.5@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA" (?vals.5@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA)
opencv_ts244.exp : error LNK2001: unresolved external symbol "?vals.6@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA" (?vals.6@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA)
opencv_ts244.exp : error LNK2001: unresolved external symbol "?vals.7@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA" (?vals.7@?1??all@MatDepth@__N_46_D__SDK_OpenCV_2_4_4_modules_ts_src_precomp_cpp_f8738051@perf@@SA?AUContainer@234@XZ@4PAHA)

The origin of this problem seems to be CV_ENUM which is defined as (in file ts_perf.hpp):

[cpp]
#define CV_EXPORTS __declspec(dllexport)

#define CV_ENUM(class_name, ...) \
namespace { class CV_EXPORTS class_name {\
public:\
  class_name(int val = 0) : _val(val) {}\
  operator int() const {return _val;}\
  ...

CV_ENUM(MatDepth, CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F, CV_USRTYPE1)
[/cpp]

This happens for 32 and 64 bit builds in Windows. I am using VS2008 and the MS compiler succeeds to build it.

Here is all the code (contained in OpenCV-2.4.4.exe):
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.4/

0 Kudos
21 Replies
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

              Could you please provide me the Compiler options you have used to build?

Regards,

Sukruth H V

0 Kudos
TZeit
Beginner
592 Views

Hi Sukruth,

I attached the VS project files. I generated them with "standard" CMake options, switched to Intel C++ in VS, and tuned some performance options.

Regards, Toni

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

            I am getting this error when i try to rebuild the VS proj file that you have attached :-

error MSB3191: Unable to create directory "D:\SDK\OpenCV-2.4.4\build\modules\ts\CMakeFiles\". Could not find a part of the path 'D:\SDK\OpenCV-2.4.4\build\modules\ts\CMakeFiles\'

Are there any files where i may need to modify the directory path? If so please do let me know.

Regards,

Sukruth H V 

0 Kudos
TZeit
Beginner
592 Views

Hi Sukruth,

I attached the VS projects file mainly to be sure you have all my compiler options. The file was generated by CMake (which you need to use for the OpenCV source to create all the VS solutions and projects) for my specific folder structure - unfortunately it seems to generate absolute paths only. So you could maybe either replace all path prefixes in my project file by search/replace with a text editor to match your paths, or you could use your original CMake-generated project, switch it to Intel C++, and compare the compiler options with mine.

Regards, Toni

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

            I have checked the *.vcproj file and found that there are several paths like this :- "D:\SDK\OpenCV-2.4.4\modules\features2d\include", Now i wanted to know where can i download these SDK's? because this path is part of the "Additional Include Directories".

It would be also great if you can provide me either "A testcase which can replicate this issue" or "Complete steps as what to do to reproduce the issue."

I would prefer you to generate a small testcase, so that i can directly escalate it to the my development team.

Regards,

Sukruth H V

0 Kudos
TZeit
Beginner
592 Views

Steps to reproduce (time ~5 minutes):
(1) download and extract OpenCV 2.4.4 (see URL in my first posting)
(2) generate OpenCV VS solution for VS2008 using CMake and any build path of your choice and predefined default options
(3) open generated VS solution in your build path with VS
(4) right-click on opencv_ts and choose "Use Intel C++"
(5) switch to Release build mode and build opencv_ts

You might fail to build opencv_ts because Intel C++ compiler crashes with an an error, such as:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcnsip.h(28): internal error: access violation

Or maybe:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\rpcnsip.h(28): internal error: assertion failed: end_mangling_full: wrong number of leftover spaces (shared/cfe/edgcpfe/lower_name.c, line 1000)

In this case just rebuild or close/reopen VS and build again, repeat as often as required until you succeed to proceed to linking step.

You might also get variations of the linker error in my first post, such as:
opencv_ts244.exp : error LNK2001: unresolved external symbol "int * `public: static struct perf::__N_43_E__OpenCV_opencv_modules_ts_src_precomp_cpp_9dfcea61::MatDepth::Container __cdecl perf::__N_43_E__OpenCV_opencv_modules_ts_src_precomp_cpp_9dfcea61::MatDepth::all(void)'::`2'::vals" (?vals@?1??all@MatDepth@__N_43_E__OpenCV_opencv_modules_ts_src_precomp_cpp_9dfcea61@perf@@SA?AUContainer@234@XZ@4PAHA

To get more new variations of these errors, change compiler optimization options arbitrarily and try again, e.g. use the options given in the VS project file I posted.

Regards, Toni

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

             I am really sorry for the delay. I would update you on this issue soon. I am working on this issue. Thanks for the providing the detailed steps to reproduce.

Regards,

Sukruth H V

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

           I was able to reproduce the issue and escalated this to our development team and would get back to you with an update soon.

Regards,

Sukruth H V

0 Kudos
TZeit
Beginner
592 Views

Hi,

short update - I did a rebuild with the new Composer XE 2013 Update 4: Identical results, the issue is still there, not yet fixed.

Regards, Toni

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

          Could you please help us by providing  short testcase which can replicate the issue? because this is very huge project to narrow it down, eventhough i was able to reproduce the issue.

Regards,

Sukruth H V 

0 Kudos
TZeit
Beginner
592 Views

Hello Sukruth,

no, sorry, I can't and I won't try because I would expect it to take lots of time to test and find and I might not even be successful. Moreover, I don't believe it is my task to reduce the effort for your company by working for free. If you really need more test cases and you cannot create them on your own, you should consider hiring somebody else for this task. This is already a very stable and easily reproducable test case which allows you to localize the problem and triggers at once by just executing the compiler and/or linker itself. I don't think there is a big chance to find any better performing test case which is even more easy to isolate than that. Me, as a developer, I would be really happy if I had no other bugs to fix than the gracious type we have here: "Take provided test case, run, break at point of failure, spot and fix problem, done." Why should I (or your developers) care about the amount of input data if less data would change nothing except the space required on the hard drive?

Regards, Toni

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

           I am working with developer on this issue and would get back to you with an update soon. Sorry for the delay.

Regards,

Sukruth H V

0 Kudos
Sukruth_H_Intel
Employee
592 Views

Hi Toni,

           Our development team is able to find the cause of the issue and they are working on it and i would update you soon on this. Thanks for your patience.

Regards,

Sukruth H V

 

0 Kudos
TZeit
Beginner
592 Views

Still broken with Composer XE 2013 Update 5.
But we have a new and marvelous crash flavor: rpcnsip.h(28): internal error: access violation

You are really quick in customer service over there at Intel, no fix since nearly 80 days. It is said somebody traveled around the entire world during this time...

0 Kudos
SergeyKostrov
Valued Contributor II
592 Views
Tony, Please stay in the technical field and being sarcastic is Not the best way to bring attention. Thanks. >>...You are really quick in customer service over there at Intel, no fix since nearly 80 days... By the way, some time ago you've made the following statement: >>...I can't and I won't try because I would expect it to take lots of time to test and find and I might not >>even be successful... Why should somebody spend any time on investigation of a problem when a developer, that is owner of the thread with the problem, doesn't want to provide a small test case? I think that the problem is given the lowest priority because of this. >>...marvelous crash flavor: rpcnsip.h(28)... I'd like to inform you that rpcnsip.h has the following Copyright notice: Copyright (c) Microsoft Corporation. All rights reserved. I don't see any relevance to Intel C++ compiler at the moment, unless more technical details are provided. Next, consider to open a case with Intel Premier Support and you will be able to provide a complete set of sources for Intel software engineers. Also, since the linking is broken you need to review how some import and export declarations are declared. For example, these are declaration for a project that supports five C++ compilers: ... // Export & Import Defines - Platform Dependent #if ( defined ( _WIN32_MSC ) || defined ( _WIN32CE_MSC ) || defined ( _WIN32_MGW ) || defined ( _WIN32_ICC ) ) #define _RTdeclspec_dllexport _declspec( dllexport ) #define _RTdeclspec_dllimport _declspec( dllimport ) #endif #if ( defined ( _WIN32_BCC ) || defined ( _COS16_TCC ) ) #define _RTdeclspec_dllexport #define _RTdeclspec_dllimport #endif #ifdef _RTLIBDLL_EXPORTS #define _RTLIBAPI _RTdeclspec_dllexport #else #define _RTLIBAPI _RTdeclspec_dllimport #endif ...
0 Kudos
SergeyKostrov
Valued Contributor II
592 Views
>>...But we have a new and marvelous crash flavor: rpcnsip.h(28): internal error: access violation More technical details are needed. Here is a quick test case to verify two kinds of typedef struct declaration: typedef struct { unsigned int iVar1; unsigned int iVar2; } DISPATCH_TABLEA; typedef struct tagDISPATCH_TABLEB { unsigned int iVar1; unsigned int iVar2; } DISPATCH_TABLEB; int main( void ) { DISPATCH_TABLEA dtA; DISPATCH_TABLEB dtB; } [ Compilation Output ] C:\WuTemp\Tests>icl.exe /MD Test17.cpp Intel(R) C++ Compiler XE for applications running on IA-32, Version 12.1.7.371 Build 20120928 Copyright (C) 1985-2012 Intel Corporation. All rights reserved. Test17.cpp Microsoft (R) Incremental Linker Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. -out:Test17.exe Test17.obj I'll do a verification with version 13 some time later.
0 Kudos
SergeyKostrov
Valued Contributor II
592 Views
Here are compiler Outputs for version 13: [ 32-bit configuration / Windows 7 Professional ] C:\WuTemp\Tests>icl.exe /MD Test17.cpp Intel(R) C++ Compiler XE for applications running on IA-32, Version 13.1.0.149 Build 20130118 Copyright (C) 1985-2013 Intel Corporation. All rights reserved. Test17.cpp Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. -out:Test17.exe Test17.obj [ 64-bit configuration / Windows 7 Professional ] C:\WuTemp\Tests>icl.exe /MD Test17.cpp Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.0.149 Build 20130118 Copyright (C) 1985-2013 Intel Corporation. All rights reserved. Test17.cpp Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. -out:Test17.exe Test17.obj
0 Kudos
SergeyKostrov
Valued Contributor II
592 Views
Here is one more test case for verification: #include "rpc.h" #include "rpcnsip.h" typedef struct { unsigned int uiVar1; unsigned int uiVar2; } DISPATCH_TABLEA; typedef struct tagDISPATCH_TABLEB { unsigned int uiVar1; unsigned int uiVar2; } DISPATCH_TABLEB; int main( void ) { DISPATCH_TABLEA dtA = { 0x0 }; dtA.uiVar1 = 1U; dtA.uiVar2 = 2U; DISPATCH_TABLEB dtB = { 0x0 }; dtB.uiVar1 = 1U; dtB.uiVar2 = 2U; RPC_IMPORT_CONTEXT_P rpcIC = { 0x0 }; rpcIC.LookupContext = ( HANDLE )-1; rpcIC.ProposedHandle = ( HANDLE )-2; rpcIC.Bindings = NULL; } [ Conclusion ] I have Not detected any compilation issues or problems with rpcnsip.h header file.
0 Kudos
levicki
Valued Contributor I
592 Views

Sergey,
His original complaint is that he cannot build OpenCV with Intel C++. If I am not mistaken, the problem was reproduced by Intel support engineer and is still being worked on.

Building OpenCV library with Intel compiler is a fairly common task and full OpenCV source is available to everyone -- I completely agree with him that he should not be the one to create a minimal reproducible test case for Intel in this situation. I would have said the same if support engineer had the guts to ask me to do his work for him.

Why?

1. As far as I know Intel participates in / contributes to OpenCV development so they should be familiar with it.
2. OpenCV is a standard open-source project, not his own private project so it is not fair to ask him to provide minimized test case.
3. He has (presumably) paid for Intel C++ Compiler and he has the right to ask for support.

The only thing I agree is that he asked for support in the wrong place -- he should have opened the issue at Premier Support. However, that would not change the fact that the issue is open for far too long. I have similar experience when it comes to bug fixing turnaround time on Premier support -- rarely I get something solved and closed in less than 90 days even when I provide a minimal test case.

0 Kudos
SergeyKostrov
Valued Contributor II
511 Views
Igor, Did you take into account that Intel software engineers could be busy with tasks related to oncoming release of version 14 of Intel C++ compiler? You also know that some problems are Not fixed for a significantly longer period of time because of low priorities, or because Not reproducible, etc. In oveall, I'm confident that a constant flow of different issues and problems with Intel C++ compiler changes priorities for some open cases and there are hundreds of them.
0 Kudos
Reply