Page 1 of 1

Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Sun Apr 25, 2010 6:19 pm
by Sami Hamlaoui
Please note that this is out of date. In wxWidgets 2.9.3+, simply open wx_vc9.sln in VS2010, and perform the project conversion, and everything will build correctly.
wxWidgets 2.9.0

As some people are experiencing errors when converting the existing project files to MSVC 2010 (including myself), I've put together a set of project files that will compile 2.9.0 properly with no workarounds needed. The most common error people are getting is this:

Microsoft.CppCommon.targets(151,5): error MSB6001: Invalid command line switch for "cmd.exe". The path is not of a legal form.

This is due to how MSVC 2010 handles the Custom Build Tool/Event commandline, which wxWidgets uses when copying the setup.h files. I have fixed this by removing all usage of the Custom Build Tool/Event, and replaced it with a Pre-Build Event which for some reason doesn't have this new behavior. Full details in the readme.txt file inside the attached archive.

Hope it helps :)

P.S. This has only been tested against the main development snapshot on the downloads page, NOT the daily snapshot.

P.P.S These projects will still generate warnings about $(TargetName) not matching some other variable, but these can be safely ignored.

Posted: Wed Aug 25, 2010 7:42 pm
by Sami Hamlaoui
wxWidgets 2.9.1

I've updated the project files for wxWidgets 2.9.1. The release used is the one on the home page (i.e. not the daily snapshot).

Please let me know if you experience any issues with these project files. There have been a lot of downloads but no replies, which makes me think that either they work perfectly or they're completely useless :)

Posted: Wed Aug 25, 2010 8:04 pm
by doublemax
Thanks. This might be helpful for some people.

Thanks for the project files and WXUSINGDLL

Posted: Fri Aug 27, 2010 10:06 pm
by wxLuis
I downloaded the vc++2010 project files and solution. The only problem was in the scintilla project. It has a preprocessor definition in the configuration Release and also in the Debug where it defines WXUSINGDLL. This define should be removed from the project properties. This preprocesor can only be used in dynamic or dll configurations using MDD or MTD code Generation switches.
This causes some warnings with vc++2010 and errors with gcc compiler.
The warnings complains about importing functions in static libraries. I created Debug and Release static libraries after changing all Code Generation switches to MT for Release and MTD for Debug. The projects comes with the MD switch and we need to change all switches to MT or MTD in order to create static libraries.

Thanks for the projects files. They make me possible to experiment with the function void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) with fail to produce BraceMatching in wx2.9.1 by the control wxStyledTextCtrl.

void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {

paintState = painting;
Surface* surfaceWindow = Surface::Allocate();
surfaceWindow->Init(dc, wMain.GetID());
rcPaint = PRectangleFromwxRect(rect);
PRectangle rcClient = GetClientRectangle();
paintingAllText = rcPaint.Contains(rcClient);

ClipChildren(*dc, rcPaint);
Paint(surfaceWindow, rcPaint);

delete surfaceWindow;

if (paintState == paintAbandoned) {
// Painting area was insufficient to cover new styling or brace
// highlight positions
FullPaint();<<<---THIS DO NOTHING
}

paintState = notPainting;
}

Posted: Tue Sep 28, 2010 8:45 pm
by Disch
Hey everyone, I'm having a bit of trouble with VC++ 2010 Express.

I've followed the directions on this thread as well as on the below page:
http://wiki.wxwidgets.org/Microsoft_Vis ... 2B.2B_2010


But I keep getting tons of compiler errors as if I'm missing some of the source files!

Code: Select all

1>c1xx : fatal error C1083: Cannot open source file: '..\..\src\stc\scintilla\src\AutoComplete.cxx': No such file or directory
I checked and there indeed is no stc subdirectory in /src/.

This is just one of many such errors. It looks as if I'm missing dozens of source files.

Is there something else I need to download besides the 2.9.1 exe installer?

I appreciate any and all help! Thanks!



EDIT:

Oh my god. I just realized I installed wx 2.8.xx not 2.9.1.

Lemme try this again...


EDIT 2:

Yeah that was it. Durr. XD

Man I was messing around with this for like 2 hours. Finally I decided to ask for help... then as soon as I post I find the problem myself. haha.

