1

I implemented my C++ code normally. After I finished, I started to decide to implement wrapper to be able to access my Core in C#. But once I included my project and on building I got many error messages with

error LNK2019: unresolved external symbol "extern "C"....

Example:

error LNK2019: unresolved external symbol "public: long thiscall CPreview::CheckDeviceLost(struct _DEV_BROADCAST_HDR *,int *)" (?CheckDeviceLost@CPreview@@$$FQAEJPAU_DEV_BROADCAST_HDR@@PAH@Z) referenced in function "void __cdecl OnDeviceChange(struct HWND *,struct _DEV_BROADCAST_HDR *)" (?OnDeviceChange@@$$FYAXPAUHWND__@@PAU_DEV_BROADCAST_HDR@@@Z) C:\Users\mariame\Desktop\WrapperCameraModule\camera_module_wrapper\camera_module_wrapper\camera_module_wrapper\camera_module_wrapper.obj camera_module_wrapper

or

error LNK2028: unresolved token (0A00007E) "extern "C"

Example:

Error 32 error LNK2028: unresolved token (0A0000B5) "extern "C" long __stdcall DispatchMessageW(struct tagMSG const *)" (?DispatchMessageW@@$$J14YGJPBUtagMSG@@@Z) referenced in function "extern "C" long __cdecl DispatchMessage(struct tagMSG const *)" (?DispatchMessage@@$$J0YAJPBUtagMSG@@@Z) C:\Users\mariame\Desktop\WrapperCameraModule\camera_module_wrapper\camera_module_wrapper\camera_module_wrapper\camera_module_wrapper.obj camera_module_wrapper

I have not used any extern "C" in my code. They are in the included function.

#include <windows.h>
#include <windowsx.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrite.h>
#include <assert.h>
#include <strsafe.h>
#include <shlwapi.h>
#include <Dbt.h>
#include <ks.h>
#include <ksmedia.h>

What shall I do I need to implement the wrapper

tulipe
  • 676
  • 2
  • 8
  • 22
  • 1
    Please post the offending line. – zmbq Feb 18 '15 at 12:48
  • I got many error not only one example this:"error LNK2019: unresolved external symbol "extern "C" int __stdcall EnableWindow(struct HWND__ *,int)" (?EnableWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "void __cdecl OnInitDialog(struct HWND__ *,class Devices *)" (?OnInitDialog@@$$FYAXPAUHWND__@@PAVDevices@@@Z) C:\Users\mariame\Desktop\WrapperCameraModule\camera_module_wrapper\camera_module_wrapper\camera_module_wrapper\camera_module_wrapper.obj camera_module_wrapper" – tulipe Feb 18 '15 at 12:52
  • 1
    @tulipe Post the errors with your question. Also post the part of your code you suspect is causing this with an explanation of what it does. – Arun A S Feb 18 '15 at 12:53
  • they are around 67 error messages which one shall I select – tulipe Feb 18 '15 at 12:55
  • Post the parts of your code which you think is causing these errors ( don't forget indentations ). – Arun A S Feb 18 '15 at 13:06
  • @ArunA.S I added the included libraries caused the problem – tulipe Feb 18 '15 at 13:10
  • I don't have their source code they are MF(Media Foundation) lib – tulipe Feb 18 '15 at 13:11
  • If this is not a Unicode project, try changing the Configuration/General/Character Set to MBCS. – cup Feb 18 '15 at 13:27
  • @Mgetz how to add and why is that? – tulipe Feb 18 '15 at 13:27
  • 1
    @tulipe it seems you have more than one problem because `user32.lib` **IS** included by default into the linked libraries by default. I don't think we have a good idea of what's going on here. Most likely you're missing a linker dependency. The other option is you have unimplemented functionality. – Mgetz Feb 18 '15 at 13:31
  • @Mgetz I have added the required dependencies and I still have errors,less too much but still here – tulipe Feb 18 '15 at 14:46

0 Answers0