-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State Error LNK2001 unresolved external symbol _mainCRTStartup #16
Comments
I'm assuming that you're trying to write just assembly and nothing else, but it's in a C++ project. Under the hood in C++ #include <iostream>
extern "C" int asmMain();
// _mainCRTSetup secretly called before this
int main()
{
return asmMain();
} and in assembly your bits 64
global asmMain
asmMain:
mov rax, 69 ; some return code, 0 if no error but 69 is funny
ret hope this was helpful, but this issue is pretty old so I'm sure you've figured it out yourself by now |
@Zman2024 Tried your simple application, but having the same issue.
extern "C" int asmMain();
int main()
{
return asmMain();
}
[BITS 64]
GLOBAL asmMain
asmMain:
mov rax, 69
ret Any ideas what could be wrong? |
it seems like your |
I ran into a similar issue. everything looked correct with dumpbin -symbols .\assemblyNasm64.obj get_assembly_test_num: global get_assembly_test_num ; makes this visible to linker get_assembly_test_num: and then it linked |
Whats wrong?
The text was updated successfully, but these errors were encountered: