wx: permission denied



  • Hallo!
    Ich bekomme folgendes wxWidgets-HelloWorld nicht zum Laufen:

    basic.h:

    #ifndef BASIC_H
    #define BASIC_H
    
    class HalloWeltApp : public wxApp {
        public:
            virtual bool OnInit();
    };
    
    class BasicFrame : public wxFrame {
        public:
            BasicFrame(const wxChar *title, int xpos, int ypos, int width, int height);
            ~BasicFrame();
    };
    
    #endif
    

    basic.cpp

    #include <wx/wx.h>
    #include "basic.h"
    
    IMPLEMENT_APP(HalloWeltApp)
    
    bool HalloWeltApp::OnInit() {
        BasicFrame *frame = new BasicFrame(wxT("Hallo, Welt!"), 50, 50, 450, 300);
        frame->Show(TRUE);
        SetTopWindow(frame);
        return TRUE;
    }
    
    BasicFrame::BasicFrame(const wxChar *title, int xpos, int ypos, int width, int height)
    : wxFrame( (wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)) { }
    
    BasicFrame::~BasicFrame() { }
    

    Ich benutzte wxDev-C++, keine Fehlermeldung, im Compiler-Log steht jedoch:

    Compiler: Default compiler
    Building Makefile: "C:\Dokumente und Einstellungen\Ad aCTa\Desktop\C++\wxWidgets\Makefile.win"
    Führt  make clean aus
    rm -f base.obj  wxHelloWorld.exe
    
    rm: wxHelloWorld.exe: Permission denied
    
    make.exe: *** [clean] Error 1
    
    Ausführung beendet
    

    Kein Fenster, nur ein Windows-Prozess erscheint. Was stimmt an dem Programm nicht?



  • Das Problem liegt an Dev-Cpp. Es ist veraltet und verbuggt.
    Ich empfehle dir, eine andere IDE zu nutzen. Code::Blocks zum Beispiel.

    Zu deinem Problem: Er kann die Datei "wxHelloWorld.exe" aus irgendeinem Grund nicht löschen, mehr nicht.



  • Okay, dann mach ich's mit Visual Studio, nur irgendwie bekomm ich's net hin. Ich habe die MSW-Version von wxWidgets runtergeladen, den build kompiliert, in den Include/Verweis-Daten die Pfade eingestellt und zu den Projekten ein paar libs zugeführt. Fehler:

    Fehler	3	error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall wxAppConsole::OnAssert(char const *,int,char const *,char const *)" (?OnAssert@wxAppConsole@@UAEXPBDH00@Z)".	minimal.obj
    Fehler	2	error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall wxAppConsole::OnAssertFailure(char const *,int,char const *,char const *,char const *)" (?OnAssertFailure@wxAppConsole@@UAEXPBDH000@Z)".	minimal.obj
    Fehler	4	error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl wxOnAssert(char const *,int,char const *,char const *,char const *)" (?wxOnAssert@@YAXPBDH000@Z)" in Funktion ""public: __thiscall wxStringBase::wxStringBase(class wxStringBase const &)" (??0wxStringBase@@QAE@ABV0@@Z)".	minimal.obj
    Fehler	5	fatal error LNK1120: 3 nicht aufgelöste externe Verweise.	vc_mswd\minimal.exe
    [b]Warnung	1	warning LNK4098: Standardbibliothek "MSVCRT" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.	minimal[/b]
    

    Ich denke mal, das allerletzte ist die Ursache. Wie behebe ich diesen Konflikt?


Anmelden zum Antworten