I made a simple program in C++ using Visual Studio 2019 to learn. When I open the file with Ghidra, it doesn't seem to detect my functions and I don't know what I'm doing wrong.
My program is simple:
#include <iostream>
void someFunction()
{
printf("im scared world, i dont understand.\n");
}
int main()
{
std::cout << "hello world" << '\n';
someFunction();
system("pause");
return 0;
}
Yet the main function looks like this in Ghidra:
int __cdecl _main(int _Argc,char **_Argv,char **_Env)
{
char cVar1;
char *unaff_EBP;
basic_ostream<char,struct_std::char_traits<char>_> *in_stack_fffffff8;
cVar1 = (char)unaff_EBP;
operator<<<struct_std::char_traits<char>_>(in_stack_fffffff8,unaff_EBP);
operator<<<struct_std::char_traits<char>_>(in_stack_fffffff8,cVar1);
/* Symbol Ref: No symbol: someFunction */
_printf("im scared world, i dont understand.\n");
system("pause");
return 0;
}
As you can see, where my function should be, it instead shows
/* Symbol Ref: No symbol: someFunction */
Why? What can I do to fix this?
/Od
compile parameter.