View Full Version: wtf

C++ Learning Community > win32 api C++ programming > wtf


Title: wtf
Description: strange errors


Gmakermaniac!!! - April 8, 2005 11:13 PM (GMT)
CODE
////////////////////////////////////////////////////////////////////////////////
// main.cpp                                                                   //
//                                                                            //
// ties all files togethor & contains program entry-point                     //
////////////////////////////////////////////////////////////////////////////////

#include "wx/wx.h"      // wxWindows header file

// class TextEditorApp
// ~ app class for text editor applicarion
class TextEditorApp : public wxApp
{
virtual bool OnInit();
};

// class MainWindow
// ~ the program's parent window
class MainWindow : public wxFrame
{
MainWindow(const wxString & title, const wxPoint & pos, const wxSize & size);

void EventClose(wxCommandEvent & event);

DECLARE_EVENT_TABLE()
};

// enum
// ~ command identifiers
enum
{
ID_EXIT = 1,
};

// define the event table
BEGIN_EVENT_TABLE(MainWindow, wxFrame)
EVT_MENU(ID_EXIT, MainWindow::EventClose)
END_EVENT_TABLE()

// dynamically construct TextEditorApp
IMPLEMENT_APP(TextEditorApp)

// TextEditorApp::OnInit
// ~ handle initialization, create window, ect
bool TextEditorApp::OnInit()
{
wxMessageBox("hello", "", wxOK, NULL, -1, -1);

return true;
}

// MainWindow::MainWindow
// ~ MainWindow's constructor
MainWindow::MainWindow(const wxString & title, const wxPoint & pos, const wxSize & size)
:wxFrame((wxFrame*)NULL, -1, title, pos, size)
{
wxMenu * MenuFile = new wxMenu;
MenuFile->Append(ID_EXIT, "E&xit");

wxMenuBar * MenuBar = new wxMenuBar;
MenuBar->Append(MenuFile, "&File");
SetMenuBar(MenuBar);
}

// MainWindow::EventClose
// ~ close the window
void MainWindow::EventClose(wxCommandEvent & WXUNUSED(event))
{
Close(true);
}


QUOTE
Deleting intermediate files and output files for project 'textedit - Debug'
--------------------Configuration: textedit - Debug--------------------
Compiling source file(s)...
main.cpp
In file included from C:\MinGWStudio\Include\wx\wx.h:15,
from main.cpp:7:
C:\MinGWStudio\Include\wx\defs.h:179: error: redeclaration of C++ built-in type
`bool'
In file included from C:\MinGWStudio\Include\wx\memory.h:20,
from C:\MinGWStudio\Include\wx\object.h:25,
from C:\MinGWStudio\Include\wx\wx.h:16,
from main.cpp:7:
C:\MinGWStudio\Include\wx\string.h:160:4: #error "Please define string case-insensitive compare for your OS\compiler"
In file included from C:\MinGWStudio\Include\wx\memory.h:20,
from C:\MinGWStudio\Include\wx\object.h:25,
from C:\MinGWStudio\Include\wx\wx.h:16,
from main.cpp:7:
C:\MinGWStudio\Include\wx\string.h: In function `int Stricmp(const char*, const
char*)':
C:\MinGWStudio\Include\wx\string.h:162: warning: no return statement in
function returning non-void

textedit.exe - 2 error(s), 1 warning(s)

Nintendofreak88 - April 8, 2005 11:41 PM (GMT)
Well maybe make sure you're using the latest version of wxWindows. I use Dev-Cpp 4.9.9.2 and wxWindows 2.4.2 and it compiles no errors, no warnings... (I used the -Wall flag too...)

Gmakermaniac!!! - April 9, 2005 02:28 AM (GMT)
I am using the version that came with MinGW Studio, one of my previos projects has already compiled.... mabey I did a win32 project and put in wx code. that may be it =|

edit: it seems very likely, I just searched through the compiler options and nothing at all gave a hint of wxWidgets -_-

edit2:
QUOTE
--------------------Configuration: textedit - Debug--------------------
Compiling source file(s)...
main.cpp
Linking...

textedit.exe - 0 error(s), 0 warning(s)
that was it




* Hosted for free by InvisionFree