Discussion:
Visual Studio 2013 and wxWidgets-3.0.0
Incongruous
2014-06-15 19:15:37 UTC
Permalink
Installation:
~~~~~~~~~
D:\wxWidgets-3.0.0

Compiler/Settings
~~~~~~~~~~~~~~
Visual Studio 2013
Alt-F7->Configuration Properties -> C/C++ -> General -> Additional Include Directories: D:\wxWidgets-3.0.0\include;D:\wxWidgets-3.0.0\include\msvc


After installing [using the installer] and compiling wxWidgets-3.0.0 as a 64-bit library [solution = D:\wxWidgets-3.0.0\build\msw\wx_vc10.sln], I created a Console Application.
int main(){
std::cout << "Hello" << std::endl;
std::cin.get( );
return 0;
}
The application ran well until I changed the 'stdafx.h' to look like this:
#pragma once
#include "targetver.h"
#include <iostream>
/////////// ************** ///////////
// TODO: reference additional headers your program requires here
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
/////////// ************** ///////////


But this modification gave me this error:
1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
1> stdafx.cpp
1>D:\wxWidgets-3.0.0\include\wx/wxcrt.h(209): error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\string.h(112) : see declaration of 'strcpy'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Again I modified the ‘stdafx.h’ to look like this:
#pragma once
// wxWidgetApplication.cpp : Defines the entry point for the console application.
#pragma warning( disable : 4996 ) // This removes the warning
#include "targetver.h"

// TODO: reference additional headers your program requires here
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS // double wammy
#endif
#include <iostream>
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

But that gave me this other error:
1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
1> stdafx.cpp
1> wxWidgetApplication.cpp
1>LINK : fatal error LNK1104: cannot open file 'wxbase30ud.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


To fix that error I did this:
Alt-F7->Configuration Properties –> Linker –> General –> Additional Library Directories: D:\wxWidgets-3.0.0\lib\vc_x64_lib; D:\wxWidgets-3.0.0\lib\vc_lib

And now my program compiled.
In the future I will post more solutions as they come along.
Thanks Igor for the help, you’re the best man!
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Igor Korot
2014-06-15 19:55:08 UTC
Permalink
Hi,
Post by Incongruous
~~~~~~~~~
D:\wxWidgets-3.0.0
Compiler/Settings
~~~~~~~~~~~~~~
Visual Studio 2013
Alt-F7->Configuration Properties -> C/C++ -> General -> Additional Include
Directories: D:\wxWidgets-3.0.0\include;D:\wxWidgets-3.0.0\include\msvc
After installing [using the installer] and compiling wxWidgets-3.0.0 as a
64-bit library [solution = D:\wxWidgets-3.0.0\build\msw\wx_vc10.sln], I
created a Console Application.
int main(){
std::cout << "Hello" << std::endl;
std::cin.get( );
return 0;
}
#pragma once
#include "targetver.h"
#include <iostream>
/////////// ************** ///////////
// TODO: reference additional headers your program requires here
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
/////////// ************** ///////////
1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
1> stdafx.cpp
1>D:\wxWidgets-3.0.0\include\wx/wxcrt.h(209): error C4996: 'strcpy': This
function or variable may be unsafe. Consider using strcpy_s instead. To
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for
details.
1> C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#pragma once
// wxWidgetApplication.cpp : Defines the entry point for the console application.
#pragma warning( disable : 4996 ) // This removes the warning
#include "targetver.h"
// TODO: reference additional headers your program requires here
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS // double wammy
#endif
#include <iostream>
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
1> stdafx.cpp
1> wxWidgetApplication.cpp
1>LINK : fatal error LNK1104: cannot open file 'wxbase30ud.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Alt-F7->Configuration Properties –> Linker –> General –> Additional Library
Directories: D:\wxWidgets-3.0.0\lib\vc_x64_lib;
D:\wxWidgets-3.0.0\lib\vc_lib
And now my program compiled.
In the future I will post more solutions as they come along.
Thanks Igor for the help, you’re the best man!
Why do you do all this?
Please look at the D:\wxWidgets- 3.0.0\samples\console folder. There
you will find
an appropriate MSVC 2010 solution which you will have to convert on opening.

Then just compile, run and enjoy.

Also, you will find a lot more samples in the
D:\wxWidgets-3.0.0\samples directory...

