Fehler beim Compilieren II

Previous topic - Next topic

D2O

Hi, wollte den Thread hier,http://www.glbasic.com/forum/viewtopic.php?id=414, nicht missbrauchen
daher ein neuer.

Habe hier beim code testen diese Fehlermeldung bekommen, bzw. einmal gehts einmal nicht.

Ok.
 Wenn ich im folgendem Code die Function vor der Hauptschleife schreib gibts ne fehlermeldung und makiert wird
die "Print" zeile.

Quote_______________________________________
*** Configuration: WIN32 ***
precompiling...

GPC - GLBasic Precompiler V.2007.050 - 3D, NET
compiling...
test.gbas (561 B )
"test.gbas"(28) error : command not inside function or sub
Steht die function nach der schleife, gehts.
Code (glbasic) Select
GLOBAL loadimagecounter
loadimagecounter = 0
FUNCTION f_loadimage:

LOADSPRITE l_path,loadimagecounter
INC loadimagecounter,1

RETURN loadimagecounter -1
ENDFUNCTION
//
//


WHILE TRUE
PRINT "Hallo",10,10
SHOWSCREEN
WEND
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

D2O

Hmmm, nächste Fehlermeldung.

Quote_______________________________________
*** Configuration: WIN32 ***
precompiling...

GPC - GLBasic Precompiler V.2007.050 - 3D, NET
compiling...
tileengine.gbas (3 KB)
..\CodeTemplate\keyhit.gbas (1 KB)
..\CodeTemplate\screenshot.gbas (877 B )
..\CodeTemplate\fps.gbas (383 B )
..\CodeTemplate\Keycode.gbas (5 KB)
..\CodeTemplate\floadimage.gbas (400 B )
"..\CodeTemplate\floadimage.gbas"(13) warning : probably unassigned variable : l_path
Wordcount:133 commands

compiling:
D:/temp/glbasic/gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
D:/temp/glbasic/gpc_temp0.cpp:40: error: invalid initialization of reference of type '__GLBASIC__::DGStr&' from expression of type 'DGInt'
C:/Basic/GLBasic/Compiler/platform/Include/glb.h:461: error: in passing argument 2 of `void __GLBASIC__::READLINE(DGInt, __GLBASIC__::DGStr&)'
D:/temp/glbasic/gpc_temp0.cpp:41: error: invalid initialization of reference of type '__GLBASIC__::DGStr&' from expression of type 'DGInt'
C:/Basic/GLBasic/Compiler/platform/Include/glb.h:461: error: in passing argument 2 of `void __GLBASIC__::READLINE(DGInt, __GLBASIC__::DGStr&)'
D:/temp/glbasic/gpc_temp5.cpp:8: error: expected constructor, destructor, or type conversion before '=' token
D:/temp/glbasic/gpc_temp5.cpp:8: error: expected `,' or `;' before '=' token

linking:
g++.exe: gpc_temp0.o: No such file or directory
g++.exe: gpc_temp5.o: No such file or directory
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren
_______________________________________
*** Fertig ***
Zeit: 1.8 sek
Erstellen: 0 erfolgreich, 1 fehlgeschlagen
Hier mal die Komplette Projekt datei.
http://www.deuteriumoxid.com/glbasic/tileengine.rar
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Kitty Hello

Also bei mir kommt:
"tileengine.gbas"(100) error : call to undefined function : updatefps
also - die Funktion fehlt.

Dann der Fehler:
error: invalid initialization of reference of type '__GLBASIC__::DGStr&' from expression of type 'DGInt'

Du hast geschrieben:
READLINE 1, mapx

Aber gerade bei READLINE habe ich vergessen, dass man auf Zahlen lesen kann (also geht derzeit nur: READLINE 1, data$) Ich besser das aus für's nächste Update.

Kosta

Quote from: GernotFrischAlso bei mir kommt:
"tileengine.gbas"(100) error : call to undefined function : updatefps
also - die Funktion fehlt.
hmm...das muss nicht unbedingt der HauptFehler sein, es wurden nicht alle Datein mitgeschickt (unter Quellen: ..\CodeTemplate\... usw).  ->  evtl. existiert da die besagte Funktion
Intel QuadCore, Geforce8600GT,512MB,4GB Ram, 26" TFT
HP nw8440 Schläppy
GP2X Mk2 (Firmware 3.0)

GLBASIC Blog:
http://www.glbasic.com/forum/index.php?blog=51.0

D2O

Sorry für die verspätung,

habe immer Akuten Zeitmangel :(
Da habe ich wohl die CodeTemplates vergessen.

Gleicher Link:

http://www.deuteriumoxid.com/glbasic/tileengine.rar
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

Kitty Hello

GLOBAL loadimagecounter = 10000 //Extra hohen wert gewählt falls auch

Hier flippt er aus. Muss ich ändern. Bitte bis dahin das "= 10000" löschen, und in einer Funktion beim Programmstart zuweisen.

D2O

Juhuuuu, Wochenende :)


