Hi!
As stated in the earlier response:
>> This is a very common problem with wxWidgets on Windows.
>> It has to do with mixing and matching incompatible library types.
>> If you want to use shared objects (.dll's),
>> then you must also build wxWidgets as shared objects.
>> If you want to build in library routines statically,
>> then you have to specify static libraries to µ$.
> you can change /MD to /MT (project perperty/c++/code generation)
> I think it works
> I think it works
This is exactly what you do when you set 'Build > Configurations... > Runtime library' property for a project. By setting this to Static, DB generates either:
RuntimeLibrary="0"
RuntimeLibrary="1"
for /MT (Release) or /MTd (Debug) respectively. Similarly, when set to Dynamic, DB generates:
RuntimeLibrary="2"
RuntimeLibrary="3"
for /MD (Release) or /MDd (Debug) respectively.
These values are in the generated .vcproj file. For the nmake version (VC++, as opposed to VC++ Project), values are in the makefile.vc as:
OPTFLAGS=/MT
OPTFLAGS=/MTd
OPTFLAGS=/MD
OPTFLAGS=/MDd
Again, the crux of the problem is when your wxWidgets libs and the libs you've chosen for runtime from Windows don't match. You cannot build a dynamic Windows application with static wxWidgets. They were built differently on the Windows platform, using different Windows libraries and you will get conflicts at link time. Ref:
Which contains the table (modified for presentation in email: fixed width font):
C run-time library
(without iostream or standard C++ library) Associated DLL Characteristics Option Preprocessor directives
====================================================================================================================================
libcmt.lib None, static link. Multithreaded, static link /MT _MT
------------------------------------------------------------------------------------------------------------------------------------
msvcrt.lib msvcr90.dll Multithreaded, dynamic link /MD _MT, _DLL
------------------------------------------------------------------------------------------------------------------------------------libcmtd.lib None, static link Multithreaded, static link (debug) /MTd _DEBUG, _MT
------------------------------------------------------------------------------------------------------------------------------------
msvcrtd.lib msvcr90d.dll Multithreaded, dynamic link (debug) /MDd _DEBUG, _MT, _DLL
------------------------------------------------------------------------------------------------------------------------------------
====================================================================================================================================
libcmt.lib None, static link. Multithreaded, static link /MT _MT
------------------------------------------------------------------------------------------------------------------------------------
msvcrt.lib msvcr90.dll Multithreaded, dynamic link /MD _MT, _DLL
------------------------------------------------------------------------------------------------------------------------------------libcmtd.lib None, static link Multithreaded, static link (debug) /MTd _DEBUG, _MT
------------------------------------------------------------------------------------------------------------------------------------
msvcrtd.lib msvcr90d.dll Multithreaded, dynamic link (debug) /MDd _DEBUG, _MT, _DLL
------------------------------------------------------------------------------------------------------------------------------------
As you see, the conflicts come up because on the one hand, either the wxWidgets lib or the project used libcmt, and on the other, it's counterpart (wxWidgets or project) used msvcrt. Hence, the conflict messages containing the two libraries.
HTH:
thx,
Dave S.
Dave S.
Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/
http://tech.groups.yahoo.com/group/wxMS_developers/
----- Original Message -----
From: "Ali Ramezani" <ramezani_a@...>
Sent: Sunday, May 17, 2009 8:00 AM
Subject: [anthemion-devtools] Re: Problem building demo project under Windows
> you can change /MD to /MT (project perperty/c++/code generation)
> I think it works
>
> Ali
>
> --- In anthemion-devtools@yahoogroups.com, "ronys" <ronys@...> wrote:
>>
>> Hi,
>>
>> Using version 4.30 (Unicode) with wxWidgets 2.8.7 and MSVC 8 (VS2005), I get the following error while building the Demo project. Any suggestions welcome.
>>
>> Thanks,
>>
>> Rony
>>
>> link /OUT:VCUnicodeRelease\Elements.exe /LIBPATH:"C:\local\src\wxWidgets-2.8.7/lib/vc_lib" /LIBPATH:"C:\local\MSVS8\vc\lib" /LIBPATH:"C:\local\MSVS8\vc\PlatformSDK\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 VCUnicodeRelease\advancedcontrols.obj VCUnicodeRelease\basiccontrols.obj VCUnicodeRelease\complexdialog.obj VCUnicodeRelease\elements.obj VCUnicodeRelease\independentpanel.obj VCUnicodeRelease\myframe.obj VCUnicodeRelease\scrollingdialog.obj VCUnicodeRelease\settingsdialog.obj VCUnicodeRelease\splitterdialog.obj VCUnicodeRelease\topdialog.obj VCUnicodeRelease\wizarddialog.obj VCUnicodeRelease\Elements.res wxmsw28u_richtext.lib wxmsw28u_aui.lib wxmsw28u_core.lib wxbase28u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxmsw28u_adv.lib wxmsw28u_html.lib wxmsw28u_xrc.lib wxbase28u_net.lib wxbase28u_xml.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib
>> link /OUT:VCUnicodeRelease\Elements.exe /LIBPATH:"C:\local\src\wxWidgets-2.8.7/lib/vc_lib" /LIBPATH:"C:\local\MSVS8\vc\lib" /LIBPATH:"C:\local\MSVS8\vc\PlatformSDK\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 @C:\DOCUME~1\ronys\LOCALS~1\Temp\nm54B.tmp
>> LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR80.dll)
>> LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
>> VCUnicodeRelease\Elements.exe : fatal error LNK1169: one or more multiply defined symbols found
>> *** NMAKE : fatal error U1077: 'C:\local\MSVS8\vc\bin\link.EXE' : return code '0x491'
>> *** Stop.
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
> <*> To visit your group on the web, go to:
> http://groups.yahoo.com/group/anthemion-devtools/
>
> <*> Your email settings:
> Individual Email | Traditional
>
> <*> To change settings online go to:
> http://groups.yahoo.com/group/anthemion-devtools/join
> (Yahoo! ID required)
>
> <*> To change settings via email:
> mailto:anthemion-devtools-digest@yahoogroups.com
> mailto:anthemion-devtools-fullfeatured@yahoogroups.com
>
> <*> To unsubscribe from this group, send an email to:
> anthemion-devtools-unsubscribe@yahoogroups.com
>
> <*> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>