Thread: converting a win32 console application to DLL LNK 2001 unreseolved sign

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    10

    converting a win32 console application to DLL LNK 2001 unreseolved sign

    I wrote a win 32 console application in C++.
    The application was converted to DLL to work with a VB interface.
    While running the build command to the DLL i receive the following error message:

    vb_dll_version11.obj : error LNK2001: unresolved external symbol "public: __thiscall VisualOptic::~VisualOptic(void)" (??1VisualOptic@@QAE@XZ)

    How should I hanlde it or correct it ?
    Waiting to your asnswerm


    Thanks,
    Moti

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    The destructor for VisualOptic needs to be compiled and linked as well.

    gg

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    10
    Should I include the function in the Def file ?

  4. #4
    Registered User
    Join Date
    Jan 2008
    Posts
    10
    how can I link the distructor and compile it ?

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    The linker is saying "I can't find the code for the VisualOptic's destructor".

    So can you find the code? Is it in one of the project files being compiled?

    gg

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    10

    Link problem

    Thanks gg,
    Code:
    #include "stdafx.h"
    #include "Engine\My_Include\MyInclude.h"
    
    VisualOptic vo;
    
    BOOL APIENTRY DllMain( HANDLE hModule, 
                           DWORD  ul_reason_for_call, 
                           LPVOID lpReserved
    					 )
    {
    
      
     ..... 
     
    
        return TRUE;
    }
    
    
    int _stdcall addFS(int inVO, int Brain, int Pyr, int Cerebellar, int Sens, int Bob, int Cerebral) {
    ...
    }
    
    In the #include "Engine\My_Include\MyInclude.h" I make #include "Engine\FS\Visual_Optic.h"
    Do I miss something ?

  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Wher is the destructor for VisualOptic? Is there a "Visual_Optic.cpp"? If so, that needs to be part of the project.

    gg

  8. #8
    Registered User
    Join Date
    Jan 2008
    Posts
    10
    You are right.
    I added the files to the project and it solved the unresolved Thanks. Now it seems that I have another problem.
    I'll try to solve and update if necessary.
    Thanks a lot gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dynamically link my DLL to an application
    By Maranello in forum C++ Programming
    Replies: 0
    Last Post: 04-20-2005, 07:52 AM
  2. making a stealthy win32 console application?
    By killdragon in forum C++ Programming
    Replies: 3
    Last Post: 09-08-2004, 02:50 PM
  3. icon in win32 console application
    By osal in forum Windows Programming
    Replies: 3
    Last Post: 06-30-2004, 02:13 PM
  4. splitting the screen in a Win32 console application
    By watcher_b in forum C Programming
    Replies: 1
    Last Post: 10-19-2002, 05:22 PM
  5. Win32 Console Application...Full Screen?
    By MrWizard in forum C++ Programming
    Replies: 4
    Last Post: 04-01-2002, 02:56 PM