Thank you.
Post by Incongruous
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Incongruous
2014-06-20 18:08:42 UTC
Permalink
As you know, VSE2013 does not have a template for wxWidgets like it does for
CRT or Win32, etc. So, I have to document all the necessary steps to the
creation of an wxWidgets application.
I know that using Code::Blocks for developing wxWidgets would make things
much simpler, but for now I am stocked with VSE2013 and/or NetBeans.
I am not much of a MS user, I have used NetBeans and Code::Blocks before,
under Windows and Linux, but VSE2013 is a bit intrinsic. It has a lot of
corner and turns that at the end you end up lost and wishing never having
opened the door that led you here. Well, it is a learning process.
However, I have been able to run the wxWidgets samples, so...
wxWidgets-3.0.0 has been installed correctly.
Thanks Igor for your help, it is always sooo right on the dot!

-----Original Message-----
From: Igor Korot
Sent: Sunday, June 15, 2014 3:55 PM
To: wx-***@googlegroups.com
Subject: Re: Visual Studio 2013 and wxWidgets-3.0.0

Hi,
Post by Incongruous
~~~~~~~~~
D:\wxWidgets-3.0.0
Compiler/Settings
~~~~~~~~~~~~~~
Visual Studio 2013
Alt-F7->Configuration Properties -> C/C++ -> General -> Additional Include
Directories: D:\wxWidgets-3.0.0\include;D:\wxWidgets-3.0.0\include\msvc
After installing [using the installer] and compiling wxWidgets-3.0.0 as a
64-bit library [solution = D:\wxWidgets-3.0.0\build\msw\wx_vc10.sln], I
created a Console Application.
int main(){
std::cout << "Hello" << std::endl;
std::cin.get( );
return 0;
}
#pragma once
#include "targetver.h"
#include <iostream>
/////////// ************** ///////////
// TODO: reference additional headers your program requires here
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
/////////// ************** ///////////
1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
1> stdafx.cpp
1>D:\wxWidgets-3.0.0\include\wx/wxcrt.h(209): error C4996: 'strcpy': This
function or variable may be unsafe. Consider using strcpy_s instead. To
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for
details.
1> C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#pragma once
// wxWidgetApplication.cpp : Defines the entry point for the console application.
#pragma warning( disable : 4996 ) // This removes the warning
#include "targetver.h"
// TODO: reference additional headers your program requires here
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS // double wammy
#endif
#include <iostream>
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
1> stdafx.cpp
1> wxWidgetApplication.cpp
1>LINK : fatal error LNK1104: cannot open file 'wxbase30ud.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Alt-F7->Configuration Properties –> Linker –> General –> Additional
Library
Directories: D:\wxWidgets-3.0.0\lib\vc_x64_lib;
D:\wxWidgets-3.0.0\lib\vc_lib
And now my program compiled.
In the future I will post more solutions as they come along.
Thanks Igor for the help, you’re the best man!
Why do you do all this?
Please look at the D:\wxWidgets- 3.0.0\samples\console folder. There
you will find
an appropriate MSVC 2010 solution which you will have to convert on opening.

Then just compile, run and enjoy.

Also, you will find a lot more samples in the
D:\wxWidgets-3.0.0\samples directory...

Thank you.
Post by Incongruous
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-06-15 21:14:45 UTC
Permalink
On Sun, 15 Jun 2014 15:15:37 -0400 Incongruous wrote:

I> Compiler/Settings
I> ~~~~~~~~~~~~~~
I> Visual Studio 2013
I> Alt-F7->Configuration Properties -> C/C++ -> General -> Additional
I> Include Directories:
I> D:\wxWidgets-3.0.0\include;D:\wxWidgets-3.0.0\include\msvc

This is not enough. See the (end of) docs/msw/install.txt for the required
compilation options.

I> But this modification gave me this error:
I> 1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
I> 1> stdafx.cpp
I> 1>D:\wxWidgets-3.0.0\include\wx/wxcrt.h(209): error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

It's strange that this gives you an error and not a warning. It's even
stranger that this warning hadn't been avoided by defining
_CRT_SECURE_NO_DEPRECATE in wx/defs.h.

I> But that gave me this other error:
I> 1>------ Build started: Project: wxWidgetApplication, Configuration: Debug x64 ------
I> 1> stdafx.cpp
I> 1> wxWidgetApplication.cpp
I> 1>LINK : fatal error LNK1104: cannot open file 'wxbase30ud.lib'
I> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I>
I>
I> To fix that error I did this:
I> Alt-F7->Configuration Properties –> Linker –> General –> Additional
I> Library Directories: D:\wxWidgets-3.0.0\lib\vc_x64_lib;
I> D:\wxWidgets-3.0.0\lib\vc_lib

Yes, again, this is mentioned in the instructions. It is also kind of not
completely unexpected -- if you don't tell the linker where the libraries
are, it doesn't risk finding them.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Loading...