GithubHelp home page GithubHelp logo

Comments (7)

github0null avatar github0null commented on August 22, 2024

因为 keil 内是安装了 STM32 固件包的, 如果你知道头文件所在目录,可以在 自定义依赖中 添加 头文件目录, 当然你也可以 直接安装 keil 包, 可以在arm官网下载,安装完包之后,可以直接添加依赖,完成头文件目录的设置

from eide.

qihuanlu01 avatar qihuanlu01 commented on August 22, 2024

添加过了,还是不行。declaration may not appear after executable statement in block
FlagStatus pwrclkchanged = RESET;
^
还是这个问题,头文件应该有了,就是加载在.c文件后面。我是导入的keil项目,stm的固件包安装过了。
要是能直接打开原项目就好了,现在都有git了,觉得原项目备份没必要

from eide.

github0null avatar github0null commented on August 22, 2024

1. 出现这个错误应该是代码的问题,,编译工具是 Keil ARMCC,默认的语言标准是 C89, 变量声明不能在语句后, 你可以在编译选项->languageMode 中更改语言标准

2. 这样做的目的并不是为了备份原项目,Keil 项目的文件很分散,并且 keil 的源文件是 ANSI 编码的,在 vsCode 上是乱码,而且不便于 vscode-cpptools 进行语法分析,这样写代码的体验就和 Keil 一样惨不忍睹了,就偏离了原来的初衷, 因此本插件在导入时会创建新的项目而不是直接使用 Keil 的 .uvprojx 文件

from eide.

github0null avatar github0null commented on August 22, 2024

包含头文件是预编译命令,在编译前头文件就被直接嵌入了源文件,是不存在在源文件之后加载的,除非你的语句写在 #include 前面

from eide.

github0null avatar github0null commented on August 22, 2024

这些问题会改进的

from eide.

qihuanlu01 avatar qihuanlu01 commented on August 22, 2024

是编译选项的问题,不是代码的问题。更改了编译选项就好了,
给点建议 能不能把Keil的编译选项直接拷贝过来啊,

from eide.

github0null avatar github0null commented on August 22, 2024

可以的,以后的版本会改进的

from eide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.