Hi Gernot, jepp das geht.

Ich habe einfach mal hier einen hohen wert genommen, da es hier dan ziemlich unwahrscheinlich ist das sich die
Handle? zahlen überschneiden.

Was ich hier vieleicht auch noch sagen sollte,
das Array ,level[mapx][mapy][maplayer], habe einfach mal testweise die werte 10000,10000,1 gesetzt, nur mal um zu schauen wie lange es braucht
die Map zu laden/generieren.
Hier wird das Progamm kurz angezeigt und dann ist es weg, wird auch nichts im Taskmanager angezeigt.
Bei den werten 5000,5000 gibt ein "Keine Rückmeldung"
2000,2000 gehen Tadellos.

Ja ich weis das ist eigendlich ne Utopische Grösse :) , wollte es einfach mal Testen.
Vieleicht nützt Dir das was.

Ach noch was, den befehl Openfile. super :)
Dabei habe ich erst jetzt gesehen das man auch bytes schreiben und lesen kann, das war doch vorher nicht , oder?


Gruss vom Bodensee.
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

D2O

HI,
ich bin dem verzweifeln nahe :wah:

Egal was ich mache, alle eigenen Projekte die ich Laden enden in einem Error.


Zum Beispiel dieser Code den ich gepostet habe, http://www.glbasic.com/forum/viewtopic.php?id=710, in der letzten version.
Endet mit dieser Ausgabe:


Quote from: "GLB_IDE"_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.050 - 3D, NET
Wordcount:42 commands

compiling:
D:/temp/glbasic/gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
D:/temp/glbasic/gpc_temp0.cpp:17: error: no match for 'operator=' in '__GLBASIC__::player1.__GLBASIC__::Tloader::pic = __GLBASIC__::loadimage(__GLBASIC__::DGStr, DGInt, DGInt, DGInt)(3.2e+1, 3.2e+1, 1.8e+1)'
C:/Basic/GLBasic/Compiler/platform/Include/glb.h:272: note: candidates are: __GLBASIC__::DGIntArray& __GLBASIC__::DGIntArray::operator=(const __GLBASIC__::DGIntArray&)

