Program2_1002

本文介绍了一个关于x的多项式函数,通过求导和二分查找的方法寻找其在0到100区间内的最小值。输入一个数值y,计算并输出该函数在指定范围内的最小值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  我现在做的是第二专题编号为1002的试题,具体内容如下:

Strange fuction

Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 51   Accepted Submission(s) : 25
Problem Description
Now, here is a fuction:<br>&nbsp;&nbsp;F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 &lt;= x &lt;=100)<br>Can you find the minimum value when x is between 0 and 100.
 

Input
The first line of the input contains an integer T(1<=T<=100) which means the number of test cases. Then T lines follow, each line has only one real numbers Y.(0 < Y <1e10)
 

Output
Just the minimum value (accurate up to 4 decimal places),when x is between 0 and 100.
 

Sample Input
2<br>100<br>200
 

Sample Output
-74.4291<br>-178.8534
 
简单题意:

有一个关于x的函数,0<=x <= 100,输入一个数y,代入到这个关于x的函数中,求这个函数的最小值,

解题思路:

 应用数学知识,对函数进行求导,F’(x)=42 * x^6+48*x^5+21*x^2+10*x-y,显然函数是单调递增的,如果F'(100) <0,那么这个函数是单调递减的,当x=100时,有最小值,

在一般情况下,当F'(t) =0时,在x=t处有最小值,故求数字t即可,利用二分法进行查找即可。


编写代码:

#include<iostream>
#include<cmath>
using namespace std;
double func1(double x)      
{
    return 6*pow(x,7.0)+8*pow(x,6.0)+7*pow(x,3.0)+5*pow(x,2.0);
}
double func2(double x)      
{
    return 42*pow(x,6.0)+48*pow(x,5.0)+21*pow(x,2.0)+10*pow(x,1.0);
}
int main()
{
    int n;
    double y;
    cin >> n;
    cout.precision(4);
    while(n--)
    {
       cin >> y;
       if(y>=func1(100))           
        cout << func1(100)-y*100 << endl;
       else
       {
          double mid,left=0,right=100;
          while(right-left>1e-8)       
          {
              mid=(left+right)/2;
              if(func2(mid)<=y)
                 left=mid;
              else
                 right=mid;
          }
            cout << fixed << func1(mid)-y*mid <<endl;
       }
      }
    return 0;
}

