Hello there,
I am currently trying to create a DLL of an application using Microsoft Visual C++ 6.0 and the wxWidgets development snapshot 2.5.2. I have used the "Creating A DLL Of An Application" article from the wxWiki as a reference. When building the FromDLL Project portion of the example in the article, I get multiple errors including the following:
wxbase25d.lib(hash.obj) : error LNK2001: unresolved external symbol __imp__strdup
wxbase25d.lib(intl.obj) : error LNK2001: unresolved external symbol __imp__strdup
FromDLL.obj : error LNK2001: unresolved external symbol __imp__strdup
wxmsw25d_core.lib(xpmdecod.obj) : error LNK2001: unresolved external symbol __imp__strdup
wxbase25d.lib(strconv.obj) : error LNK2001: unresolved external symbol __imp__strdup
wxbase25d.lib(list.obj) : error LNK2001: unresolved external symbol __imp__strdup
It appears as though I cannot link to the wxWidgets DLLs.
Any suggestions would be greatly appreciated. Thank you in advance.
Best Regards,
Cynthia
Creating DLL Of An Application
-
- In need of some credit
- Posts: 9
- Joined: Wed Sep 01, 2004 8:23 pm
- tierra
- Site Admin
- Posts: 1355
- Joined: Sun Aug 29, 2004 7:14 pm
- Location: Salt Lake City, Utah, USA
- Contact:
Have you gone through the instructions of first building all of wxWidgets first?
There's not a lot of information here to describe what might be your problem. Can you describe what steps you've taken in the wiki?
On another note, this needs moved to the Implementation specific forums, not developement.
There's not a lot of information here to describe what might be your problem. Can you describe what steps you've taken in the wiki?
On another note, this needs moved to the Implementation specific forums, not developement.
What libraries did you include?
What is the setting of the "C++ -> Code Generation" tab.
Can you tell me (both of the main application and the DLL).
What kind of dll are you aiming for? One where you include the .lib into, or one where you can load dynamical symbols from?
What is the setting of the "C++ -> Code Generation" tab.
Can you tell me (both of the main application and the DLL).
What kind of dll are you aiming for? One where you include the .lib into, or one where you can load dynamical symbols from?
wxWidgets: SVN/trunk
OS: WinXP/2 + Ubuntu + Mac 10.4.11
Compiler: VS2005 + GCC 4.2 + GCC 4.0.1
-----
home: http://www.salvania.be
OS: WinXP/2 + Ubuntu + Mac 10.4.11
Compiler: VS2005 + GCC 4.2 + GCC 4.0.1
-----
home: http://www.salvania.be
-
- In need of some credit
- Posts: 9
- Joined: Wed Sep 01, 2004 8:23 pm
Example Written For 2.4.1
Hello there,
My apologies for placing this in the wrong forum index. It would be greatly appreciated if the moderators could move this topic into the right forum index.
Thank you all for your response.
I have gone through the instructions of first building all of the wxWidgets first. I am currently trying to build the projects in Win32 Debug mode.
The libraries I included are the following for the DLL:
odbc32.lib
odbccp32.lib
wxmsw25d_core.lib
wxbase25d.lib
wxtiffd.lib
wxjpegd.lib
wxpngd.lib
wxzlibd.lib
wxregexd.lib
wxexpatd.lib
comctl32.lib
rpcrt4.lib
winmm.lib
wsock32.lib
The libraries I included are the following for the application:
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib
The setting of the "C++ -> Code Generator tab for the DLL is the following:
Processor: Blend *
Use run-time library: Debug Multithreaded DLL
Calling convention: __cdecl *
Struct member alignment: 8 Bytes *
The setting of the "C++ -> Code Generator tab for the application is the following:
Processor: Blend *
Use run-time library: Debug Single-Threaded
Calling convention: __cdecl *
Struct member alignment: 8 Bytes *
The application does not use wxWidgets.
Currently I'm just trying to learn how to create DLLs and libraries using wxWidgets and loading them into applications.
I have e-mailed the author of the example and he mentioned how the example was written against the wxWidgets version 2.4.1 so it would need some updating to work with 2.5.2. I think the step I should take right now is to write my own application and DLL and use the example as a reference.
Best Regards,
Cynthia
My apologies for placing this in the wrong forum index. It would be greatly appreciated if the moderators could move this topic into the right forum index.
Thank you all for your response.
I have gone through the instructions of first building all of the wxWidgets first. I am currently trying to build the projects in Win32 Debug mode.
The libraries I included are the following for the DLL:
odbc32.lib
odbccp32.lib
wxmsw25d_core.lib
wxbase25d.lib
wxtiffd.lib
wxjpegd.lib
wxpngd.lib
wxzlibd.lib
wxregexd.lib
wxexpatd.lib
comctl32.lib
rpcrt4.lib
winmm.lib
wsock32.lib
The libraries I included are the following for the application:
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib
The setting of the "C++ -> Code Generator tab for the DLL is the following:
Processor: Blend *
Use run-time library: Debug Multithreaded DLL
Calling convention: __cdecl *
Struct member alignment: 8 Bytes *
The setting of the "C++ -> Code Generator tab for the application is the following:
Processor: Blend *
Use run-time library: Debug Single-Threaded
Calling convention: __cdecl *
Struct member alignment: 8 Bytes *
The application does not use wxWidgets.
Currently I'm just trying to learn how to create DLLs and libraries using wxWidgets and loading them into applications.
I have e-mailed the author of the example and he mentioned how the example was written against the wxWidgets version 2.4.1 so it would need some updating to work with 2.5.2. I think the step I should take right now is to write my own application and DLL and use the example as a reference.
Best Regards,
Cynthia
-
- In need of some credit
- Posts: 9
- Joined: Wed Sep 01, 2004 8:23 pm
wxEntry, OnExit, DllMain DLL Questions
Hello there,
I was reading "creating wxWiki: Creating A DLL Of An Application" (http://wiki.wxwidgets.org/wiki.pl?Creat ... pplication) and have some questions about having to define
- DllMain()
- wxEntry()
- wxTheApp->OnExit()
I was wondering what an example wxEntry() and wxTheApp->OnExit() would look like?
wxEntry would have the following interface for wxWindows initialization under Windows for applications constructed as a DLL ... is that correct?
void wxEntry(HANDLE hInstance, HANDLE hPrevInstance, WORD wDataSegment, WORD wHeapSize, const wxString& commandLine)
For DllMain(), I had copied the code below from an example
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
//
// Start wxDLLApp
//
// Note the 4th entry means we don't enter the main application
// loop now.
wxEntry(hModule, 0, NULL, 0, false);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
//
// Shutdown wxDLLApp
//
wxGetApp().OnExit();
break;
}
return TRUE;
}
For some odd reason, the case for DLL_PROCESS_DETACH is ignored. When the dll is unloaded, a wxMessageBox should appear having "Hello World from DLL" as the message text. However, the application crashes at the wxMessageBox line and displays an unhandled exception/access violation error.
My apologies for all the questions, if anybody has a good example of how to create DLLs in wxWidgets using Mirosoft Visual C++ 6.0 and wxWidgets development snapshot 2.5.2, it would be greatly appreciated if you could let me know.
Cheers,
Cynthia
I was reading "creating wxWiki: Creating A DLL Of An Application" (http://wiki.wxwidgets.org/wiki.pl?Creat ... pplication) and have some questions about having to define
- DllMain()
- wxEntry()
- wxTheApp->OnExit()
I was wondering what an example wxEntry() and wxTheApp->OnExit() would look like?
wxEntry would have the following interface for wxWindows initialization under Windows for applications constructed as a DLL ... is that correct?
void wxEntry(HANDLE hInstance, HANDLE hPrevInstance, WORD wDataSegment, WORD wHeapSize, const wxString& commandLine)
For DllMain(), I had copied the code below from an example
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
//
// Start wxDLLApp
//
// Note the 4th entry means we don't enter the main application
// loop now.
wxEntry(hModule, 0, NULL, 0, false);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
//
// Shutdown wxDLLApp
//
wxGetApp().OnExit();
break;
}
return TRUE;
}
For some odd reason, the case for DLL_PROCESS_DETACH is ignored. When the dll is unloaded, a wxMessageBox should appear having "Hello World from DLL" as the message text. However, the application crashes at the wxMessageBox line and displays an unhandled exception/access violation error.
My apologies for all the questions, if anybody has a good example of how to create DLLs in wxWidgets using Mirosoft Visual C++ 6.0 and wxWidgets development snapshot 2.5.2, it would be greatly appreciated if you could let me know.
Cheers,
Cynthia
please change the single threaded... to the "Debug Multithreaded DLL" (it has to be same in all the dlls of your program and in your program).
Next, please add kernel.lib everywhere... I once encountered a very hard to debug error which was solved by adding kernel.lib (but it even linked fine without it! it would just crash??)
Next, please add kernel.lib everywhere... I once encountered a very hard to debug error which was solved by adding kernel.lib (but it even linked fine without it! it would just crash??)
wxWidgets: SVN/trunk
OS: WinXP/2 + Ubuntu + Mac 10.4.11
Compiler: VS2005 + GCC 4.2 + GCC 4.0.1
-----
home: http://www.salvania.be
OS: WinXP/2 + Ubuntu + Mac 10.4.11
Compiler: VS2005 + GCC 4.2 + GCC 4.0.1
-----
home: http://www.salvania.be