We help IT Professionals succeed at work.

Linker error

thready asked
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>  Touching "Debug\KKGActivation.unsuccessfulbuild".
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??

Watch Question

Top Expert 2012

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.


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...

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.


Unfortunately that's set as well...  


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?
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.


Here is an example fix:

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

template <class T>
class SomeClass

// and then add this at the bottom of the header
EXPORT_TEMP template class SomeClass<SomeType>;
This one is on us!
(Get your first solution completely free - no credit card required)


Needed the most current build of Poco

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.