[Done] Error: use of undeclared identifier...

Post bugreports for the Mac OSX version here
Torp
User
User
Posts: 82
Joined: Fri Apr 01, 2005 11:29 am

[Done] Error: use of undeclared identifier...

Post by Torp »

Hello,

I tried to launch my project on my MacBook Air M2 (PB 6.02) and I always get this message:

Code: Select all

error: use of undeclared identifier '_S99'
SYS_AssignFixedStringFast(&v_prj.f_indice,2,_S99);
^
purebasic.c:31980:49: error: use of undeclared identifier '_S99'
SYS_AssignFixedStringFast(&v_prj.f_filename,255,_S9
Does anyone have an idea of the problem (bug or not)?

Thanks
User avatar
mk-soft
Addict
Addict
Posts: 4863
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Error: use of undeclared identifier...

Post by mk-soft »

Needed pb-code ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 15950
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Error: use of undeclared identifier...

Post by Fred »

Looks like bug, any chance to get the code ? You can try with the --commented switch to get the commented output and see which line get this error
Torp
User
User
Posts: 82
Joined: Fri Apr 01, 2005 11:29 am

Re: Error: use of undeclared identifier...

Post by Torp »

Hello,

I can't give you a code snippet because the message doesn't give me any indication that I can understand (by myself :)) and the project in question is over 15,000 lines long.

I'll try what Fred advises. I don't know how yet but I'm going to find out how to compile a project from the command line on the Mac (if I've understood everything correctly).

Bye
User avatar
deseven
Enthusiast
Enthusiast
Posts: 352
Joined: Wed Jan 12, 2011 3:48 pm
Location: Serbia
Contact:

Re: Error: use of undeclared identifier...

Post by deseven »

Could be done like that, more or less:

Code: Select all

export PUREBASIC_HOME="/Applications/PureBasic.app/Contents/Resources"
cd /path/to/your/project
"$PUREBASIC_HOME/compilers/pbcompiler" -c myapp.pb
User avatar
mk-soft
Addict
Addict
Posts: 4863
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Error: use of undeclared identifier...

Post by mk-soft »

Display ASM and C-Code as IDE-Tool

Link: DisplayCcode
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Torp
User
User
Posts: 82
Joined: Fri Apr 01, 2005 11:29 am

Re: Error: use of undeclared identifier...

Post by Torp »

Thanks for the help, because I spent all evening yesterday with no result... (The Mac is a strange beast :)).
I'm going to try this
Torp
User
User
Posts: 82
Joined: Fri Apr 01, 2005 11:29 am

Re: Error: use of undeclared identifier...

Post by Torp »

Hello,

I've finally found the problem.
It's not a bug, but an error on my part. I had declared empty strings ("") with the constant #Null$ and not #Empty$. The problem also came up under Windows with Backend-C, which is what helped me find it.
User avatar
mk-soft
Addict
Addict
Posts: 4863
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Error: use of undeclared identifier...

Post by mk-soft »

Its a Bug

Code: Select all

; C-backend
Global sVal.s{5}
sVal = #Null$
Move to C-backend --> viewtopic.php?t=81826
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Torp
User
User
Posts: 82
Joined: Fri Apr 01, 2005 11:29 am

Re: Error: use of undeclared identifier...

Post by Torp »

Ah ok, but PB's documentation states:
There are two special constants for strings:
#Empty$: represents an empty string (exactly the same as "")
#Null$ : represents an null string. This can be used for API
functions requiring a null pointer to a string, or to really free a string.
Fred
Administrator
Administrator
Posts: 15950
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Error: use of undeclared identifier...

Post by Fred »

As a rule of thumb, it should never have an assembler error when using the PB commandset.
Fred
Administrator
Administrator
Posts: 15950
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Error: use of undeclared identifier...

Post by Fred »

Already fixed in current beta.
Post Reply