HOWTO: wxWidgets + VC2005 Express WITH ONLINE HELP!!!

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.
JPlaroche
Earned some good credits
Earned some good credits
Posts: 131
Joined: Fri Dec 09, 2005 4:58 pm
Contact:

memo technique

Post by JPlaroche » Thu Mar 16, 2006 12:15 pm

Visual C++
How to: Use Visual C++ Express Edition with the Microsoft Platform SDK

You can use Visual C++ 2005 Express Edition to build powerful .NET Framework applications immediately after installation. In order to use Visual C++ Express Edition to build Win32 applications, you will need to take just a few more steps, as detailed below.

Installing the Platform SDK for use with Visual C++ Express Edition
Install the Microsoft Platform SDK over the Web from the Platform . On that page click Download and then make sure to choose Windows SDK and then Core SDK from the list.

From the Tools menu in Visual Studio, select Options. The Options dialog box appears.

From the Options dialog box, expand the Projects and Solutions node and select VC++ Directories. In that section, add the following paths to the appropriate subsection:

Executable files: C:\Program Files\Microsoft SDK\Bin

Include files: C:\Program Files\Microsoft SDK\include

Library files: C:\Program Files\Microsoft SDK\lib

Note
The location of the Platform SDK might be different on your system.


Update the corewin_express.vsprops file (found in C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults) and change the string that reads:

AdditionalDependencies="kernel32.lib"

to:

AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"

Note
Visual C++ Express Edition might be installed in a different location on your system.
apprendre et developper en C++ des sub routine interfac� HIM et BD pour validation acquis
Jean-Pierre

project define DB descripteur idem IBM400
http://www.ombrebleu.com/wxsrc/src/

eggsy84
Earned a small fee
Earned a small fee
Posts: 16
Joined: Mon Dec 12, 2005 1:35 pm

VS express not saving changes

Post by eggsy84 » Sat Mar 18, 2006 6:57 pm

Hi all

Have followed the instructions and all seems fine until I close the solution, has anyone had a problem with Visual Express not saving changes made to project properties?

IE

I make the listed changed to the projects then either :

Close the solution and choose save

OR

Choose File > Save All and the Exit / Close

Then when i reload the project the changes are reflected and have been lost??

Has anyone else had this problem?

Probably more of an Visual studio post but thought I'd ask the helpful wx crowd
Thanks all

Eggsy

cpp
I live to help wx-kind
I live to help wx-kind
Posts: 195
Joined: Wed Sep 28, 2005 9:42 pm

Post by cpp » Sun Mar 19, 2006 4:11 am

i havent had any problems like the one you describe. Theres only 3 thing i can think about:

A) the directory where your wxWigets lives is read only. (but i think VC would warn you about this)

B) The "original" projects & solution (wx.dsw) that come with wxWidgets, are VC6 version, when you open them with VC2005, a new solution (extension sln, and with the nice VC2005 icon) is created, and when you edit the projects, you are in fact editing the new projects from the new solution created by the VC2005 import wizzard, maybe when you re-open the solution you are opening the old (VC6 .dws) one instead of the newly created .sln one?

C) if your wx directory is not read only, and you are opening the right solution, then maybe there is in fact a bug in VC2005 that i havent encountered yet?

Im guessing B is the more likely :D

HTH
Hier Kommt die Sonne...

eggsy84
Earned a small fee
Earned a small fee
Posts: 16
Joined: Mon Dec 12, 2005 1:35 pm

B Option

Post by eggsy84 » Sun Mar 19, 2006 1:05 pm

Yeah definately think its option B as it asks me to convert each time!!

Will check that

Thanks for the reply
Thanks all

Eggsy

daesdemon
Earned a small fee
Earned a small fee
Posts: 11
Joined: Tue Aug 02, 2005 4:40 pm

Post by daesdemon » Sun Mar 19, 2006 6:06 pm

Hi,

To cpp
Just a little post to say, that i didn't use all the steps you posted before and i was able to compile wxWidgets and minimal sample without any problems.
I only install the PSDK and do required file modifs, but didn't change anything in wxWidgets.
I used the wx.dsw , convert all and build.
Only thing is that i had to build multiple time cause of the dependencies, and dbgrid didn't compile as nibor explain before.

