# Problem with Visual Studio 2008 when rewriting engine

This topic is 2925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all, I've been fairly quiet the last few months, just been busy with work and things and anyway it's come time for me to get back into OpenGL. Now I'm wanting to start mostly from scratch because I've redesigned how I want my engine to be, howver I'm coming across a problem and feeling like a complete noob. Basically, I want to have a solution in Visual Studio that contains two projects. The first is the DLL I'm developing for the engine itself. The 2nd is a simple test app, that references the DLL and can call the classes/functions within it. However, I'm stuck. I've created the solution but regardless of what settings I change (References, Project Dependencies, Additional Libs, etc) I just can't seem to get this work. When I'm in the project that is the demo app, intellisense will provide me with all the classes that are in the DLL but when I try and compile it just returns "Undeclared Identifer" when I'm trying to declare the class in the demo. What am I doing wrong!?!?! Thanks,

##### Share on other sites
Surely for a DLL you don't have to include a header, isn't that just for .lib (static libs)?

##### Share on other sites
Quote:
 Surely for a DLL you don't have to include a header, isn't that just for .lib (static libs)?

DLL and libraries mean nothing to a C++ compiler (it's the linker that would deal with them). The compiler needs to know about the declarations and definitions of various things exposed by the external code. That typically means including the header files that declare or define those entities.

If you're not including those headers, that's certainly going to be a problem. You might have others as well, though -- but that will definitely be a problem. You should read this if you have not already.

If it still doesn't compile after you add the appropriate includes, why don't you paste your code that doesn't compile and detail the errors?

The nature of your issue suggests you don't know much about DLLs and how they operate, which begs the question "why are you even using one?"

##### Share on other sites
Not OpenGL related; moving to FB.

##### Share on other sites
Maybe missing something like this:

#ifdef MYENGINEDLL_EXPORTS#define MYENGINEDLL_API __declspec(dllexport)#else#ifdef MYENGINEDLL_STATIC_LIB#define MYENGINEDLL_API#else#define MYENGINEDLL_API __declspec(dllimport)#endif //MYENGINEDLL_STATIC_LIB#endif

class  MYENGINEDLL_API MyClass : public Node{...}

Just add MYENGINEDLL_EXPORTS in preprocessor definitions in your dll and it should be ok.