Page 1 of 1

Rebuilding Res File

Posted: Tue Apr 01, 2014 1:36 am
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.

Re: Rebuilding Res File

Posted: Tue Apr 01, 2014 6:51 pm
by freak
The compiler has a /IGNORERESIDENT switch for this. Use it to ignore the resident file you are rebuilding.

Re: Rebuilding Res File

Posted: Tue Apr 01, 2014 7:15 pm
by Psych
So I set this where exactly? In the compiler options for the res source?

Re: Rebuilding Res File

Posted: Tue Apr 01, 2014 7:53 pm
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>

Re: Rebuilding Res File

Posted: Tue Apr 01, 2014 8:08 pm
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?

Re: Rebuilding Res File

Posted: Tue Apr 01, 2014 8:26 pm
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

Re: Rebuilding Res File

Posted: Tue Apr 01, 2014 8:41 pm
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.