Rebuilding Res File

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

Psych
Enthusiast
Enthusiast
Posts: 228
Joined: Thu Dec 18, 2008 3:35 pm
Location: Wales, UK

Rebuilding Res File

Post by Psych »

I've noticed if I try to rebuild a RES file it fails telling me that the structure is already declared (in a res file), although the only place it is declared is in the res file I am replacing.

I have to delete the res file, restart the compiler, and then build it.

Is this behavior normal?

I mean, it's no big deal for one off changes, but if like me you like to test a few structures at a time it does lengthen the whole process.

Unless I am doing something wrong, which wouldn't surprise me, lol.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Rebuilding Res File

Post by freak »

The compiler has a /IGNORERESIDENT switch for this. Use it to ignore the resident file you are rebuilding.
quidquid Latine dictum sit altum videtur
Psych
Enthusiast
Enthusiast
Posts: 228
Joined: Thu Dec 18, 2008 3:35 pm
Location: Wales, UK

Re: Rebuilding Res File

Post by Psych »

So I set this where exactly? In the compiler options for the res source?
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Rebuilding Res File

Post by ts-soft »

In your commandline!
cmd wrote:Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Program Files (x86)\PureBasic\Compilers>pbcompiler /?

PBCompiler "Filename"

Options:
--------

/DEBUGGER: Enable the debugger
/EXE "Filename": Create an executable to the given filename
/DLL: Create a DLL
/CONSOLE: Create a console executable
/ICON "Filename": Add an icon to the executable
/RESOURCE "Filename": Add a resource file (.rc) to the executable
/QUIET: Disable all unnecessary textoutput
/COMMENTED: Produce a commented asm output (PureBasic.asm)
/REASM: Compile the 'PureBasic.asm' file to an executable
/XP: Add the Windows XP theme support to the executable
/USER: Add the 'User' hint to the executable (Windows Vista)
/ADMINISTRATOR: Add the 'Administrator' hint to the executable (Windows Vista)
/RESIDENT "Filename": Create a resident file to the given filename
/IGNORERESIDENT "Filename": ignore the given resident
/LINENUMBERING: Enable line numbering in the final executable for OnError
/STANDBY: Wait for external commands (editor, scripts...)
/MMX, /3DNOW, /SSE or /SSE2: Create a processor specific executable
/DYNAMICCPU: Create a executable containing all processor specific routines
/THREAD: Use thread safe runtime for strings and general routines
/UNICODE: Use unicode instead ascii for strings management
/PURIFIER: Enable the purifier
/SUBSYSTEM "Name": Use this subsystem to replace a set of internal functions
/CONSTANT Name=Value: Declare a new constant at compile time
/LINKER "ResponsFile": Specify a commands file to be passed to the linker
/CHECK: Check the syntax only, doesn't create/launch the executable

/LANGUAGE "Language": Uses the specified language for the compiler

/VERSION: Display the version of the compiler


C:\Program Files (x86)\PureBasic\Compilers>
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Psych
Enthusiast
Enthusiast
Posts: 228
Joined: Thu Dec 18, 2008 3:35 pm
Location: Wales, UK

Re: Rebuilding Res File

Post by Psych »

Ok, I think I am being stupid here.

I am using tailbite to rebild the res file from the tools menu of the PB IDE, I see no option to set this flag in the compiler, since tailbite is invoking it. I also see no option to do this using the tailbite manager.

Am I missing something?
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Rebuilding Res File

Post by ts-soft »

I don't know, if tailbite support this, but tailbite is not required to create a resident file.

Code: Select all

EnableExplicit

Define Path.s = #PB_Compiler_Home + "Compilers\"

Define MyRes.s = "d:\myres.pb"

Debug RunProgram(Path + "pbcompiler.exe", #DQUOTE$ + MyRes + #DQUOTE$ + " /RESIDENT myres.res /IGNORERESIDENT test.res", "")
or use a batch or something else, is easy :wink:

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Psych
Enthusiast
Enthusiast
Posts: 228
Joined: Thu Dec 18, 2008 3:35 pm
Location: Wales, UK

Re: Rebuilding Res File

Post by Psych »

The reason for my original post, and my posting it in the tailbite section, is that only structures seem to generate this error, if I rebuild a res file with no structures, the file gets replaced correctly (even interface declares are ignored).

I was just curious if this should be considered a bug, or not.

I like the simplicity of tailbite, so unless I code my own version and try to integrate that into the IDE I guess I'll stick to having to delete the res file before I update it, not ideal, but we have to use what we have.

On a separate note, I've noticed that we have to restart the compiler after we update a userlib or res file, since we do this every time, would it not be prudent for tailbite to instruct the IDE to do this automatically after a successful build? Sometimes I forget to restart the compiler and it can cause confusion. Just a thought.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
Post Reply