Friday, July 31, 2009

Please, I need Help with Visual Studio Error?

Visual Studio, Error LNK2019: unresolved external symbol?





Ok, so I have created a C++ project( using analog to digital chip, "ADC0809") and using Mdedriverdll.lib. I have included the "Mdedriverdll.h" file in my project source file. When I compile, I am getting following linker errors;





1%26gt;labSevenDlg.obj : error LNK2019: unresolved external symbol "int __cdecl MDEInPA(int)" (?MDEInPA@@YAHH@Z) referenced in function "public: void __thiscall ClabSevenDlg::OnBnClickedButton3(void)" (?OnBnClickedButton3@ClabSevenDlg@@QAEXX...


1%26gt;labSevenDlg.obj : error LNK2019: unresolved external symbol "int __cdecl MDEOutPA(int,int)" (?MDEOutPA@@YAHHH@Z) referenced in function "public: void __thiscall ClabSevenDlg::OnBnClickedButton3(void)" (?OnBnClickedButton3@ClabSevenDlg@@QAEXX...





Does anyone know how to fix these errors, please?

Please, I need Help with Visual Studio Error?
These errors look like the kind you see when you try to access C code from C++. The problem is that C++ is going to think that they are C++ functions and give them the mangled name (the one with the @ signs etc) You can fix these using this:





extern C


{


// prototype your C functions in here.


// or


// it's very slightly possible that you could


// include "Mdedriverdll.h" in side here and that


// would take care of the problem


}


The Mdedriverdll.h declares them but they're assumed to be included in a C file not a C++ file.


No comments:

Post a Comment