Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97355

C: Set custom entry point in Visual Studio Code using clang

$
0
0

I am trying to set clang to use a function called entry() (instead of main) as the entry point (in order to prevent C-runtime initialization), but the compiler does not seem to recognize any of the entry-setting arguments -- it keeps saying that the arguments that should work are unused). Doing -eentry makes this message appear:

clang: warning: argument unused during compilation: '-e entry' [-Wunused-command-line-argument]

and later:

clang: error: linker command failed with exit code 1561 (use -v to see invocation)

Doing -Wl,-emymain makes this message appear:

At line:1 char:120
+ ...  -nostartfiles -nostdinc -nostdlib -nodefaultlibs --debug -Wl,-eentry
+                                                                  ~
Missing argument in parameter list.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArgument

and later:

clang: error: linker command failed with exit code 1561 (use -v to see invocation)

Doing -Xlinker -eentry makes this message appear:

clang: warning: argument unused during compilation: '-Xlinker -eentry' [-Wunused-command-line-argument]

and later:

clang: error: linker command failed with exit code 1561 (use -v to see invocation)

Viewing all articles
Browse latest Browse all 97355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>