linking:
g++.exe: gpc_temp0.o: No such file or directory
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren
_______________________________________
*** Fertig ***
Zeit: 1.0 sek
Erstellen: 0 erfolgreich
*** 1 FEHLGESCHLAGEN ***
Die erstellte EXE Datei die ich schon hatte, läuft.
Ich habe den Temp Ordner gelöscht,
GLB deinstalliert, neu gedownloadet,
den Install Ordner gelöscht,
neu Start,
GLB Installiert,
update ausgeführt,
neu Start
und immer wieder das selbe :wah:
Ein neues Projekt mit diesem Code angelegt, nichts :(

Nehme ich ein Projekt, z.B.  Samples\3D\PushPopCopter geht alles.

Schliese ich die IDE nun und öffne sie dann wieder mit dem Imageloader Projekt
bekomme ich beim Compilieren das raus:

_
Quote from: "GLB_IDE"______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.050 - 3D, NET
Wordcount:43 commands

compiling:
D:/temp/glbasic/gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
D:/temp/glbasic/gpc_temp0.cpp:17: error: no match for 'operator=' in '__GLBASIC__::player1.__GLBASIC__::Tloader::pic = __GLBASIC__::loadimage(__GLBASIC__::DGStr, DGInt, DGInt, DGInt)(3.2e+1, 3.2e+1, 1.8e+1)'
C:/Basic/GLBasic/Compiler/platform/Include/glb.h:272: note: candidates are: __GLBASIC__::DGIntArray& __GLBASIC__::DGIntArray::operator=(const __GLBASIC__::DGIntArray&)

linking:
gpc_temp0.o:gpc_temp0.cpp:(.text+0x14): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x1f): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x26): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x2c): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x42): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x94): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xec): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x144): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x196): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x1e8): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x23a): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x292): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x304): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x350): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x3a5): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x3fa): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x44c): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x4a1): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x4f3): more undefined references to `__GLBASIC__::c' follow
gpc_temp0.o:gpc_temp0.cpp:(.text+0x54a): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x596): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x5eb): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x640): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x692): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x6e7): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x739): more undefined references to `__GLBASIC__::c' follow
gpc_temp0.o:gpc_temp0.cpp:(.text+0x7b5): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x7bb): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x7ca): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x816): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x868): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x8bf): undefined reference to `__GLBASIC__::c'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x90b): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x95d): undefined reference to `__GLBASIC__::cn'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x9ba): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x9c0): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x9e1): undefined reference to `__GLBASIC__::dtime'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x9ec): undefined reference to `__GLBASIC__::dtime'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa05): undefined reference to `__GLBASIC__::accx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa0b): undefined reference to `__GLBASIC__::accx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa16): undefined reference to `__GLBASIC__::dtime'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa32): undefined reference to `__GLBASIC__::accz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa38): undefined reference to `__GLBASIC__::accz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa5b): undefined reference to `__GLBASIC__::dtime'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa64): undefined reference to `__GLBASIC__::accx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa7c): undefined reference to `__GLBASIC__::spin'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa84): undefined reference to `__GLBASIC__::accr'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa8e): undefined reference to `__GLBASIC__::spin'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xa9a): undefined reference to `__GLBASIC__::accz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xab0): undefined reference to `__GLBASIC__::accr'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xac6): undefined reference to `__GLBASIC__::accx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xad8): undefined reference to `__GLBASIC__::yaw'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xae6): undefined reference to `__GLBASIC__::accz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xaf4): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xafc): undefined reference to `__GLBASIC__::roll'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb02): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb10): undefined reference to `__GLBASIC__::accx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb16): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb27): undefined reference to `__GLBASIC__::accz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb32): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb3a): undefined reference to `__GLBASIC__::acgx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb4a): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb52): undefined reference to `__GLBASIC__::accx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb65): undefined reference to `__GLBASIC__::accz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb7e): undefined reference to `__GLBASIC__::dtime'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xb91): undefined reference to `__GLBASIC__::acgx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xba8): undefined reference to `__GLBASIC__::acgz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xbb6): undefined reference to `__GLBASIC__::posx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xbc2): undefined reference to `__GLBASIC__::posz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xbca): undefined reference to `__GLBASIC__::posx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xbd0): undefined reference to `__GLBASIC__::posz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xbdb): undefined reference to `__GLBASIC__::posz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xbe5): undefined reference to `__GLBASIC__::posx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xc20): undefined reference to `__GLBASIC__::posz'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xc36): undefined reference to `__GLBASIC__::posx'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xc49): undefined reference to `__GLBASIC__::yaw'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xc7e): undefined reference to `__GLBASIC__::roll'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xcb3): undefined reference to `__GLBASIC__::pitch'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xd0e): undefined reference to `__GLBASIC__::spin'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xe01): undefined reference to `__GLBASIC__::spin'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xe68): undefined reference to `__GLBASIC__::x'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xe70): undefined reference to `__GLBASIC__::y'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xe7c): undefined reference to `__GLBASIC__::x'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xe84): undefined reference to `__GLBASIC__::y'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xecf): undefined reference to `__GLBASIC__::y'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xef0): undefined reference to `__GLBASIC__::x'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xefe): undefined reference to `__GLBASIC__::x'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xf18): undefined reference to `__GLBASIC__::y'
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren
_______________________________________
*** Fertig ***
Zeit: 1.3 sek
Erstellen: 0 erfolgreich
*** 1 FEHLGESCHLAGEN ***
:/

Es scheint so al ob hier noch der PushPopCopter code noch mit mischt.
Den Temp Ordner hatte ich davor gelehrt.
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

BumbleBee

Hi

In deinem geposteten Code ist hier der Fehler

   player1.pic = loadimage("tile.bmp",32,32,18)

 sondern

   player1 = loadimage("tile.bmp",32,32,18)

Cheers
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

D2O

@BumbleBee :booze:
Fehler ausgebessert, Danke.

Falles es mal ein GLBasic Treffen geben sollte, gibts ein Monster Weizen :)

Du weist garnicht wie mich das gestresst hat.
Schade das GLB die fehler bis in ein anderes Projekt reinzieht.
Vieleicht wäre es besser wenn GLB im jeweiligen Projektverzeichnis einen Separaten Temp Ordner zum Compilieren benutzen würde?

Nochmals vielen Dank.
I7 2600K; 8 GB RAM ; Win10 Pro x64 | NVidia GTX 750 TI 2048MB ; Realtec OnBoard Sound;
Lenovo ThinkPad T400: XP Pro
GLB Premium-immer Aktuell

BumbleBee

Freut mich wenn ich dir helfen konnte.:)
Passiert mir aber auch immer wieder. Solche Kleinigkeiten bringen einen echt manchnmal zur Verzweiflung.
Und das GLBasic die Fehler mit in ein anderes Projekt übernimmt, ist manchmal schon ärgerlich. Aber Gernot wird's schon richten.

Das Weizen würde ich natürlich  richtig genießen.:)

Cheers
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

Kitty Hello

Einfach vorher den Debug-Knopf 2x drücken, das löscht alles andere. Ich besser's aus.