Dear my friends of Qt-Community.
I'm stucked on this error-message as I am building 2 windows (1 as parent-window and 1 as child-window) and MenuBar (with QMenuBar and QMenu). The error-message as compiling-process is here:
"
ceo@sally:/mnt/slax/fileserver-slax/arsip/SoftDev/ERPLinux$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt/mkspecs/linux-g++ -I. -I/usr/lib64/qt/include/QtCore -I/usr/lib64/qt/include/QtGui -I/usr/lib64/qt/include -I. -I. -o ERPLinux.o ERPLinux.cpp
In file included from ERPLinux.cpp:1:0:
ERPLinux.h:15:14: Fehler: ISO-C++ verbietet Deklaration von »bikinmenupos« ohne Typ [-fpermissive]
bikinmenupos(){
^
ERPLinux.h: In Funktion »int bikinmenupos()«:
ERPLinux.h:18:3: Fehler: »berkaspos« wurde in diesem Gültigkeitsbereich nicht definiert
berkaspos = menupos->addMenu("&POS");
^
ERPLinux.h:16:13: Warnung: Variable »menuutama« wird nicht verwendet [-Wunused-variable]
QMenuBar *menuutama = new QMenuBar();
^
ERPLinux.h:19:1: Warnung: keine return-Anweisung in nicht void zurückgebender Funktion [-Wreturn-type]
}
^
ERPLinux.cpp: In Funktion »int main(int, char**)«:
ERPLinux.cpp:8:11: Fehler: expected unqualified-id before »->« token
ERPLinux->bikinmenupos();
^
Makefile:214: die Regel für Ziel „ERPLinux.o“ scheiterte
make: *** [ERPLinux.o] Fehler 1
ceo@sally:/mnt/slax/fileserver-slax/arsip/SoftDev/ERPLinux$
".
"Fehler: ISO-C++ verbietet Deklaration von »bikinmenupos« ohne Typ [-fpermissive]" means -> "Error: ISO-C++ declared from »bikinmenupos« without Type [-fpermissive]".
"Fehler: »berkaspos« wurde in diesem Gültigkeitsbereich nicht definiert" means -> "Error: »berkaspos« defined not in corrent region/position.
These are my simple-sourcecode (4-files):
-------------------------
1. file of ERPLinux.h
#include <QApplication>
#include <QWidget>
#include <QMenuBar>
#include <QMenu>
class QAction;
class ERPLinux : public QWidget{
Q_OBJECT
public:
private:
};
bikinmenupos(){
QMenuBar *menuutama = new QMenuBar();
QMenu *menupos = new QMenu();
berkaspos = menupos->addMenu("&POS");
}
2. file of ERPLinux.cpp
#include "ERPLinux.h"
#include "POS.h"
int main(int argc, char *argv[]){
QApplication *aplikasi = new QApplication(argc, argv);
QWidget *jendelautama = new QWidget();
jendelautama->setWindowTitle("ERP for Windows, Linux and Android by ELEKTRO.asia");
ERPLinux->bikinmenupos();
jendelautama->show();
POS *layarpos = new POS();
layarpos->show();
aplikasi->exec();
}
3. file of POS.h
#include <QWidget>
class QAction;
class POS : public QWidget{
public:
};
4. file of POS.cpp
#include "POS.h"
int main(int argc, *char argv[]){
}
-----------------------------------
Would anyone please help me to show where my mistakes I've done?
Thank you very much in advance.
Bookmarks