Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6711 Discussions

Unresolved external symbol ___intel_VEC_memzero referenced in function _png_set_dither

Thomas_Jensen1
Beginner
443 Views

I have a custom IPP project with a custom 32-bit DLL setup.

I have a problem in IPP 8.1/8.2 in which memzero (and memset) cannot be found by the linker, and it is only in PNG module pngrtran.c it isn't resolved, assuming memset is used several other places.

If I compile using Visual Studio 2010 I haven't got this problem, but compiling with Intel Compiler 10.1.0.13 I do.
In IPP 6 and 7 I haven't got this problem.
I do use the same lib and include folders in both environments.

I tried using /verbose and I see lots of other code referring to memset and those are resolved, and also the memset referred to in pngrtran.c is actually  resolved and loaded from libircmt.lib. However, the linker still reports this:

   Creating library xxxx.exp
pngrtran.obj : error LNK2019: unresolved external symbol ___intel_VEC_memzero referenced in function _png_set_dither
pngrtran.obj : error LNK2019: unresolved external symbol ___intel_VEC_memset referenced in function _png_set_dither
xxxx.dll : fatal error LNK1120: 2 unresolved externals

The libircmt.lib file is taken from Intel Compiler 10.1.0.13, and it also contains the ___intel_VEC_memset functions.

Any ideas?

0 Kudos
2 Replies
Sergey_K_Intel
Employee
443 Views

Hi Thomas,

Probably, it's because Intel compiler substitutes std memset with compiler lib's fast memset. Today's compiler uses intel_fast_memset, but 10.x compiler might have been using VEC_memset. This is why Microsoft compilation is ok, but Intel's is not.

It may be -O3 optimization level-specific. I mean memset/memcpy recognition by Intel compiler.

This issue looks to have nothing to do with IPP libraries. As far as I know IPP 8.2 libraries should not have compiler lib dependency at all.

Try to decrease optimization level for pngrtran.c module. There could be other methods, you can ask in Intel compiler forum.

Though, it's strange why the references were not resolved with libirc library from 10.x compiler. The unresolved functions should be in that library.

0 Kudos
Thomas_Jensen1
Beginner
443 Views

I understand what you write.

I tested with -O1 and the problem went away, but I do want move optimization, so I looked at the code and the offending memset/memzero was only in one public function png_set_dither(), which I didn't use anyway, so I put in a define that disabled it, and then I could use -O2 and not get the error. Strange indeed. Why would memset in png_set_dither cause the problem, but memset used in other modules not? All modules compile using default optimization settings.

Further, my libircmt.lib in folder C:\Program Files (x86)\Intel\Compiler\C++\10.1.013\IA32\lib does contain many memset variants:

- intel_VEC_memset
- intel_fast_memset
- intel_new_memset

I made a final solution by adding

#pragma intel optimization_level 0

just before png_set_dither().

Thomas

0 Kudos
Reply