D:\pythonProject1\PaddleDetection-release-2.8.1>python tools/export_model.py -c configs/ppyolo/ppyolo_r18vd_coco.yml --output_dir ./inference_model -o weights=tools/output/249.pdparams 信息: 用提供的模式无法找到文件。 Warning: Unable to use JDE/FairMOT/ByteTrack, please install lap, for example: `pip install lap`, see https://github.com/gatagat/lap Warning: Unable to use numba in PP-Tracking, please install numba, for example(python3.7): `pip install numba==0.56.4` Warning: Unable to use numba in PP-Tracking, please install numba, for example(python3.7): `pip install numba==0.56.4` [06/05 14:50:46] ppdet.utils.checkpoint INFO: Skipping import of the encryption module. Warning: Unable to use MOT metric, please install motmetrics, for example: `pip install motmetrics`, see https://github.com/longcw/py-motmetrics Warning: Unable to use MCMOT metric, please install motmetrics, for example: `pip install motmetrics`, see https://github.com/longcw/py-motmetrics [06/05 14:50:47] ppdet.utils.checkpoint INFO: Finish loading model weights: tools/output/249.pdparams Traceback (most recent call last): File "D:\pythonProject1\PaddleDetection-release-2.8.1\tools\export_model.py", line 148, in <module> main() File "D:\pythonProject1\PaddleDetection-release-2.8.1\tools\export_model.py", line 144, in main run(FLAGS, cfg) File "D:\pythonProject1\PaddleDetection-release-2.8.1\tools\export_model.py", line 105, in run trainer.export(FLAGS.output_dir, for_fd=FLAGS.for_fd) File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\engine\trainer.py", line 1294, in export static_model, pruned_input_spec, input_spec = self._get_infer_cfg_and_input_spec( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\engine\trainer.py", line 1240, in _get_infer_cfg_and_input_spec static_model, pruned_input_spec = self._model_to_static(model, input_spec, prune_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\engine\trainer.py", line 1155, in _model_to_static input_spec, static_model.forward.main_program, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 1118, in main_program concrete_program = self.concrete_program ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 1002, in concrete_program return self.concrete_program_specify_input_spec(input_spec=None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 1046, in concrete_program_specify_input_spec concrete_program, _ = self.get_concrete_program( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 935, in get_concrete_program concrete_program, partial_program_layer = self._program_cache[ ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 1694, in __getitem__ self._caches[item_id] = self._build_once(item) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 1631, in _build_once concrete_program = ConcreteProgram.pir_from_func_spec( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\decorator.py", line 235, in fun return caller(func, *(extras + args), **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\base\wrapped_decorator.py", line 40, in __impl__ return wrapped_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\base\dygraph\base.py", line 101, in __impl__ return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\program_translator.py", line 1302, in pir_from_func_spec error_data.raise_new_exception() File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\jit\dy2static\error.py", line 454, in raise_new_exception raise new_exception from None TypeError: In transformed code: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\meta_arch.py", line 59, in forward if self.training: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\meta_arch.py", line 69, in forward for inp in inputs_list: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\meta_arch.py", line 76, in forward outs.append(self.get_pred()) File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\yolo.py", line 150, in get_pred return self._forward() File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\yolo.py", line 92, in _forward if self.training: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\yolo.py", line 103, in _forward if self.for_mot: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\yolo.py", line 115, in _forward if self.return_idx: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\yolo.py", line 119, in _forward elif self.post_process is not None: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\architectures\yolo.py", line 121, in _forward bbox, bbox_num, nms_keep_idx = self.post_process( File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\post_process.py", line 69, in __call__ if self.nms is not None: File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\post_process.py", line 71, in __call__ bbox_pred, bbox_num, before_nms_indexes = self.nms(bboxes, score, File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\layers.py", line 605, in __call__ def __call__(self, bbox, score, *args): return ops.matrix_nms( ~~~~~~~~~~~~~~~~~~~~~~ <--- HERE bboxes=bbox, scores=score, File "D:\pythonProject1\PaddleDetection-release-2.8.1\ppdet\modeling\ops.py", line 714, in matrix_nms helper.append_op( File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\base\layer_helper.py", line 57, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\base\framework.py", line 4701, in append_op op = Operator( File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\paddle\base\framework.py", line 3329, in __init__ raise TypeError( TypeError: The type of '%BBoxes' in operator matrix_nms should be one of [str, bytes, Variable]. but received : Value(define_op_name=pd_op.concat, index=0, dtype=tensor<-1x3840x4xf32>, stop_gradient=False) 中文回答
06-06
c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_tenseal_cpp.dir/build.make:225: CMakeFiles/_tenseal_cpp.dir/tenseal/cpp/tensors/bfvtensor.cpp.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_sealapi_cpp.dir/build.make:160: CMakeFiles/_sealapi_cpp.dir/tenseal/sealapi/sealapi_context.cpp.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_tenseal_cpp.dir/build.make:82: CMakeFiles/_tenseal_cpp.dir/tenseal/sealapi/sealapi.cpp.o] Error 1 c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/tenseal.dir/build.make:108: CMakeFiles/tenseal.dir/tenseal/cpp/tensors/bfvvector.cpp.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_tenseal_cpp.dir/build.make:108: CMakeFiles/_tenseal_cpp.dir/tenseal/sealapi/sealapi_encrypt.cpp.o] Error 1 c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_tenseal_cpp.dir/build.make:212: CMakeFiles/_tenseal_cpp.dir/tenseal/cpp/tensors/bfvvector.cpp.o] Error 1 c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_tenseal_cpp.dir/build.make:277: CMakeFiles/_tenseal_cpp.dir/tenseal/binding.cpp.o] Error 1 c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/_sealapi_cpp.dir/build.make:173: CMakeFiles/_sealapi_cpp.dir/tenseal/sealapi/sealapi_util_namespace.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:452: CMakeFiles/_sealapi_cpp.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... gmake[1]: *** [CMakeFiles/Makefile2:425: CMakeFiles/tenseal.dir/all] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:397: CMakeFiles/_tenseal_cpp.dir/all] Error 2 gmake: *** [Makefile:149: all] Error 2 Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module> main() File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel return _build_backend().build_wheel( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 435, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 423, in _build return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 404, in _build_with_temp_dir self.run_setup() File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 81, in <module> File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 115, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands self.run_command(cmd) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1102, in run_command super().run_command(command) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 370, in run self.run_command("build") File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1102, in run_command super().run_command(command) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1102, in run_command super().run_command(command) File "/tmp/pip-build-env-rh2o3tra/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "<string>", line 46, in run File "<string>", line 78, in build_extension File "/usr/local/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j']' returned non-zero exit status 2. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for tenseal error: failed-wheel-build-for-install × Failed to build installable wheels for some pyproject.toml based projects ╰─> tenseal
08-06
#ifndef __BSP_UART4_H_ #define __BSP_UART4_H_ #include "sys.h" extern void Uart4_Init(const u32 baud_rate); extern void Uart4_Tx_write2buff(const u8 dat); extern void Uart4_RX_ISR_PC(void); extern void Uart4_TX_ISR_PC(void); #endif /* __BSP_UART4_H_ */ #include "bsp_uart4.h" #if UART4_ENABLE struct Uart_Type_t Uart4; /***************************************************************************** 函 数 名 : void Uart4_Init(u32 baud_rate) 功能描述 : 串口4初始化 输入参数 : baud_rate 波特率 输出参数 : 修改历史 : 1.日 期 : 2022年3月9日 作 者 : LYN 修 改 : cuijia *****************************************************************************/ void Uart4_Init(const u32 baud_rate) { u16 i, baud; Uart4.id = 2; Uart4.Tx_Read = 0; Uart4.Tx_Write = 0; Uart4.Tx_Busy = 0; Uart4.Rx_Read = 0; Uart4.Rx_Write = 0; Uart4.Rx_Busy = 0; Uart4.Rx_Flag = 0; for(i = 0; i < UART4_TX_LEN; i++) { Uart4.Tx_Buffer[i] = 0; } for(i = 0; i < UART4_RX_LEN; i++) { Uart4.Rx_Buffer[i] = 0; } P0MDOUT |= 0x03; //P0口输出配置 SCON2T= 0x80 ; //发送使能和模式设置 SCON2R= 0x80; //接受使能和模式设置 ES2R = 1; //中断接受使能 ES2T = 1; //中断发送使能 baud = FOSC/8.0/baud_rate; BODE2_DIV_H = (u8)(baud>>8);//波特率 = CPU 主频/(8*波特率) BODE2_DIV_L = (u8)baud; // P0MDOUT|=(1<<0); //p0^0 强推 TR4 = 0; EA = 1; //中断总控制位:中断是否打开由每个中断的控制位控制。 } /************************************************** 函 数 名 : void Uart4_Tx_write2buff(u8 dat) 功能描述 : 装载串口4发送缓冲 输入参数 : dat:预发送的数据 输出参数 : 修改历史 : 1.日 期 : 2022年3月9日 作 者 : LYN 修改内容 : 创建 ***************************************************/ void Uart4_Tx_write2buff(u8 dat) { /*装发送缓冲*/ Uart4.Tx_Buffer[Uart4.Tx_Write] = dat; /*缓冲队列写指针回头,读指针在前*/ if(Uart4.Tx_Read > Uart4.Tx_Write) { /*若缓冲区满,等待读指针前进*/ while((Uart4.Tx_Write) + 1 == Uart4.Tx_Read); } /*写指针前进*/ ++Uart4.Tx_Write; /*写指针即将回头*/ if(Uart4.Tx_Write >= UART4_TX_LEN) { /*若读指针在头,等待读指针前进*/ while(Uart4.Tx_Read == 0); /*写指针回头*/ Uart4.Tx_Write = 0; } /*空闲*/ if(Uart4.Tx_Busy == 0) { /*标志忙*/ Uart4.Tx_Busy = 1; /*485开启发送*/ TR4=1; /*触发发送中断*/ SCON2T |= 0x1; } } /**************************************************************************** * * 函 数 名 : void Uart4_RX_ISR_PC(void) interrupt 11 * 功能描述 : 串口 4中断接收函数 * 输入参数 : * 输出参数 : * *****************************************************************************/ void Uart4_RX_ISR_PC(void) interrupt 11 { EA = 0; //中断总控制位;所有中断关闭 SCON2R &= 0xFE; Uart4.Rx_Buffer[Uart4.Rx_Write] = SBUF2_RX; Uart4.Rx_Write++; Uart4.Rx_Write %= UART4_RX_LEN; EA = 1; //中断总控制位;中断是否打开由每个中断的控制位控制。 } /**************************************************************************** * * 函 数 名 : Uart4_TX_ISR_PC(void) interrupt 10 * 功能描述 : 串口 4中断发送函数 * 输入参数 : * 输出参数 : * ******************************************************************************/ void Uart4_TX_ISR_PC(void) interrupt 10 { EA = 0; //中断总控制位;所有中断关闭 SCON2T &= 0xFE ; if(Uart4.Tx_Read != Uart4.Tx_Write) { SBUF2_TX = Uart4.Tx_Buffer[Uart4.Tx_Read]; Uart4.Tx_Read++; Uart4.Tx_Read %= UART4_TX_LEN; } else { /*485关闭发送*/ TR4 = 0; Uart4.Tx_Busy = 0; } EA = 1; //中断总控制位;中断是否打开由每个中断的控制位控制。 } #endif #include "sys.h" #include "board.h" #include "task_disp.h" #include "task_factory.h" #include "task_hmi.h" #include "save_data_dgus.h" #include "framework.h" extern u16 task_timer_count; //#define Dgus_Send_Page_Time_Set 0x7000 //u16 Send_Page_Time_Count = 0, Pop_Time_Count = 0xFFFF; u8 use_sed[4]={0x12,0x13,0x23,0x1}; /* 微秒级延时 */ void delayus(unsigned char t) { char i; while(t) { for(i=0;i<50;i++) { i=i; } t--; } } void main() { INIT_CPU(); //系统初始化 PORT_Init(); //IO口初始化 FW_InitSystem(); T0_Init();//定时器0初始化 // T1_Init(); T2_Init();//定时器2初始化 // WDT_ON();//打开开门狗 喂狗在定时器T2中 BSP_InitUart();// 串口初始化 // T5L OS CPU初始化 initcpu(); ws2812_writ_byte(8); //LED初始化 //data_save_init();//数据改变自动保存初始化 //Uart_SendString(5, use_sed, 4); //Write_Dgus(0x0084, 0x01); while(1) { Uart4_Tx_write2buff(0x78); //测试 delayus(1000); Task_Factory_Uart(); //Uart_Read0xF00();//数据自动上传 /* 500ms更新一次数据显示 */ if(499 == task_timer_count % 500) { Task_UpdateDisplay();//相应页面显示刷新对应控件 } Task_Hmi_Uart();//响应用户业务需求 FW_ScanKey();//按键扫描 FW_SlotKeyEvent(); //data_change_sava();//数据改变自动保存 Clock();//时钟 } } C51代码编译后报错,报错信息如下: Build started: Project: T5L_OS *** Note: Rebuilding project, since 'Options->Output->Create Batch File' is selected. Rebuild target 'T5L51' compiling main.c... compiling task_disp.c... compiling task_factory.c... compiling task_hmi.c... 1_App\task_hmi.c(61): warning C280: 'frame': unreferenced local variable 1_App\task_hmi.c(61): warning C280: 'Uart_num': unreferenced local variable compiling framework.c... compiling fw_display.c... compiling fw_key.c... compiling board.c... compiling bsp_dgusii.c... compiling bsp_i2c.c... compiling bsp_io.c... compiling bsp_led.c... compiling bsp_norflash.c... compiling bsp_timer.c... compiling bsp_touch.c... compiling bsp_uart2.c... compiling bsp_uart3.c... compiling bsp_uart4.c... compiling bsp_uart5.c... compiling crc16.c... compiling save_data_dgus.c... compiling sys.c... assembling STARTUP_M5.A51... linking... *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: UART_READ0XF00/TASK_FACTORY *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: WDT_ON/BSP_DGUSII *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: WDT_OFF/BSP_DGUSII *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: WDT_RST/BSP_DGUSII *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _SETPININ/BSP_IO *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _GETPININ/BSP_IO *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _SETPINOUT/BSP_IO *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _NORFLASH_READ/BSP_NORFLASH *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _NORFLASH_WRITE/BSP_NORFLASH *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: FUNCTION_INIT/BSP_NORFLASH *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: FUNCTION_ALL/BSP_NORFLASH *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _START_TIMER/BSP_TIMER *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _GET_TIME_OUT_FLAG/BSP_TIMER *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _DELAY_MS/BSP_TIMER *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _TOUCHSWITCH/BSP_TOUCH *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: DATA_SAVE_INIT/SAVE_DATA_DGUS *** WARNING L57: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: DATA_CHANGE_SAVA/SAVE_DATA_DGUS *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _Uart4_Tx_write2buff MODULE: .\obj\main.obj (MAIN) *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _Uart4_Tx_write2buff MODULE: .\obj\main.obj (MAIN) ADDRESS: 1002AD6H Program Size: data=45.3 xdata=4265 const=407 code=11798 Target not created. Build Time Elapsed: 00:00:02 分析并给出解决方法
07-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值