Compile for Windows XP

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Compile for Windows XP

Post by wxProgrammer » Thu Sep 04, 2014 9:39 am

Hi guys,
I've written a software with wxWidgets 2.8 and Visual Studio Express for Desktop (2012) in Release Mode but it work only on Windows 7. I need to compile it for Windows XP so I've tried to select on Platform Toolset "vc11_xp" but it don't run on XP. How can I compile it for XP?
Thank you
I'm Italian but we can speak C++ :)

User avatar
doublemax
Moderator
Moderator
Posts: 15176
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compile for Windows XP

Post by doublemax » Thu Sep 04, 2014 9:45 am

I'm not sure about the Express version, but with "Visual Studio 2012 Professional" you had to install SP1 to target XP. The initial version couldn't do it.
Use the source, Luke!

wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: Compile for Windows XP

Post by wxProgrammer » Thu Sep 04, 2014 9:49 am

And how can I install it? Previously I had install the target "vc11_xp"
I'm Italian but we can speak C++ :)

User avatar
doublemax
Moderator
Moderator
Posts: 15176
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compile for Windows XP

Post by doublemax » Thu Sep 04, 2014 11:10 am

Did you also rebuild the wxWidgets libraries with the new toolset? If yes, i'm out of ideas.
Use the source, Luke!

wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: Compile for Windows XP

Post by wxProgrammer » Fri Sep 05, 2014 1:09 pm

Yes but it don't work.. :\
I try to convert the project into a project for VS10 and I compile it on Windows XP.. With CodeBlocks I don't know how to set correctly a project for wxWidgets 2.8, wxPDFDocument and wxSQLite3
I'm Italian but we can speak C++ :)

User avatar
doublemax
Moderator
Moderator
Posts: 15176
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Compile for Windows XP

Post by doublemax » Fri Sep 05, 2014 1:24 pm

Maybe you could you use VS2008 Express instead?

http://stackoverflow.com/a/15319069
Use the source, Luke!

stefan__o
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Aug 04, 2014 12:55 am

Re: Compile for Windows XP

Post by stefan__o » Wed Sep 10, 2014 5:47 am

I had a similar problem, the project files for wxWidgets do not define a subsystem for some reason, without subsystem defined the toolset-setting is ignored.
Easiest way to solve: Mark all projects, right-click and open the settings, somewhere you can define the subsystem, you may choose console or windows (seems to be no difference). After that it will work.

wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: Compile for Windows XP

Post by wxProgrammer » Wed Sep 10, 2014 12:06 pm

The subsystmes is already setted (WINDOWS)
I've tried to compile with CodeBlocks (with VS11 Compiler).
I've correctly setted the library and "include" (wxWidgets, wxPdfDocument & wxSQLite3) and I've setted:
on the Compiler Flags:

Code: Select all

Enforce Standard C++ for scoping rules [/Zc:forScope]
wchar_t is the native type, not a typedef [/Zc:wchar_t]
Separate functions for linker [/Gy]
Enable security checks [/GS]
'precise' floating-point model; result are predictable [/fp:precise]
Enable link-time code generation [/GL]
Multi-threaded Runtime Library [/MT]
Other options:

Code: Select all

-O2
#defines:

Code: Select all

_USING_V100_SDK71_
_UNICODE
UNICODE
When I compile, there are these errors:

Code: Select all

||=== Build: Release in Management of Customers (compiler: Microsoft Visual C++ 2010) ===|
LINK||warning LNK4044: unrecognized option '/s'; ignored|
LINK||warning LNK4044: unrecognized option '/s'; ignored|
wxcode_msw28u_wxsqlite3.lib(wxsqlite3.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfdocument.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfannotation.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfcolour.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfencrypt.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfimage.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfgraphics.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfkernel.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfxml.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfform.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdftemplate.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfocg.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdescription.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffont.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdetails.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontmanager.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfpattern.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfutility.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfrijndael.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfgradient.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontextended.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfparser.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfobjects.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdflayer.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdata.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfencoding.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdatacore.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdataopentype.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdatatruetype.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdatatype0.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontdatatype1.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontparsertruetype.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontparsertype1.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfdecode.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontsubsetcff.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontsubsettruetype.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontvolt.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdffontparser.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfcffindex.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxcode_msw28u_pdfdoc.lib(pdfcffdecoder.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxbase28u_xml.lib(xml.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxbase28u_xml.lib(dummy.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(auibook.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(framemanager.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(auibar.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(dummy.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(tabmdi.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(dockart.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_aui.lib(floatpane.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
wxmsw28u_core.lib(ctrlcmn.obj)||error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Analysis.obj|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 2 warning(s) (0 minute(s), 20 second(s)) ===|
With visual studio (with the same libraries) the compilation is ok.
I've compilate all libraries and my project in Release Mode (UNICODE).

Else, I must install VS2008 into a pc with XP and compile it.

Thank you
I'm Italian but we can speak C++ :)

stefan__o
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Aug 04, 2014 12:55 am

Re: Compile for Windows XP

Post by stefan__o » Wed Sep 10, 2014 8:44 pm

It seems you are using the same wxWidgets source tree with different IDEs/compilers, that will very likely cause problems. Always work with a fresh directory (unzip the file to a new directory) when using another IDE.
For Visual Studio 2012 open the solution, mark all projects, change toolset to v110_xp (you need SP1 or later) and set subsystem to windows, then compile.

To analyze where the exact problem is you can use Dependency Walker: http://www.dependencywalker.com/
Just open the exe of your program and it will tell you what minimum OS version your dll/exe (and every dll it depends on) need. For XP compatibility the value of everything that is not part of the OS must not be higher than 5.1 (if you do something wrong during building it´s most likely 6.0). Dynamic linking is very useful here, with static linking you won´t see what library causes the problem.

wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: Compile for Windows XP

Post by wxProgrammer » Thu Nov 13, 2014 7:29 am

Yes, the problem was that I'd used sources compiled with different IDE, now it's all ok, thank all :)
I'm Italian but we can speak C++ :)

Post Reply