error directive #error "Define according the used Cortex core ARM_MATH_CMX

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/banzhuan133/article/details/79739476

最近在做一个工程的移植,从STM32F4移植到STM32L4上,在移植DSP库时出现了该报错:

error directive #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"

查了一些资料给出了解决方案

1.添加文件

在工程目录下新建DSL_LIB,添加arm_cortexM4lf_math.lib和相关头文件


2.添加头文件路径

在Option中添加路径,注意包括两个部分DSB_LIB和DSP_LIB\Include


3.添加全局宏定义

在Option中Define输入的所有宏为

STM32L471xx,USE_HAL_DRIVER,USE_STDPERIPH_DRIVER,ARM_MATH_CM4,__CC_ARM,ARM_MATH_M

第一个根据自己的芯片型号进行对应改变即可

展开阅读全文

python error:[Error 10061]

12-15

刚刚开始学用Python写爬虫,按照教程写了第一个程序:rnrn # -*- coding: UTF-8 -*-rnimport urllibrnrndef demo():rn s = urllib.urlopen('http://www.baidu.com')#返回一个类文件rn print(s.read(100))#读取100个字节并输出rnrnif __name__ == '__main__':rn demo()rnrn输出以下错误,上网搜索了Traceback (most recent call last)和error10061的解决办法,但是依然没有解决,希望大家能帮帮忙。rnC:\Python27\python.exe C:/pythonProjects/urllib_demo.pyrnTraceback (most recent call last):rn File "C:/pythonProjects/urllib_demo.py", line 10, in rn demo()rn File "C:/pythonProjects/urllib_demo.py", line 6, in demorn s = urllib.urlopen('http://www.baidu.com')#返回一个类文件rn File "C:\Python27\lib\urllib.py", line 87, in urlopenrn return opener.open(url)rn File "C:\Python27\lib\urllib.py", line 213, in openrn return getattr(self, name)(url)rn File "C:\Python27\lib\urllib.py", line 350, in open_httprn h.endheaders(data)rn File "C:\Python27\lib\httplib.py", line 1038, in endheadersrn self._send_output(message_body)rn File "C:\Python27\lib\httplib.py", line 882, in _send_outputrn self.send(msg)rn File "C:\Python27\lib\httplib.py", line 844, in sendrn self.connect()rn File "C:\Python27\lib\httplib.py", line 821, in connectrn self.timeout, self.source_address)rn File "C:\Python27\lib\socket.py", line 575, in create_connectionrn raise errrnIOError: [Errno socket error] [Errno 10061] rnrnProcess finished with exit code 1rnrn 论坛

error LNK2028 & error LNK2019

05-26

WordStatProcessor.hrn[code=C/C++]rn#pragma oncernrn#include rn#include rn#include rnrnnamespace WordStat rn class WordStatProcessor rn rn public:rn void process();rn rn private:rn rn ;rnrn[/code]rnrnrnWordStatProcessor.cpprnrn[code=C/C++]rn#include "stdafx.h"rn#include "WordStatProcessor.h"rnrn#include rn#include rn#include rnrnvoid process()rnrn std::ifstream myfile ("c:/example.txt");rn std::string line;rn if (myfile.is_open())rn while (! myfile.eof() )rn std::getline (myfile,line);rn rn myfile.close();rn rnrn[/code]rnrnForm1.hrnrn[code=C/C++]rn#pragma oncernrn#include "WordStatProcessor.h"rnrnnamespace WordStat rnrn using namespace System;rn using namespace System::ComponentModel;rn using namespace System::Collections;rn using namespace System::Windows::Forms;rn using namespace System::Data;rn using namespace System::Drawing;rnrn public ref class Form1 : public System::Windows::Forms::Formrn rn public:rn Form1(void)rn rn InitializeComponent();rn rnrn protected:rn ~Form1()rn rn if (components)rn rn delete components;rn rn rn private: System::Windows::Forms::GroupBox^ groupBox1;rn protected: rn private: System::Windows::Forms::Label^ label1;rn private: System::Windows::Forms::GroupBox^ groupBox2;rn private: System::Windows::Forms::GroupBox^ groupBox3;rn private: System::Windows::Forms::ComboBox^ folderDir;rn private: System::Windows::Forms::Button^ button2;rn private: System::Windows::Forms::Label^ currentState;rn private: System::Windows::Forms::Label^ label2;rn private: System::Windows::Forms::FolderBrowserDialog^ folderBrowserDialog;rnrnrnrn private:rnrn System::ComponentModel::Container ^components;rnrn#pragma region Windows Form Designer generated codernrn void InitializeComponent(void)rn rn ....rn rn#pragma endregionrnprivate: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) rn System::Windows::Forms::DialogResult result = this->folderBrowserDialog->ShowDialog();rn if(result == System::Windows::Forms::DialogResult::OK)rn this->folderDir->Text = this->folderBrowserDialog->SelectedPath;rn rn rnprivate: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) rn WordStat::WordStatProcessor processor;rn processor.process();rn rn;rnrnrnrn[/code]rnrnrn错误rnrn1>------ Build started: Project: WordStat, Configuration: Debug Win32 ------rn1>Compiling...rn1>WordStatProcessor.cpprn1>WordStat.cpprn1>Generating Code...rn1>Linking...rn1>WordStat.obj : error LNK2028: unresolved token (0A000015) "public: void __clrcall WordStat::WordStatProcessor::process(void)" (?process@WordStatProcessor@WordStat@@$$FQAMXXZ) referenced in function "private: void __clrcall WordStat::Form1::button2_Click(class System::Object ^,class System::EventArgs ^)" (?button2_Click@Form1@WordStat@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)rn1>WordStat.obj : error LNK2019: unresolved external symbol "public: void __clrcall WordStat::WordStatProcessor::process(void)" (?process@WordStatProcessor@WordStat@@$$FQAMXXZ) referenced in function "private: void __clrcall WordStat::Form1::button2_Click(class System::Object ^,class System::EventArgs ^)" (?button2_Click@Form1@WordStat@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)rn1>D:\Projects\VisualStudio\WordStat\Debug\WordStat.exe : fatal error LNK1120: 2 unresolved externalsrn1>Build log was saved at "file://d:\Projects\VisualStudio\WordStat\WordStat\Debug\BuildLog.htm"rn1>WordStat - 3 error(s), 0 warning(s)rn========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========rnrn迷糊~~~rnrn 论坛

