Article ID: 184088
Article Last Modified on 12/1/2003
APPLIES TO
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 2.2
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
This article was previously published under Q184088
SYMPTOMS
The comment pragma allows the user to insert strings into an executable. If
a comma is used in the comment string, as follows:
#pragma comment(exestr,"This is a , comma")
then the linker generates the following warning:
warning LNK4056: extra arguments ignored for option
"/comment:This is a , comma"
where the "extra arguments" refers to the text after the "," in the comment
string.
CAUSE
The comment pragma is translated by the compiler into the /comment linker
option. The linker interprets the comma as a separator between arguments,
and ignores the "second" argument.
RESOLUTION
Add a space or some other character in place of the comma, and then edit
the executable and replace the space with a comma. To do this, open the
executable file in Developer Studio using the binary format. Select
File/Open, choose Binary under the "Open As" combo box, and open the .exe
file. Locate the string, and edit the executable directly to add a comma
where needed.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in Visual C++ 6.0.
REFERENCES
Visual C++ version 5.0 Online Documentation, #pragma comment:
mk:@ivt:vccore/F39/D3B/S4C36D.HTM
Keywords: kbbug kbfix kbvc600fix kblangc KB184088