Page 1 of 2

FAQ for IDE related issues v2

Posted: Thu Oct 07, 2004 5:08 pm
by Jorg
"Cannot open include file: "wx/setup.h"... "
  • This error is very common amongst people new to wxWidgets, using VS6 or VS7 or anything else on Windows. On the Linux platform this will be not present due to the configure command. To solve this, simply copy the file setup.h from /lib/msw (or /lib/mswd) to /include/wx.

Posted: Tue Jan 18, 2005 3:44 pm
by Jorg
How to setup MS VISUAL STUDIO .NET 2003

OK, I'll try to explain installation, configuration and testing step by step... (windows XP)

INSTALLATION

1. Download wxMSW-2.5.3.zip
2. Unpack it
3. Open wxWidgets-2.5.3\src\wxWindows.dsw (I use VS.NET 2003)
4. In Solution explorer select wxWindows project
5. Go to "Properties -> C/C++ -> Code Generation -> Runtime Library"
6. Change "Multi-threaded Debug DLL (/MDd)" to "Multi-threaded Debug (/MTd)" for Debug configuration
7. Change "Multi-threaded DLL (/MD)" to "Multi-threaded (/MT)" for Release configuration
8. Press OK
9. Do 5-8 for "expat", "jpeg", "png", "regex", "tiff", "zlib" project of the workspace (see * below for alternate solution without Multitrhreaded Debug setting)
10. Select "Build -> Build Solution" :)
11. Change current configuration from Debug to Release
12. Select "Build -> Build Solution" :))))
13. Close the workspace
14. Copy wxWidgets-2.5.3\include\wx\msw\setup.h to wxWidgets-2.5.3\include\wx\setup.h

MINIMAL CODE

1. Create new empty Win32 project (MinTest)
2. Create new CPP file (Solution Explorer -> Source Files -> Add new item)

Code: Select all

	#include <wx/wx.h>

	class MyApp : public wxApp
	{
	public:
		virtual bool OnInit();
	};

	IMPLEMENT_APP(MyApp)

	bool MyApp::OnInit()
	{
		wxFrame * frame = new wxFrame(NULL, -1, "Test");
		wxMenu * menu = new wxMenu;
		menu->Append(wxID_EXIT, "Close\tAlt+F4");
		wxMenuBar * menubar = new wxMenuBar();
		menubar->Append(menu,"File");
		frame->SetMenuBar(menubar);
		frame->Show();
		SetTopWindow(frame);
		return true;
	}
3. Go to "Properties -> C/C++ -> Code Generation -> Runtime Library"
4. Change "Multi-threaded Debug DLL (/MDd)" to "Multi-threaded Debug (/MTd)" for Debug configuration
5. Change "Multi-threaded DLL (/MD)" to "Multi-threaded (/MT)" for Release configuration
6. Add "wxmswd.lib comctl32.lib uuid.lib rpcrt4.lib" to "Properties -> Linker -> Input -> Additional Dependencies" for Debug configuration
7. Add "wxmsw.lib comctl32.lib uuid.lib rpcrt4.lib" to "Properties -> Linker -> Input -> Additional Dependencies" for Release configuration
8. Build the project (Debug and Release)

TESTING

1. Install Windows 98 under VMWare workstation (CUSTOM INSTALLATION, NO COMPONENTS SELECTED. IT IS AN EMPTY SYSTEM)
2. Add Physical drive to the Virtual Machine devices
3. Start Virtual Machine
4. Start the application 'MinTest\Debug\MinTest.exe' (2 162 688 bytes)[IT WORKS]
5. Start the application 'MinTest\Release\MinTest.exe' (770 048 bytes) [IT WORKS]

(*) Addition for the die hard VS7 fans:

You can perform a Batch build as well. Select Build | Batch Build and sort the order on solution type, e.g. so that Debug and Release are neatly sorted. Now check all projects you like to build, and press [Rebuild All]

Re: FAQ for IDE related issues v2

Posted: Mon Oct 10, 2005 12:36 am
by daddydave
Jorg wrote:"Cannot open include file: "wx/setup.h"... "
  • To solve this, simply copy the file setup.h from /lib/msw (or /lib/mswd) to /include/wx.
The path Jorg said to copy setup.h from may vary. If using MSVC, you'll probably find setup.h in lib\vc_lib\msw\wx (release) or lib\vc_lib\mswd\wx (debug)

Posted: Thu Dec 08, 2005 4:37 am
by Ryan Norton
How to setup MS VISUAL STUDIO EXPRESS/2005

Read

http://xurble.org/weblog/2004/10/using- ... press.html

unresolved external symbol _main

Posted: Sat Jun 24, 2006 8:25 am
by rssmps
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup


if you get this and you're app is using/building GUI, it's likly you're using console rather than window.

project|properties|Linker||System|SubSystem: change console to windows.

Posted: Mon Jun 26, 2006 9:58 pm
by rssmps
Should this be part of the FAQ?

src\wxWindows.dsw vs. build\msw\wx.dsw
http://forums.wxwidgets.org/viewtopic.p ... indows+dsw

