Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pio init makes QtCreator not understand Arduino C++ properly #1323

Closed
1 task done
hongquan opened this issue Jan 31, 2018 · 4 comments
Closed
1 task done

pio init makes QtCreator not understand Arduino C++ properly #1323

hongquan opened this issue Jan 31, 2018 · 4 comments
Assignees
Milestone

Comments

@hongquan
Copy link

What kind of issue is this?

  • PlatformIO Core. If you’ve found a bug, please provide an information below.

Configuration

Operating system: Ubuntu 17.10

PlatformIO Version (platformio --version): 3.5.2a5

Description of problem

Steps to Reproduce

  1. Have an Arduino project
  2. Run pio init --ide qtcreator --board esp07
  3. Open the .ino file in QtCreator

Actual Results

.pro file contains DEFINES lines like this:

DEFINES += ARDUINO=10600
DEFINES += LWIP_OPEN_SRC

and QtCreator shows some errors in .ino: "expected a declaration".

Expected Results

There should be no "expected a declaration" error.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:esp07]
platform = espressif8266
board = esp07
framework = arduino

Source file to reproduce issue:

Insert here...

Additional info

This is the result of attempt to fix #1299.

Before the fix (with the trailing "#" being stripped):

pio-old

After the fix:

pio_v3 5 2a5

I used to proposed a fix (#1290), in which I keep the quote (") and removed # from DEFINES, but unfortunately, it was rejected.

@ivankravets
Copy link
Member

Please re-test with pio upgrade --dev and pio init

@hongquan
Copy link
Author

hongquan commented Feb 6, 2018

In 53afdc5, I see that you are doing:

% tokens = define.split("##", 1)
DEFINES += "{{tokens[0].strip()}}"

but what happen if some lines use single #?

@ivankravets
Copy link
Member

The problem was caused by internal macros of GCC compiler. We've started to add them recently. There is no # in macro, see https://stackoverflow.com/questions/21891784/what-does-mean-in-c

@hongquan
Copy link
Author

hongquan commented Feb 6, 2018

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants