简体   繁体   English

函数_main中引用的未解析的外部符号_printf

[英]Unresolved external symbol _printf referenced in function _main

I'm a complete newbie at C programming and I was writing a program and it started throwing the below error: 我是C编程的新手,正在编写程序,它开始引发以下错误:

error LNK2019 unresolved external symbol_printf referenced in function_main 错误LNK2019无法解析的外部symbol_printf在function_main中引用

I'm using the C compiler. 我正在使用C编译器。

My code is shown below: 我的代码如下所示:

#include <stdio.h>

int main(void)
{
    int EarthWeight;    // Weight on earth

    float Mercurypercent, Venuspercent,
    Marspercent, Jupiterpercent, Saturnpercent, Neptunepercent; // wieght percents

    float Mercurywieght, Venusweight, Marsweight, Jupiterweight, Saturnweight, Neptuneweight; // wieght outputs

    Mercurypercent = 0.378; // percent values of all the planets
    Venuspercent = 0.907;
    Marspercent = 0.377;
    Jupiterpercent = 2.36;
    Saturnpercent = 0.889;
    Neptunepercent = 1.12;  

    printf("what is the Weight of the person on earth? "); // Grabs the weight on earth
    scanf("%d", &EarthWeight);

    Mercurywieght = EarthWeight * Mercurypercent;
    Venusweight = EarthWeight * Venuspercent;
    Marsweight = EarthWeight * Marspercent;
    Jupiterweight = EarthWeight * Jupiterpercent;
    Saturnweight = EarthWeight * Saturnpercent;
    Neptuneweight = EarthWeight * Neptunepercent;

    Printf("Your Weight on Earth is: %d\n", EarthWeight);
    Printf("Your Weight on Mercury is: %f\n", Mercurywieght);
    Printf("Your Weight on Venus is: %f\n", Venusweight);
    Printf("Your Weight on Mars is: %f\n", Marsweight);
    Printf("Your Weight on Jupiter is: %f\n", Jupiterweight);
    Printf("Your Weight on Saturn is: %f\n", Saturnweight);
    Printf("Your Weight on Neptune is: %f\n", Neptuneweight);

    return 0;
}

C is case-sensitive and you're calling Printf instead of printf . C区分大小写,您要调用Printf而不是printf

C is also very typo-sensitive, and you have some in your questions and variable name, so beware... C也是对打字错误敏感的,并且您的问题和变量名中也包含一些内容,因此请注意...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在C函数中引用的未解析的外部符号_printf - unresolved external symbol _printf referenced in function in C main 中引用的未解析的外部符号 - Unresolved external symbol referenced in main 错误18错误LNK2019:函数_main中引用了无法解析的外部符号_error - Error 18 error LNK2019: unresolved external symbol _error referenced in function _main 错误LNK2019:函数_main中引用了无法解析的外部符号_vfork - error LNK2019: unresolved external symbol _vfork referenced in function _main Efi 应用程序链接器错误未解析的外部符号 gEfiShellProtocolGuid 在函数 main 中引用 - Efi app linker error unresolved external symbol gEfiShellProtocolGuid referenced in function main MSVCRTD.lib(crtexe.obj):错误 LNK2019:未解析的外部符号 _main 在函数 ___tmainCRTStartup 中引用 - MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 从C程序调用COBOL程序,ERROR LNKG2019:函数_main中引用的未解析的外部符号_verkoop - calling a COBOL program from a C program, ERROR LNKG2019: unresolved external symbol _verkoop referenced in function _main 未解析的外部符号主符号(无下划线) - unresolved external symbol main (no underscore) 函数“ public:bool”中引用的未解析的外部符号_D3D10CreateDeviceAndSwapChain @ 32 - unresolved external symbol _D3D10CreateDeviceAndSwapChain@32 referenced in function "public: bool 带有外部获取功能的未解析外部符号 - Unresolved External Symbol with external get function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM