Where is the lib definition defined in a project?

Although I am not new to C++, linking has always been a bit confusing for me... so I suppose this may be a beginner question... ??

If I am using a dll and linking in another project, there is usually something like this (where Q_DECL_EXPORT/Q_DECL_IMPORT is essentially the typical __declspec(dllexport/dllimport) pair.

1
2
3
4
#ifdef STGPLUGINCLASSES_LIB
# define STGPLUGINCLASSES_EXPORT Q_DECL_EXPORT
#else
# define STGPLUGINCLASSES_EXPORT Q_DECL_IMPORT 


I am having trouble linking in my current project and I think I may have accidentally changed something. I try to link the file that uses the dll and it doesn't work. All I get is a bunch of LNK 2019 errors for every function.
None of the functions that I have defined in code end up in the lib file (I checked with a hex editor after a good hour and a half of not finding any other cause).

I think the reason is because the Export line is greyed out in the library that is supposed to be exporting and so the Import definition above is being used. Where is the STGPLUGINCLASSES_LIB symbol typically defined? I think I accidentally may have deleted it.
Last edited on
Where is the STGPLUGINCLASSES_LIB symbol typically defined?
Usually in the project settings of the dll.

Note that for the dll there will be also a static lib generated which must be linked by the user of the dll.
Topic archived. No new replies allowed.