Serak Shiferaw
Serak Shiferaw

Reputation: 1021

error LNK2019: unresolved external symbol "extern "C" what is this error?

i was trying to wrap cimg library inside c++/clr and when i try to build it i get a bunch of Link errors.

 Error  20  error LNK2028: unresolved token (0A0002AC) "extern "C" int __stdcall DestroyWindow(struct HWND__ *)" (?DestroyWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: void __thiscall cimg_library::CImgDisplay::_desinit_fullscreen(void)" (?_desinit_fullscreen@CImgDisplay@cimg_library@@$$FQAEXXZ)   c:\Users\serakpc\documents\visual studio 2012\Projects\CimgWrapper\CimgWrapperCLI\Stdafx.obj    CimgWrapperCLI

source code in Stdafx.h

#pragma once

#include "cimgheader\CImg.h"

Upvotes: 0

Views: 4081

Answers (1)

SomeWittyUsername
SomeWittyUsername

Reputation: 18358

Just including the header isn't enough. If you have a static compiled library, you need to include it in your solution so the linker will be able to find the binary code and produce an executable. If you have source code of the library, you need to include it in the solution and compile it with your own code.

Upvotes: 4

Related Questions