Solved

Linker error

Posted on 2010-11-16
8
1,165 Views
Last Modified: 2012-08-13
Hi Experts,
I'm using Visual Studio 2010.  Having problems converting a project.  I'm getting the following linker error:

1>------ Build started: Project: KKGActivation, Configuration: Debug Win32 ------
1>Build started 16/11/2010 11:41:55 AM.
1>InitializeBuildStatus:
1>  Touching "Debug\KKGActivation.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>SecurityHelper.lib(Fingerprint.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static __int64 __cdecl Poco::StreamCopier::copyStream(class std::basic_istream<char,struct std::char_traits<char> > &,class std::basic_ostream<char,struct std::char_traits<char> > &,unsigned int)" (__imp_?copyStream@StreamCopier@Poco@@SA_JAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAV?$basic_ostream@DU?$char_traits@D@std@@@4@I@Z) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl CFingerprint::GetFingerprint(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?GetFingerprint@CFingerprint@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V23@@Z)
1>C:\devlio2008\OpenGLGraph\KneeKG\Debug\Debug\\KKGActivation.exe : fatal error LNK1120: 1 unresolved externals


As you can see, it's referencing the SecurityHelper.lib and cannot find Poco::StreamCopier::CopyStream.  I do have this library referenced in the KKGActivation project as an included library as well as in SecurityHelper.  What am I missing??

Thanks,
Mike
0
Comment
Question by:thready
8 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 34147491
You seem to be using Poco (http://poco.sourcearchive.com/documentation/1.3.5/classPoco_1_1StreamCopier.html) without linking to the library - download it from http://pocoproject.org/download/index.html and build it, then add the library to your project.
0
 
LVL 1

Author Comment

by:thready
ID: 34147759
Poco is built and I am linking to the library.  The files exist in their location - moreover, SecurityHelper is a static library that itself links to Poco and builds properly. However, when I try to build KKGActivation, it seems that all of a sudden SecurityHelper cannot find the library it needs to build (even though it's already built!)

I don't get it...
0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 34147923
Do you have the setting for "Additional Library Directories" set?
If not, add the path for the library to this setting so that the compiler can find the library file.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:thready
ID: 34147944
Unfortunately that's set as well...  
0
 
LVL 1

Author Comment

by:thready
ID: 34148485
I think it's because I built the Poco libraries with VS2008.  There's no build for Poco on VS2010 yet either.  Am I up poop creek?
0
 
LVL 3

Expert Comment

by:logic_chopper
ID: 34151167
I've had this problem before, the solution can be found on the Microsoft web site, have a look at, "To Export a Class Containing a Data Member that Is an STL Object".  I mention this because I see your linker error include a reference to STL basic_string.

http://support.microsoft.com/kb/168958

Here is an example fix:

// top of header
#ifdef BUILD_DLL
#define EXPORT_TEMP
#else
#define EXPORT_TEMP extern
#endif

template <class T>
class SomeClass
{
};

// and then add this at the bottom of the header
EXPORT_TEMP template class SomeClass<SomeType>;
0
 
LVL 1

Accepted Solution

by:
thready earned 0 total points
ID: 34257748
The problem was that I needed the most current build (non-release even) of Poco to work with Visual Studio 2010.
0
 
LVL 1

Author Closing Comment

by:thready
ID: 34289806
Needed the most current build of Poco
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Line meaning 9 87
Printing the elements of a set declared inside a map in C++. 3 52
C Programming - If Statement 8 82
C++ help/ Toy problem 19 28
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question