How to disable MANIFESTUAC using pragma comment?

Ed H 21 Reputation points
2020-11-09T09:31:02.083+00:00

I'm trying to set this linker option in my C++ file, using the normal method. This looks right to me at least:

#pragma comment(linker, "/MANIFESTUAC:NO")

But it's not working. I get:

warning LNK4229: invalid directive '/MANIFESTUAC:NO' encountered; ignored

Is there some way to do this with a #pragma, or do I have to do this through other means (I know it'll work if I set it through the Visual Studio GUI, but I like to put these options in the code file, so they're apparent to anyone who comes along and tries to compile my project).

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,575 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,681 questions
{count} votes

Accepted answer
  1. RLWA32 44,926 Reputation points
    2020-11-09T10:02:58.757+00:00

    According to comment pragma

    Only the following (comment-type) linker options are available to be passed to the linker identifier:

    /DEFAULTLIB  
    
    /EXPORT  
    
    /INCLUDE  
    
    /MANIFESTDEPENDENCY  
    
    /MERGE  
    
    /SECTION  
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.