Link to home
Start Free TrialLog in
Avatar of boomerang061797
boomerang061797

asked on

DLL linker problems (beginner)

I'm trying to link my program using MS VC++ 6.0, but get the following error:

LINK : warning LNK4031: no subsystem specified; CONSOLE assumed
+ loads of errors/warnings

Where is the problem? The project is based on an empty DLL project. Any ideas? My program does nothing special:

#include <windows.h>
#include <iostream>
#include <string>

using namespace std;

BOOL WINAPI DllMain(HINSTANCE hinstDll,
                                DWORD fdwReason,
                                LPVOID lpvReserved)
{
    switch (fdwReason)
    {
        ...
    }
    return (TRUE);
}

__declspec(dllexport) int GetDbTitle(char *dbPath,
                                                   char *serverName,
                                                   char *title)
{
    ...
}
ASKER CERTIFIED SOLUTION
Avatar of inpras
inpras

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of inpras
inpras

A typical application will have

kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo

/subsystem:windows

/dll /incremental:yes /pdb:"Debug/dlltrycons.pdb" /debug /machine:I386 /out:"Debug/dlltrycons.dll" /implib:"Debug/dlltrycons.lib" /pdbtype:sept
Avatar of boomerang061797

ASKER

Works, but shouldn't the "/subsystem:windows" flag be set automatically when creating a Windows DLL?
Yes I do agree depends on the dll type U choose
Is the solution working correctly?
Regards
Yes it works correctly, but I must say that most of the code I used, I cut from other places. I don't really understand how it all works,... but it does.