Return information of works of the compiler [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Return information of works of the compiler [Resolved]

Post by Kwai chang caine »

Hello at all

I make exe by command line.
I use for that this line :

Code: Select all

ShortPathRepExeAInstaller$ = Space(#MAX_PATH) 
GetShortPathName_(PathExe, @ShortPathRepExeAInstaller$, #MAX_PATH)

ShortPathSource$ = Space(#MAX_PATH) 
GetShortPathName_(PathSource$, @ShortPathSource$, #MAX_PATH)
 
ShortPathCompilateur$ = Space(#MAX_PATH) 
GetShortPathName_(PathOfPb$ + "Compilers\PBCompiler.exe", @ShortPathCompilateur$, #MAX_PATH)
  
RunProgram(ShortPathCompilateur$, ShortPathSource$ + " /EXE " + Chr(34) + ShortPathRepExeAInstaller$ + NomExe + ".exe" + Chr(34), "", #PB_Program_Wait)
Before that's works, but now that don't works :shock:
So i don't have the information why, that don't works.

Is the compiler write a log file, or is it possible to ask at the compiler what error is it ???
Because the console appears only a few seconds, and i don't have the time to read :(

I whish you a good day
Last edited by Kwai chang caine on Sat Dec 26, 2009 8:09 pm, edited 3 times in total.
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Help FReeeeeed !!!! Return info compiler [Resolved]

Post by Kwai chang caine »

I have a second question !!!!

I have found why that don't compile...
The compiler say to me
Bad compiler wrote:Constant not found: #PB_Editor_CreateExecutable.
Is it crazy, the compiler ???? :roll:
Because #PB_Editor_CreateExecutable, is not at KCC ....it's a GOD constante :roll:

So why, the compiler itself, not know HIS personal constants ???? :shock:
Last edited by Kwai chang caine on Sat Dec 26, 2009 7:54 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Help FReeeeeed please !!!! Return info compiler

Post by netmaestro »

You have to check #PB_Editor_CreateExecutable in the Constants tab of the compiler options, otherwise God doesn't know about it.
BERESHEIT
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Help FReeeeeed please !!!! Return info compiler

Post by Kwai chang caine »

Hello MASTER NETMAESTRO very glad to talk to you 8)

I believe you mean in the panel compiler ??? :roll:
If it's yes..i don't understand what is the problem, this is my panel :roll:

Image

Have you see, i compile in line command ??? :roll:

Code: Select all

RunProgram(ShortPathCompilateur$, ShortPathSource$ + " /EXE " + Chr(34) + ShortPathRepExeAInstaller$ + NomExe + ".exe" + Chr(34), "", #PB_Program_Wait)
Is it important or not ???
ImageThe happiness is a road...
Not a destination
User avatar
Michael Vogel
Addict
Addict
Posts: 2810
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Help FReeeeeed please !!!! Return info compiler

Post by Michael Vogel »

Whatever this should do, couldn't you check what happens by using MessageRequester_(ShortPathCompilateur$,...)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Help FReeeeeed please !!!! Return info compiler

Post by Kwai chang caine »

Hello Michael, thanks to answer me 8)

You mean i must try with no check the #PB_Editor_CreateExecutable in the panel of compiler ???
So i have unchecked it, and it's exactely the same thing...

I think that perhaps, like i run directly the compiler by line, he don't see the constant #PB_Editor_CreateExecutable, because perhaps this constant is a IDE constant ??? :roll:
ImageThe happiness is a road...
Not a destination
User avatar
Michael Vogel
Addict
Addict
Posts: 2810
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Return information of works of the compiler

Post by Michael Vogel »

Kwai, I'm not sure what you'd like to do, so I thought it would be useful to debug the content of your variables - this can be done by using the requester...

Anyhow, your code lines won't be enough (for me) to see, what you want to do, something like the following seems to work here...

Code: Select all

pathexe.s=#PB_Compiler_FilePath
ShortPathRepExeAInstaller$ = Space(#MAX_PATH+1) 
GetShortPathName_(PathExe, @ShortPathRepExeAInstaller$, #MAX_PATH)
Debug ShortPathRepExeAInstaller$ 
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Return information of works of the compiler

Post by Kwai chang caine »

Yes michael, it's not my command line who not works.

The compiler start perfectly, it begin to compile and when he found in my code this instruction :

Code: Select all

CompilerIf  #PB_Editor_CreateExecutable
 Several line of code
 Several line of code
 Several line of code
CompilerEndif
The compiler say to me
Compiler wrote:Constant not found: #PB_Editor_CreateExecutable.
When i compile with the Native IDE, that's works perfectly, but when i compile in command line, the compiler return this error :shock:
I don't know why ???
I have checked and unchecked the checkBox in compiler option and it's exactely the same thing :(
ImageThe happiness is a road...
Not a destination
User avatar
Michael Vogel
Addict
Addict
Posts: 2810
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Return information of works of the compiler

Post by Michael Vogel »

Did you have done a new installation of PB? Which version?
I've installed 4.31 and 4.40 for Windows, 32 Bit - everything works fine, when the option is active.

Hope you'll find the problem...
Michael
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Return information of works of the compiler

Post by Kwai chang caine »

I have try with the 4.30 and the 4.40 and it's the same thing

When you compile with command line you have no problem :shock:
Me....for have no problem i must compile with the IDE only :(
I don't understand anything like usually :roll:

Tomorow i reinstal the PB, perhaps a bad installation :roll:
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Return information of works of the compiler

Post by Kwai chang caine »

Nobody know, how i can have the rapport of the compiler ??? :roll:
ImageThe happiness is a road...
Not a destination
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Return information of works of the compiler

Post by ts-soft »

Kwaï chang caïne wrote:Nobody know, how i can have the rapport of the compiler ??? :roll:
Use the Compiler-Interface, you can find the description in the SDK folder of your PB-Installation

...\SDK\CompilerInterface.txt

here a small example, but not for compiling :wink:

Code: Select all

EnableExplicit

Define.i Compiler = RunProgram(#PB_Compiler_Home + "\Compilers\pbcompiler", "/STANDBY", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Write | #PB_Program_Hide)
Define.s Text

NewList Functions.s()
If Compiler
  If IsProgram(Compiler)
    Repeat
    Until ReadProgramString(compiler) = "READY"
    WriteProgramStringN(Compiler, "FUNCTIONLIST")
    Debug ReadProgramString(Compiler) + " Funktionen verfügbar"
    Debug "---------------------------"
    Repeat
      Text = ReadProgramString(Compiler)
      If Text <> "OUTPUT" + #TAB$ + "COMPLETE"
        AddElement(Functions())
        Functions() = Text
      EndIf
    Until Text = "OUTPUT" + #TAB$ + "COMPLETE"
    WriteProgramStringN(Compiler, "END")
    CloseProgram(Compiler)
  EndIf
EndIf

ForEach Functions()
  Debug StringField(Functions(), 1, "(")
Next
greetings
Thomas
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Return information of works of the compiler

Post by Kwai chang caine »

Hello kind TSSOFT 8)
You have a christmas hat like me.... :D
But you are much beautiful :D

Again a function i don't know :shock:
Pffooiouuuuu !!! it's not simple for the little head of KCC :oops:

I have understand, we can talk directly with the compiler
And for talk to him, i must use WriteProgramStringN for give an order
And immediately after ReadProgramString for read the answer of compiler

But after ....like usually, FRED is not enough explicit :(
Like in the doc...he don't think that some client is brain incapacitate like me :oops:

I have tried that, but it's locked at the line 19

Code: Select all

 Debug ReadProgramString(Compiler) + " Funktionen verfügbar"

Code: Select all

EnableExplicit

Define.i Compiler = RunProgram(#PB_Compiler_Home + "\Compilers\pbcompiler", "/STANDBY", "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Write|#PB_Program_Hide)
Define.s Text

NewList Functions.s()

If Compiler

  If IsProgram(Compiler)
  
   Repeat
   Until ReadProgramString(compiler) = "READY"
   
   WriteProgramStringN(Compiler, "SOURCE<T>E:\Donnees\XXXX\MESDOC~1\PROGRA~1\RECREA~1\RESOLU~1\KCC~1.1DU\_SOURC~1\KCC.pb")
   WriteProgramStringN(Compiler, "COMPILE<T>DEBUGGER<T>WARNINGS")
   WriteProgramStringN(Compiler, "TARGET<T>C:\Try.exe")
   
   Debug ReadProgramString(Compiler) + " Funktionen verfügbar"
   Debug "---------------------------"
   
   Repeat
   
    Text = ReadProgramString(Compiler)
    
    If Text <> "OUTPUT" + #TAB$ + "COMPLETE"
     AddElement(Functions())
     Functions() = Text
    EndIf
    
   Until Text = "OUTPUT" + #TAB$ + "COMPLETE"
   
   WriteProgramStringN(Compiler, "END")
   CloseProgram(Compiler)
   
  EndIf
  
EndIf

ForEach Functions()
 Debug StringField(Functions(), 1, "(")
Next

ImageThe happiness is a road...
Not a destination
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Return information of works of the compiler

Post by ts-soft »

replace <T> with " + #TAB$ + " !
use long paths, not this ugly dos stuff :mrgreen:

merry christmas
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Return information of works of the compiler

Post by Kwai chang caine »

You are really an angel 8)
And at this period..the angels have numerous job :D

That's works perfectly, just a problem with the relative and absolute path...
But you are really an angel...because you have already answer at this question in the another THREAD 8)

Thanks for all this help you give to me, since i am in this forum....
If you want..... i can to be also your IDIOTMAN 8)
Because KCC is so IDIOT, that he can be the IDIOT, of several persons :mrgreen:

I wish you a very very good day 8)
ImageThe happiness is a road...
Not a destination
Post Reply