Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I think I really need help right now.

I downloaded the wxWidget windows installer and build it with Visual Studio. Everything went fine (except for the fact that I waited 1 hour waiting for MSVC building it). Now I created a small project with these source:

MainEdit.h
#pragma once
class MyProjectApp :
	public wxApp
{
public:
	MyProjectApp();
	virtual ~MyProjectApp();
	virtual bool OnInit() override;
};

CodeEdit.cpp
#include <C:\wxWidgets-3.1.1\include\wx\wxprec.h>
#include "MainEdit.h"

#ifdef _DEBUG
#pragma comment(lib, "wxbase31ud.lib")
#else
#pragma comment(lib, "wxbase31u.lib")
#endif
MyProjectApp::MyProjectApp()
{
}

MyProjectApp::~MyProjectApp()
{
}

bool MyProjectApp::OnInit()
{
	wxFrame* mainFrame = new wxFrame(nullptr, wxID_ANY, L"MyProject");
	mainFrame->Show(true);
	return true;
}

wxIMPLEMENT_APP(MyProjectApp);


I Created a new Path in Environment Variables named WXWIN and put this on the path "C:\wxWidgets-3.1.1". I edited the Include Directories in MSVC to this "
$(WXWIN)\include;$(WXWIN)\wx;$(WXWIN)\include\msvc;$(WXWIN)\;$(IncludePath)

Then the Library Directories to this:
$(WXWIN)\lib\vc_x64_lib;$(LibraryPath)


Now This is giving me headache: (Here comes the errors)
Error	C1083	Cannot open include file: 'wx/defs.h': No such file or directory	CoolEdit	C:\wxWidgets-3.1.1\include\wx\wxprec.h	12	

Error (active)	E0035	#error directive: "wxUSE_CONSOLE_EVENTLOOP must be defined, please read comment near the top of this file."	CoolEdit	c:\WxWidget-3.1.1_bin\include\wx\chkconf.h	104	

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E1696	cannot open source file "../../../lib/vc_lib/msw/wx/setup.h"	CoolEdit	c:\WxWidget-3.1.1_bin\include\msvc\wx\setup.h	123	

Error (active)	E0035	#error directive: "wxUSE_ACTIVEX must be defined."	CoolEdit	c:\WxWidget-3.1.1_bin\include\wx\msw\chkconf.h	19	


I have 50 errors all.

I'll be back, guess I need to find something for this headache

What I have tried:

I have tried changing + adding the Include/Library directories but still has errors
Posted
Updated 9-Apr-18 21:21pm

1 solution

Avoid using absolute paths when including files. Because you have added the paths to the Include Directories just use the plain header file name:
#include <wxprec.h>
If that does not work use (I have not used wxWidgets with VS so far):
#include <wx\wxprec.h>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900