Posted: Thu Jun 29, 2006 5:38 pm
by rssmps
One tip on running the samples. I found that the the sample solutions willl compile certain lib files depending on what is attached.

So the impact is that if you built the library first and then ran the samples, your orig lib settings will be overwritten with the settings in the sample.

KDevelop and wxWidgets macros (remove c++ parser errors)

Posted: Fri Aug 10, 2007 8:52 pm
by huehnerschrecker
If you prefer to use KDevelop and don't want the c++ parser to mark the wxWidgets macros as an error (or the parser complains about a missing semicolon ) simply add them to the predefined headers.
Goto Settings->Configure KDevelop. Scroll down to C++ Parsing and insert the wxWidgets (or your own) macro definition into the "Special Headers" box, eg:

Code: Select all

#define DECLARE_EVENT_TABLE() 
#define BEGIN_EVENT_TABLE(theClass, baseClass) 
#define END_EVENT_TABLE()
If you are unsure about the correct macro definition to use, take a look at the corresponding header file, wx/event.h for example and use the definition as listed there.
If the parser is still complaining afterwards, change the file a little (insert a character and delete it afterwards), save the file and thus force the parser to parse again. The warning should be away now. Good luck

Posted: Thu Apr 17, 2008 10:52 pm
by ONEEYEMAN
huehnerschrecker,
According to the KDevelop team, this will not required for KDevelop 4.

Thank you.

Re: FAQ for IDE related issues v2

Posted: Wed Sep 16, 2009 10:49 pm
by Edgar
Jorg wrote:"Cannot open include file: "wx/setup.h"... "
  • This error is very common amongst people new to wxWidgets, using VS6 or VS7 or anything else on Windows. On the Linux platform this will be not present due to the configure command. To solve this, simply copy the file setup.h from /lib/msw (or /lib/mswd) to /include/wx.
Compiling wxWidgets 2.8.10 with Visual Studio 2010
In 2 header files (platform.h & gsockmsw.h) I have had to make the following changes:
//#include "wx/setup.h"
#include "wx/msw/setup.h"
because setup.h does not exist in the originally named directory.

Obviously, given that Jorg's original post was dated October 2004 and is the very 1st item in the FAQ, why hasn't this been repaired in the distribution source?

Re: FAQ for IDE related issues v2

Posted: Wed Sep 16, 2009 10:57 pm
by Auria
Edgar wrote:
Obviously, given that Jorg's original post was dated October 2004 and is the very 1st item in the FAQ, why hasn't this been repaired in the distribution source?
I'm not very familiar with Windows; but I'm pretty sure nothing needs to be 'repaired' because it's not a bug. I think setup.h is put there as part of the normal installation process (how it's done is unknown to me though)

Re: FAQ for IDE related issues v2

Posted: Wed Sep 16, 2009 11:30 pm
by Edgar
Auria wrote: I'm not very familiar with Windows; but I'm pretty sure nothing needs to be 'repaired' because it's not a bug. I think setup.h is put there as part of the normal installation process (how it's done is unknown to me though)
It depends on your definition of "bug"! If the developers provide a solution for the Microsoft Visual Studio users and every single user must make an edit to the source code before the solution will compile (and it's been that way for at least 6 years) I would call that at best an annoyance and at worst a bug. I realize that this is a very complicated cross-platform project and that for users of UNIX this problem does not crop up. Still, I think that a solution can be found for Windows users which would not cause problems for other platforms.

Posted: Wed Jul 14, 2010 2:17 pm
by blaroche
I have the same problem. I cannot compile even the Hello World sample because wx/setup.h is missing. Jorg's post assumes that setup.h is in /lib/msw, but I don't even have such a folder. It also seems like it's the case for other users.

I looked at dozens of websites that explain how to use wxWidgets, but none has worked for me.

Is there a standard simple way to run wxWidgets applications on Windows?

Posted: Wed Jul 14, 2010 4:33 pm
by Auria
blaroche wrote:I have the same problem. I cannot compile even the Hello World sample because wx/setup.h is missing. Jorg's post assumes that setup.h is in /lib/msw, but I don't even have such a folder. It also seems like it's the case for other users.

I looked at dozens of websites that explain how to use wxWidgets, but none has worked for me.

Is there a standard simple way to run wxWidgets applications on Windows?
Mingw or VC++?
If Mingw, use mignw32-make from terminal - always worked for me.
If VC++, open the VC projects and build - worked for me too I think (though I only tried once some time ago)

Posted: Thu Jul 15, 2010 6:58 am
by blaroche
I installed CodeBlocks, which came with mingw32-make.

I tried the following:

Code: Select all

C:\wxWidgets-2.8.11\build\msw>"C:\Program Files (x86)\CodeBlocks\MinGW\bin\mingw32-make" -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean
and got this:

Code: Select all

if exist gcc_mswudll\*.o del gcc_mswudll\*.o
process_begin: CreateProcess(NULL, -c "if exist gcc_mswudll\*.o del gcc_mswudll\*.o", ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: [clean] Error 2 (ignored)
and this went on for about 300 lines.