Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.

Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby Sami Hamlaoui » Sun Apr 25, 2010 6:19 pm

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.
Attachments
wx_msw_vc10.zip
Fixed project files for wxWidgets 2.9.0 for Visual Studio 2010.
(90.89 KiB) Downloaded 3879 times
Last edited by Sami Hamlaoui on Wed Aug 25, 2010 7:44 pm, edited 2 times in total.
Sami Hamlaoui
In need of some credit
In need of some credit
 
Posts: 6
Joined: Mon Jul 11, 2005 1:35 pm

Postby Sami Hamlaoui » Wed Aug 25, 2010 7:42 pm

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 :)
Attachments
wx291_msw_vc10.zip
Fixed project files for wxWidgets 2.9.1 for Visual Studio 2010.
(110.48 KiB) Downloaded 4543 times
Sami Hamlaoui
In need of some credit
In need of some credit
 
Posts: 6
Joined: Mon Jul 11, 2005 1:35 pm

Postby doublemax » Wed Aug 25, 2010 8:04 pm

Thanks. This might be helpful for some people.
Use the source, Luke!
User avatar
doublemax
Part Of The Furniture
Part Of The Furniture
 
Posts: 7629
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Thanks for the project files and WXUSINGDLL

Postby wxLuis » Fri Aug 27, 2010 10:06 pm

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;
}
wxLuis
In need of some credit
In need of some credit
 
Posts: 8
Joined: Sun Oct 05, 2008 10:53 am

Postby Disch » Tue Sep 28, 2010 8:45 pm

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!
User avatar
Disch
Experienced Solver
Experienced Solver
 
Posts: 99
Joined: Wed Oct 17, 2007 2:01 am

Postby tonto » Fri Oct 29, 2010 1:09 am

thanks for this!

========== Build: 22 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
tonto
In need of some credit
In need of some credit
 
Posts: 6
Joined: Fri Oct 29, 2010 12:47 am

Postby kadesh » Sat Nov 13, 2010 12:49 pm

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?
kadesh
In need of some credit
In need of some credit
 
Posts: 2
Joined: Sat Nov 13, 2010 12:17 pm

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby jbattle » Fri Jan 06, 2012 11:22 pm

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]
jbattle
Earned a small fee
Earned a small fee
 
Posts: 21
Joined: Mon Oct 01, 2007 8:48 pm
Location: Austin, TX

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby doublemax » Sat Jan 07, 2012 12:23 am

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.
Use the source, Luke!
User avatar
doublemax
Part Of The Furniture
Part Of The Furniture
 
Posts: 7629
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby jbattle » Sat Jan 07, 2012 1:48 am

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.
jbattle
Earned a small fee
Earned a small fee
 
Posts: 21
Joined: Mon Oct 01, 2007 8:48 pm
Location: Austin, TX

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby jsolomon » Sat Jan 28, 2012 5:20 pm

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
jsolomon
In need of some credit
In need of some credit
 
Posts: 1
Joined: Sat Jan 28, 2012 5:19 pm

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby wxBen » Wed Jun 06, 2012 4:55 pm

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
User avatar
wxBen
Knows some wx things
Knows some wx things
 
Posts: 41
Joined: Wed Jun 06, 2012 4:44 pm
Location: Calgary, Canada

Re: Fixed wxWidgets 2.9.1 project files Visual Studio 2010

Postby tierra » Fri Jun 08, 2012 4:33 pm

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.
MSW: VS2010, Windows 7 GTK: GCC 4.7.3, Ubuntu 12.04 LTS, GTK+ 2.24.17
User avatar
tierra
Site Admin
Site Admin
 
Posts: 1215
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA


Return to Compiler / Linking / IDE Related

Who is online

Users browsing this forum: No registered users and 7 guests