error C2143 and error C2059

10-28

[b]运行C++程序的时候,老是提示错误[/b]([color=#FF0000]红色部分处,6 errors[/color])rnrn1>f:\c workspace\111026_template_dsaa_p33\111026_template_dsaa_p33\template_dsaa.cpp(189) : error C2143: syntax error : missing ')' before 'constant'rn1>f:\c workspace\111026_template_dsaa_p33\111026_template_dsaa_p33\template_dsaa.cpp(189) : error C2059: syntax error : ')'rn1>f:\c workspace\111026_template_dsaa_p33\111026_template_dsaa_p33\template_dsaa.cpp(190) : error C2143: syntax error : missing ')' before 'constant'rn1>f:\c workspace\111026_template_dsaa_p33\111026_template_dsaa_p33\template_dsaa.cpp(190) : error C2059: syntax error : ')'rn1>f:\c workspace\111026_template_dsaa_p33\111026_template_dsaa_p33\template_dsaa.cpp(191) : error C2143: syntax error : missing ')' before 'constant'rn1>f:\c workspace\111026_template_dsaa_p33\111026_template_dsaa_p33\template_dsaa.cpp(191) : error C2059: syntax error : ')'rnrn[b]想问一下到底是什么原因呢? 怎么样修改这个程序才能运行成功呢?[/b]rnrnrnrn[b]源代码:[/b]rnrn#include rn#include rn#include rnrnusing namespace std;rnrntemplate rnconst Comparable & findMax( const vector & a )rnrn int maxIndex = 0;rnrn for ( int i = 1; i < a.size(); i++ )rn if ( a[ maxIndex ] < a[ i ] )rn maxIndex = i;rnrn return a[ maxIndex ];rnrnrnclass Employeernrnpublic:rn void setValue( const string & n, double s )rn rn name = n;rn salary = s;rn rnrn const string & getName() constrn rn return name;rn rnrn void print( ostream & out ) constrn rn out << name << "( " << salary << " ) ";rn rnrn bool operator< ( const Employee & rhs ) constrn rn return salary < rhs.salary ;rn rnrn //other general accessors and mutators, not shownrnprivate:rn string name;rn double salary;rn;rnrn//define an output operator for Employeernostream & operator<< ( ostream & out, const Employee & rhs )rnrn rhs.print( out );rn return out;rnrnrnint main()rnrn vector v( 3 );rnrn[b] [color=#FF0000]v[0].setValue( "Gegore Bush", 400 000.00 );rn v[1].setValue( "Bill Gates", 2 000 000 000.00 );rn v[2].setValue( "Dr. Phil", 13 000 000.00 );[/[/color]b]rnrn cout << findMax( v ) << endl;rnrn return 0;rn 论坛

没有更多推荐了,返回首页