Thanks!

Posted: Fri Oct 29, 2010 1:09 am
by tonto
thanks for this!

========== Build: 22 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Posted: Sat Nov 13, 2010 12:49 pm
by kadesh
I'm getting errors like this one for almost all projects in the solution built with VS2010 (VS2008 works fine):

Code: Select all

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\Program Files\wxWidgets-2.9.1\build\msw\.\..\..\lib\vc_dll\wxregex.lib) does not match the Library's OutputFile property value (C:\Program Files\wxWidgets-2.9.1\lib\vc_dll\wxregexu.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).

Code: Select all

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1153,5): warning MSB8012: TargetName(wxregex) does not match the Library's OutputFile property value (wxregexu). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
  wx_wxregex.vcxproj -> C:\Program Files\wxWidgets-2.9.1\build\msw\.\..\..\lib\vc_dll\wxregex.lib
I've inspected the corresponding build file:

Code: Select all

<VCMessage Condition="'%(_OutputFileFromLib.FullPath)' != '$([System.IO.Path]::GetFullPath($(TargetPath)))'" Code="MSB8012" ...
and project files. TargetPath is never set and I can't find the key in the project's properties.

Any ideas?

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Fri Jan 06, 2012 11:22 pm
by jbattle
I'm seeing the exact same problem kadesh reported on 2010/11/13, after trying to build Debug and Release library versions of wx 2.9.3. I realize this zip file wa smade for 2.9.1, but without it, msvc 2010 express wouldn't even try to build anything, complaining that it couldn't convert any of the build files.

If anybody has a suggestion of what to do about it, I'd appreciate it.

[quote]C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\wx-2.9.3\build\wx291_msw_vc10\..\..\lib\vc_lib\base.lib) does not match the Library's OutputFile property value (C:\wx-2.9.3\lib\vc_lib\wxbase29ud.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1153,5): warning MSB8012: TargetName(base) does not match the Library's OutputFile property value (wxbase29ud). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
wx_vc10_base.vcxproj -> C:\wx-2.9.3\build\wx291_msw_vc10\..\..\lib\vc_lib\base.lib[/quote]

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Sat Jan 07, 2012 12:23 am
by doublemax
If you have to use VS2010, you'll have to ignore these warnings for now. Or you have to make the necessary changes manually.

http://blogs.msdn.com/b/vcblog/archive/ ... guide.aspx

BTW: The .SLN files that come with wxWidgets 2.9.3 work, so you don't have to use the edited ones from this thread.

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Sat Jan 07, 2012 1:48 am
by jbattle
doublemax, thanks for the help. I had followed the directions from somewhere saying I should open build/msw/wx.dsw which barfed hard, then I tried these 2.9.1 files.

As you say, opening wx_vc9.sln worked.

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Sat Jan 28, 2012 5:20 pm
by jsolomon
doublemax wrote:If you have to use VS2010, you'll have to ignore these warnings for now. Or you have to make the necessary changes manually.

http://blogs.msdn.com/b/vcblog/archive/ ... guide.aspx

BTW: The .SLN files that come with wxWidgets 2.9.3 work, so you don't have to use the edited ones from this thread.
Are there any info on how to edit them manually though? It seems like a tough one.

Jacob

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Wed Jun 06, 2012 4:55 pm
by wxBen
I just downloaded wxWidgets-2.9.3 using Visual Studio 2010 with SP1. In the build\msw directory I see no wx_vc10.sln. But I opened wx_vc9.sln and it converted and built fine (other than the usual having to keep building until everything succeeded). I ran some samples, and they also worked fine. :D

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Posted: Fri Jun 08, 2012 4:33 pm
by tierra
wxBen wrote:I just downloaded wxWidgets-2.9.3 using Visual Studio 2010 with SP1. In the build\msw directory I see no wx_vc10.sln. But I opened wx_vc9.sln and it converted and built fine (other than the usual having to keep building until everything succeeded). I ran some samples, and they also worked fine. :D
Yep, you are correct, I just added a note to this post for others that stumble across this since they *should* be using the latest 2.9 version that does work just fine in VS2010.