13

I'm trying to build my first ATL DLL project, in which I'm using ADODB. The issue here is that I'm getting each ADODB class underlined

ADODB::_ConnectionPtr spADOConnection;

when I pass the mouse over on ADODB::_ConnectionPtr I get name followed by '::' must be a class or namespace name spADOConnection I get expected a ';'. What's the mean of this, please? How do I to fix it please?

Thanks a lot!

Lucie kulza
  • 1,357
  • 6
  • 20
  • 31
  • 2
    looks like C++ doesn't know that ADODB is a class or namespace, is everything correctly included/linked in your project? Are you getting any external symbol errors during compilation? – Syntactic Fructose Apr 07 '14 at 20:35
  • @Gmercer015, I've correctly included `msado60.dll`, yes I'm getting an external symbol on `LNK2001: unresolved external symbol "public: virtual long __stdcall CTProcessus::Init(class ATL::CStringT > >,wchar_t *,wchar_t *,wchar_t *)"` – Lucie kulza Apr 07 '14 at 20:43
  • 2
    You don't include DLLs, you include header files. – juanchopanza Apr 07 '14 at 20:49
  • @Luciekulza as juanchopanza said, your .dll would be placed in the same directory as your executable. It's not something you would include from the properties page – Syntactic Fructose Apr 07 '14 at 21:00

1 Answers1

17

The compiler is unable to locate the declaration of ADODB. Make sure you include the relevant header in the translation unit where the compiler complains.

legends2k
  • 31,634
  • 25
  • 118
  • 222
  • 2
    The compiler has got nothing to do with DLLs which come at a much later stage. This is more at the code generation phase where the compiler needs to verify the type you're trying to use. There should be a header where the type `ADODB` is introduced. Make sure it's included in the source file you're trying to compile. – legends2k Apr 07 '14 at 20:47