WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Error: label "CopyJob:" already declared in function
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
xbarns
Senior Member

Registered: Aug 2007
From: Frankfurt, Germany

Error: label "CopyJob:" already declared in function

Hi all,

i am using a Macro to create a set of files for one of my setup projects, the macro itself looks like this

code:
!macro _CreateAndCopyC7ClientJob PATH IfFileExists "$PLUGINSDIR\CLIENTTEMP\C7.zip" CopyJob 0 . . CopyJob: . . !macroend !define CreateAndCopyC7ClientJob `!insertmacro _CreateAndCopyC7ClientJob`


when compiling the setup i get the Message

Error: label "CopyJob:" already declared in function

this macro is called multiple times and the error occurs when its called for the 5th time (3 times out of one nsh, and 2 (before it crashes) out of another nsh file.

I know i can probably work around this if i do not use fixed label but instead "+x" to jump to the desired command.
But i would like to understand why this is happening only when called the 5th time.

Thanks for helping

Quick Link | Report this post to a moderator | IP: Logged

xbarns is offline Old Post 10-23-2009 12:47 PM
Click Here to See the Profile for xbarns Click here to Send xbarns a Private Message Find more posts by xbarns Add xbarns to your buddy list Edit/Delete Message Reply w/Quote
demiller9
Senior Member

Registered: Mar 2006
From: Dallas

Macros define lines of text that are inserted into your code each time that they are referenced by CreateMacro. The fixed name labels you put into the macro are thus duplicated each time the macro is inserted. This is permissible if the labels are in separate sections or functions, but is an error if the labels are used multiple times in the same function or section.

Instead of relative jumps, you can append a unique modifier onto the label name. Look at some of the header files that use labels (logiclib.nsh) to see how that's done.

Don

Quick Link | Report this post to a moderator | IP: Logged

demiller9 is offline Old Post 10-23-2009 03:15 PM
Click Here to See the Profile for demiller9 Click here to Send demiller9 a Private Message Find more posts by demiller9 Add demiller9 to your buddy list Edit/Delete Message Reply w/Quote
xbarns
Senior Member

Registered: Aug 2007
From: Frankfurt, Germany

Thumbs up

Got it, thanks a lot!

Quick Link | Report this post to a moderator | IP: Logged

xbarns is offline Old Post 11-03-2009 05:37 PM
Click Here to See the Profile for xbarns Click here to Send xbarns a Private Message Find more posts by xbarns Add xbarns to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 04:40 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Error: label "CopyJob:" already declared in function
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON