[IDE Tool] pbOptimizer

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

camille wrote:That's the beginning of the "Large text file creator_pbOpt.pb" file.

With line 3 "#PB_Compiler_IsIncludeFile = #True" which pbOptimizer is complaining about
The PB-IDE is also complaining about this line... Not the fault of pbOptimizer ;)


[include.pb]

Code: Select all

Procedure Multiply(a, b)
  ProcedureReturn a * b
EndProcedure

CompilerIf #PB_Compiler_IsIncludeFile
  
  Debug "include file: " + #PB_Compiler_Filename
  
CompilerElseIf #PB_Compiler_IsMainFile
  
  Debug "main file: " + #PB_Compiler_Filename
  Debug Multiply(13, 37)
  
CompilerEndIf
[main.pb]

Code: Select all

XIncludeFile "include.pb"

Debug Multiply(13, 37)
Run both files and you'll see the difference[/size]
Et cetera is my worst enemy
camille
User
User
Posts: 66
Joined: Tue Nov 19, 2019 12:52 pm

Re: [IDE Tool] pbOptimizer

Post by camille »

Thank you both firace + chi!

I've removed these statements and now pbOptimizer is working fine :)
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

updated to v0.9.8.7
Et cetera is my worst enemy
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: [IDE Tool] pbOptimizer

Post by loulou2522 »

I would like to use this programme. But after installation in a directory the access buttons remain greyed out and no pb files can be used.
Can you tell me what to do?
Thanks in advance
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

@loulou2522

Hi, did you set up the pbOptimizer.exe according to the pbOptimizer_IDE_Setup.png? If so, please check that there is a space between "%FILE" and "%TEMPFILE" and you put in the double quotes. Another possibility to check is the folder where you put the exe. Do you have read/write access there? If UAC is on and you put it in "C:\Program Files (x86)\..." there is a slight chance it gets blocked :wink:.
Et cetera is my worst enemy
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: [IDE Tool] pbOptimizer

Post by loulou2522 »

thANKS ALL IS GOOD
I have just ending compilation of 42612 lignes. It seems to work well but i have a question :
- Compilation without pboptimizer size 5423 Ko with pboptimizer 5434 ko Is it normal ?
THnks
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

loulou2522 wrote: Sat Apr 24, 2021 2:44 pm - Compilation without pboptimizer size 5423 Ko with pboptimizer 5434 ko Is it normal ?
That doesn't sound right... It should either be the same size (if no optimization took place, which is rather unlikely) or smaller than the output of the default compilation. The only scenario where the file will be larger is if you have checked "Insert NOP lines" under Settings. Other than that, you could compare the files with e.g. "CFF Explorer" and see if there are additional imports under the "Import Directory" in the optimized file... But I'm fishing here ^^
Et cetera is my worst enemy
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: [IDE Tool] pbOptimizer

Post by loulou2522 »

iin fact i realize that the executable was not created because of that
Error: Resource
PORC: \pbOptimizer.rc(51): warning: No newline at end of file.
PORC: \pbOptimizer.rc(21): error: Unknown keyword: 'VersionField1%'.
PORC: \pbOptimizer.rc(43): error: Invalid syntax.
PORC: \pbOptimizer.rc(43): error: String literal expected (found: -).
PORC: \pbOptimizer.rc(43): error: Comma expected (found: %mm).
PORC: \pbOptimizer.rc(43): error: String literal expected (found: -).
PORC: \pbOptimizer.rc(43): error: Invalid syntax.
PORC: \pbOptimizer.rc(43): error: String literal expected (found: hh).
PORC: \pbOptimizer.rc(43): error: Comma expected (found: -).
PORC: \pbOptimizer.rc(43): error: String literal expected (found: ii).
PORC: \pbOptimizer.rc(43): error: Invalid syntax.
PORC: \pbOptimizer.rc(43): error: String literal expected (found: ss).
PORC: \pbOptimizer.rc(43): error: Comma expected (found: "STRING").
PORC: \pbOptimizer.rc(44): error: String literal expected (found: value).
PORC: \pbOptimizer.rc(44): error: Invalid syntax.
PORC: \pbOptimizer.rc(44): error: String literal expected (found: ,).
PORC: \pbOptimizer.rc(44): error: Comma expected (found: "STRING").
PORC: \pbOptimizer.rc(45): error: String literal expected (found: end).
Did you know that's problem
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

Try this... Go to compiler options, disable "Include Version Information" and compile with pbOpt. If it goes through then the problem is with the tokens you are using, which are not yet supported (see first post). If there is still an error please PM me your .rc file and version infos so I can check what's going on ;). Also, you are using PB 5.7x?
Et cetera is my worst enemy
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: [IDE Tool] pbOptimizer

Post by loulou2522 »

It works by unchecking the options "Include Version Information" as you told me; Compilation was good
With main.pb exe size 4529 Kb
With PBOPTIMIZE 4192 ko
Is the optimization done ?
I use PB 5.73 64 with windows 10
I try to compile the program with "Include Version Information" also checked and the compilation was goo and with the same size
It seems that the problem come from PB OPtimizer in the last stage because it blocks on compilation
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

loulou2522 wrote: Sun Apr 25, 2021 8:13 am It works by unchecking the options "Include Version Information" as you told me; Compilation was good
Nice, so we found the problem :oops:
loulou2522 wrote: Sun Apr 25, 2021 8:13 am With main.pb exe size 4529 Kb
With PBOPTIMIZE 4192 ko
Is the optimization done ?
Okay, that's more like it. Btw you'll see all removed libraries under "Uncalled PB Libraries Removed" in the Log.
loulou2522 wrote: Sun Apr 25, 2021 8:13 am I use PB 5.73 64 with windows 10
I try to compile the program with "Include Version Information" also checked and the compilation was goo and with the same size
It seems that the problem come from PB OPtimizer in the last stage because it blocks on compilation
Was it goo or good? :twisted: Yeah, I forgot to flush the created .rc file but never got problems on my system. Going to upload a new version soon... Hope that'll fix the problem once and for all. Thank you for the bug report!
Et cetera is my worst enemy
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: [IDE Tool] pbOptimizer

Post by loulou2522 »

Sorry Chti i make an error when typing the right word was good
THnaks
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: [IDE Tool] pbOptimizer

Post by chi »

updated to v0.9.8.8
loulou2522 wrote: Sun Apr 25, 2021 11:03 am Sorry Chti i make an error when typing the right word was good
THnaks
Hehe, no problem... I knew what you meant :)
Et cetera is my worst enemy
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: [IDE Tool] pbOptimizer

Post by ChrisR »

Hi chi
Thank you for this nice tool
My 1st test, I have encountered 2 small issues.
1. I have an Uncalled Procedures that is Removed: LoadOrder( , good
but then i have the error, the module procedure 'LoadOrder()' has been declared but not defined

2. My source uses IncludePath "Images" (could be "..\Images"), it looks good on the first pass
At starting compilation, it fails, it does not find the images included in _pbOpt.pb
The relative path does not seem to be defined
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: [IDE Tool] pbOptimizer

Post by loulou2522 »

Hi Chi,
I try to download the new version, but I have a message thet indicates your zip files is infected. In the precedetn version there was no problem.
Can you see please ? and saying me if it's a false positive

Another problem
When i use pboptimizer i have alway the same problem with rc file
--another problem
- With pboptimizer size of the result compile file -->5490 ko
and directly compiling in PB ide ---->4120 Ko
Last edited by loulou2522 on Sun Apr 25, 2021 1:20 pm, edited 1 time in total.
Post Reply