Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Linker Warning

dwinfield
Beginner
347 Views
I'm staic linking and recived the following warning using VS2008

warning LNK4248: unresolved typeref token (01000015) for 'MomentState64f'; image may not run

Any ideas? The code does seem to run as well as the moment commands.

THANKS
0 Kudos
1 Solution
Pavel_B_Intel1
Employee
347 Views
Hi!

Probably not. I've created the simple example according your text:

#include "ipp.h"

int main()
{
IppiMomentState_64f* pState;
IppStatus m_Status;
Ipp64f pValue;
const Ipp8u* pSrc;
const char* m_StatusString;
IppiSize Small;
IppiPoint pointROI = {1,1};
int ROIoffset;
Small.width = 1;
Small.height = 1;
m_Status = ippiMomentInitAlloc_64f( &pState, ippAlgHintNone );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiMoments64f_8u_C1R(pSrc, 1, Small, pState );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 0, 0, 0, pointROI, &pValue );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 1, 0, 0, pointROI, &pValue );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 0, 1, 0, pointROI, &pValue );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetCentralMoment_64f(pState,2,0,0,&pValue);
m_Status = ippiGetCentralMoment_64f(pState,0,2,0,&pValue);
m_Status = ippiGetCentralMoment_64f(pState,1,1,0,&pValue);
ippiMomentFree_64f(pState);
}

and no problem:

C:Work>cl -Ic:SVNippinclude ipptest.c ippiemerged.lib ippimerged.lib ippseme
rged.lib ippsmerged.lib ippcorel.lib
Microsoft 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

ipptest.c
c:workipptest.c(17) : warning C4700: uninitialized local variable 'pSrc' used
Microsoft Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

/out:ipptest.exe
ipptest.obj
ippiemerged.lib
ippimerged.lib
ippsemerged.lib
ippsmerged.lib
ippcorel.lib

C:Work>


Pavel

View solution in original post

6 Replies
Vladimir_Dudnik
Employee
347 Views
It seems you missed some of IPPlibrary in link options. Please check you link with ippcore library

Regards,
Vladimir
dwinfield
Beginner
347 Views

Hi Vladmir,
I do have ippcore linked in and still get that warning.
THANKS

Vladimir_Dudnik
Employee
347 Views
I never seen that problem with IPP. Might be something is wrong in project settings? And by the way, what version of IPP do you use?

Vladimir
Pavel_B_Intel1
Employee
347 Views
Hi dwindield!

This error mean that you try to use struct MomentState64f directly not by IPP functions. It isn't corret, you have to use IPP functions only!

From Microsoft MSDN:

The following sample generates LNK4248. Define struct A to resolve.

Copy Code
// LNK4248.cpp
// compile with: /clr /W1
// LNK4248 expected
struct A;
void Test(A*){}

int main() {
Test(0);
}
dwinfield
Beginner
347 Views



Quoting - Pavel Berdnikov
Hi dwindield!

This error mean that you try to use struct MomentState64f directly not by IPP functions. It isn't corret, you have to use IPP functions only!

From Microsoft MSDN:

The following sample generates LNK4248. Define struct A to resolve.

Copy Code
// LNK4248.cpp
// compile with: /clr /W1
// LNK4248 expected
struct A;
void Test(A*){}

int main() {
Test(0);
}

This is interesting --> I'm using the later version of IPP. Here's the only part where I use the structure"

IppiMomentState_64f* pState;
IppiSize Small;
IppiPoint pointROI = {0,0};
int ROIoffset;
Small.width = m_sc_Blobs.m_Info.rect.width;
Small.height = m_sc_Blobs.m_Info.rect.height;
ROIoffset = m_sc_width*( m_sc_Blobs.m_Info.rect.y) + ( m_sc_Blobs.m_Info.rect.x);
m_Status = ippiMomentInitAlloc_64f( &pState, ippAlgHintNone );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiMoments64f_8u_C1R(m_sc_AnalyzedImage+ROIoffset, m_sc_width, Small, pState );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 0, 0, 0, pointROI, &m_sc_Blobs.m_mom0 );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 1, 0, 0, pointROI, &m_sc_Blobs.m_momx );
m_StatusString = ippGetStatusString( m_Status );
m_sc_Blobs.m_cgx = m_sc_Blobs.m_momx / m_sc_Blobs.m_mom0;
m_sc_Blobs.m_cgx += (m_sc_Blobs.m_Info.rect.x);
m_Status = ippiGetSpatialMoment_64f( pState, 0, 1, 0, pointROI, &m_sc_Blobs.m_momy );
m_StatusString = ippGetStatusString( m_Status );
m_sc_Blobs.m_cgy = m_sc_Blobs.m_momy / m_sc_Blobs.m_mom0;
m_sc_Blobs.m_cgy += (m_sc_Blobs.m_Info.rect.y);
m_Status = ippiGetCentralMoment_64f(pState,2,0,0,&m_sc_Blobs.m_moix);
m_Status = ippiGetCentralMoment_64f(pState,0,2,0,&m_sc_Blobs.m_moiy);
m_Status = ippiGetCentralMoment_64f(pState,1,1,0,&m_sc_Blobs.m_moixy);
ippiMomentFree_64f(pState);

Pavel_B_Intel1
Employee
348 Views
Hi!

Probably not. I've created the simple example according your text:

#include "ipp.h"

int main()
{
IppiMomentState_64f* pState;
IppStatus m_Status;
Ipp64f pValue;
const Ipp8u* pSrc;
const char* m_StatusString;
IppiSize Small;
IppiPoint pointROI = {1,1};
int ROIoffset;
Small.width = 1;
Small.height = 1;
m_Status = ippiMomentInitAlloc_64f( &pState, ippAlgHintNone );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiMoments64f_8u_C1R(pSrc, 1, Small, pState );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 0, 0, 0, pointROI, &pValue );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 1, 0, 0, pointROI, &pValue );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetSpatialMoment_64f( pState, 0, 1, 0, pointROI, &pValue );
m_StatusString = ippGetStatusString( m_Status );
m_Status = ippiGetCentralMoment_64f(pState,2,0,0,&pValue);
m_Status = ippiGetCentralMoment_64f(pState,0,2,0,&pValue);
m_Status = ippiGetCentralMoment_64f(pState,1,1,0,&pValue);
ippiMomentFree_64f(pState);
}

and no problem:

C:Work>cl -Ic:SVNippinclude ipptest.c ippiemerged.lib ippimerged.lib ippseme
rged.lib ippsmerged.lib ippcorel.lib
Microsoft 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

ipptest.c
c:workipptest.c(17) : warning C4700: uninitialized local variable 'pSrc' used
Microsoft Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

/out:ipptest.exe
ipptest.obj
ippiemerged.lib
ippimerged.lib
ippsemerged.lib
ippsmerged.lib
ippcorel.lib

C:Work>


Pavel
Reply