|
-
May 16th, 2009, 04:43 PM
#16
Re: How-to specify the name of compiled output (*.exe) within C++ code?
Well, the idea is that .cpp is not a correct place for holding resource descriptions and build settings. That's why resource scripts, makefiles and/or project files exist.
Best regards,
Igor
-
May 17th, 2009, 12:46 AM
#17
Re: How-to specify the name of compiled output (*.exe) within C++ code?
 Originally Posted by Panarchy
Thanks, but how do I put that line directly into the .cpp file?
You can't. Exe output is generated by the linker, and the linker never sees your source code.
-
May 19th, 2009, 07:37 PM
#18
Re: How-to specify the name of compiled output (*.exe) within C++ code?
Would it be possible, to use argv to specify the name of the .exe within my code?
Is that possible?
Thanks
Panarchy
-
May 19th, 2009, 11:35 PM
#19
Re: How-to specify the name of compiled output (*.exe) within C++ code?
No. Argv is used with the program runs. After the exe has already been created and named.
-
May 20th, 2009, 07:34 PM
#20
Re: How-to specify the name of compiled output (*.exe) within C++ code?
Ah.
Well, thinking outside the square, could I put some kind of copy/rename program/line to run as soon as program finishes compiling?
-
May 20th, 2009, 10:54 PM
#21
Re: How-to specify the name of compiled output (*.exe) within C++ code?
You do know that you can specify the name of the exe in your project settings, right? You can set up your project to do post-build actions though, if that's what you really want/need.
-
May 23rd, 2009, 09:36 PM
#22
Re: How-to specify the name of compiled output (*.exe) within C++ code?
Okay, but how do I specify the post-build actions within the actual code?
-
May 23rd, 2009, 09:40 PM
#23
Re: How-to specify the name of compiled output (*.exe) within C++ code?
Hello Again!
I still haven't worked out how to do this .
Could someone please tell me how to set the name of the *.exe programmatically?
More info: http://msdn.microsoft.com/en-us/libr...utputfile.aspx
Please help me do this!
Thanks in advance,
Panarchy
-
May 24th, 2009, 02:49 AM
#24
Re: How-to specify the name of compiled output (*.exe) within C++ code?
 Originally Posted by Panarchy
I wonder if you really read the "more info"? This article has nothing to do with the thread's topic. Because this is about how to write VisualStudio extension that can set the name of compiled exe.
Really more info:
Code:
// 503.cpp
#pragma comment(linker, "/out:mycool.exe")
int main()
{
return 0;
}
Code:
E:\Temp\503>cl 503.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
503.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
/out:503.exe
503.obj
503.obj : warning LNK4070: /OUT:mycool.exe directive in .EXP differs from output filename '503.exe'; ignoring directive
...but
Code:
E:\Temp\503>cl 503.cpp /c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
503.cpp
E:\Temp\503>link 503.obj
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Last edited by Igor Vartanov; May 24th, 2009 at 02:55 AM.
Best regards,
Igor
-
May 24th, 2009, 10:09 PM
#25
Re: How-to specify the name of compiled output (*.exe) within C++ code?
I got the same;
Code:
1>------ Build started: Project: VNC, Configuration: Release Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>VNC.cpp
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>VNC.obj : warning LNK4070: /OUT:mycool.exe directive in .EXP differs from output filename 'C:\VNC\Release\VNC.exe'; ignoring directive
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>Build log was saved at "file://c:\VNC\VNC\Release\BuildLog.htm"
1>VNC - 0 error(s), 1 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
-
July 24th, 2009, 05:52 PM
#26
Re: How-to specify the name of compiled output (*.exe) within C++ code?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|