I only have problems with dll version and don't know why.
i get this:
minimal.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxFrame::sm_eventTable" ([email protected]@@[email protected]@B)
minimal.obj : error LNK2001: unresolved external symbol "class wxWindowList wxTopLevelWindows" ([email protected]@[email protected]@A)
minimal.obj : error LNK2001: unresolved external symbol "protected: static class wxAppConsole * wxAppConsole::ms_appInstance" ([email protected]@@[email protected])
minimal.obj : error LNK2001: unresolved external symbol "public: static unsigned int const wxStringBase::npos" ([email protected]@@2IB)
minimal.obj : error LNK2001: unresolved external symbol "char const * const wxStatusLineNameStr" ([email protected]@3PBDB)
minimal.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" ([email protected]@[email protected]@B)
minimal.obj : error LNK2001: unresolved external symbol "class wxSize const wxDefaultSize" ([email protected]@[email protected]@B)
minimal.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" ([email protected]@3PBDB)
minimal.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" ([email protected]@3PBDB)
minimal.obj : error LNK2001: unresolved external symbol "int const wxEVT_NULL" ([email protected]@3HB)
minimal.obj : error LNK2001: unresolved external symbol "int const wxEVT_COMMAND_MENU_SELECTED" ([email protected]@3HB)
minimal.obj : error LNK2001: unresolved external symbol "protected: static class wxAppConsole * (__cdecl* wxAppConsole::ms_appInitFn)(void)" ([email protected]@@[email protected])
Would someone have an idea about that?
What is the difference between wx.dsw and dx_dll.dsw because there is DLL release and debug in both.
Isn't that redondant ?
Some are born to endless nights.
Some are born to sweet delights

daesdemon
Earned a small fee
Earned a small fee
Posts: 11
Joined: Tue Aug 02, 2005 4:40 pm

Post by daesdemon » Sun Mar 19, 2006 6:48 pm

Ho forget about my precedent question about dll.
I only forget to define preprocessor: WXUSINGDLL
That works now ;).

So to get back from the beginning, to be able to compile minimal sample with VSExpress2005

Install VSExpress and PSDK as specified in cpp post before
Convert all wx proj
Remove the odbc dependency of db grid as nibor says before.
Build solution many times while there are some projects in error.
You now have a wxWidget libs compiled in any configuration you want.
Copy minimal proj from samples dir outside wxwidgets
modify the relative paths to what they should be.

PS: If you want to compile from dll version you need to have the prepocessor definition WXUSINGDLL

That was what worked for me.
Quite easy ;)
Some are born to endless nights.
Some are born to sweet delights

cpp
I live to help wx-kind
I live to help wx-kind
Posts: 195
Joined: Wed Sep 28, 2005 9:42 pm

Post by cpp » Wed Apr 05, 2006 1:12 am

Hi! i updated the HOWTO:
-- added instructions for wxWidgets 2.6.3
-- added the aditional steps needed to compile as DLL (thanks nibor)
-- added a "sugestion" to link statically to the VC runtime i suggest you follow it!

if anyone finds any inaccurate info on the howto, please reply here and i will "fix it" :D

To the forum admins:
maybe consider making this thread a "sticky" (again) ?
Hier Kommt die Sonne...

phoenixatyork
Earned a small fee
Earned a small fee
Posts: 10
Joined: Mon Jun 12, 2006 7:46 pm
Location: University of York UK

VC++ Express with SDK, just a small problem

Post by phoenixatyork » Tue Jun 13, 2006 11:36 pm

I have installed the SDK and wxwidgets, though i receive this error message:
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(345) : see declaration of 'sprintf'
Message: 'This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
..\..\src\tiff\tif_getimage.c(337) : warning C4996: 'sprintf' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(345) : see declaration of 'sprintf'

I think it has to do with the _CRT_SECURE DEPRECATE you mentioned above...

However i have tried to open the file in the root C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults
called corewin_express, however i do not understand what i should be opening it in and how i should change it?

Any ideas?

TIm
TMO

cpp
I live to help wx-kind
I live to help wx-kind
Posts: 195
Joined: Wed Sep 28, 2005 9:42 pm

Post by cpp » Wed Jun 14, 2006 1:35 am

to edit that file, you can open it with visual studio itself, or notepad (any text editor will do).
once you open it, delete all its contents, and copy/paste the xml code from step 3 of the HOWTO, save the file, and restart VC.

Please note that this will save you from getting those warnings in you projects, but you might still get the warnings compiling wxWidgets itself, unless you also define both CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE when you compile the wxWidgets library, (how to do this is explained in the HOWTO - step 7).

HTH
Hier Kommt die Sonne...

Post Reply