Why does entry point of _start results in error when linking with GCC on Windows/MinGW?

Why does entry point of _start results in error when linking with GCC on Windows/MinGW?

Using the following .asm file I assemble and link using the following commands on Windows 10 using MinGW:

nasm -f win32 helloworld.asm gcc -e_start -o helloworld helloworld.obj 

Assembling works just fine, however linking produces the following error:

c:/dev/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `[email protected]' 

Changing _start to _main everything seems to work fine. Why is that?

BITS 32      global _start     extern _printf      section .text _start:     push msg     call _printf     add esp, 4     ret msg:     db "HelloWorld", 10, 0 

Replay

Category: c# Time: 2016-07-31 Views: 10

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.136 (s). 13 q(s)