Skip to content

sketch compilation error #13

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

Closed
Maker39 opened this issue Jun 26, 2020 · 3 comments
Closed

sketch compilation error #13

Maker39 opened this issue Jun 26, 2020 · 3 comments

Comments

@Maker39
Copy link

Maker39 commented Jun 26, 2020

Greetings!
I need help.
I have WinXP, Arduino IDE 1.8.9, ESP8266 by ESP8266 community version 2.7.1 and Wemos D1 mini Pro.
I am trying to compile the printserver.ino sketch without any changes (installed the CH375 and
CH375USBPrinter libraries from the ZIP ).
I get an error:
"fork/exec C:\Documents and Settings\Admin\Local Settings\Application Data\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3.exe: %1 is not a valid Win32 application.
Error compiling for board LOLIN(WEMOS) D1 R2 & mini."
How to fix this error?

And another question: I need to connect the printer as direct parallel. To do this, you will only need to include the appropriate section in the sketch, or will you need to do someone else?

@Maker39 Maker39 changed the title sketch assembly error sketch compilation error Jun 27, 2020
@gianluca-nitti
Copy link
Owner

Hello,

the build error doesn't seem related to this particular sketch but rather to the Arduino/ESP8266 IDE setup. There are similar reports, for example, here and here.

And another question: I need to connect the printer as direct parallel. To do this, you will only need to include the appropriate section in the sketch, or will you need to do someone else?

There should be no other adjustments required besides editing the main file (printserver.ino) to resemble your hardware configuration.

@Maker39
Copy link
Author

Maker39 commented Jun 28, 2020

thanks for the answer.
I read this and reinstalled ESP8266 to version 2.5.0 - the error is gone.
Now when compiling printserver.ino (without any changes) I have
no matching function for call to 'CH375::setBaudRate(int, USBPortPrinter::ensureInitialized()::__lambda0)'

C:\DOCUME1\Admin\LOCALS1\Temp\arduino_build_14710\sketch\USBPortPrinter.cpp: In member function 'bool USBPortPrinter::ensureInitialized()':

USBPortPrinter.cpp:27:69: error: no matching function for call to 'CH375::setBaudRate(int, USBPortPrinter::ensureInitialized()::__lambda0)'

if(!ch375.setBaudRate(100000, this{ch375stream.begin(100000);})) return false;

                                                                 ^

C:\DOCUME1\Admin\LOCALS1\Temp\arduino_build_14710\sketch\USBPortPrinter.cpp:27:69: note: candidate is:

In file included from C:\Documents and Settings\Admin\Arduino\libraries\CH375-Arduino-master\src/CH375USBPrinter.h:2:0,

             from C:\DOCUME~1\Admin\LOCALS~1\Temp\arduino_build_14710\sketch\USBPortPrinter.h:20,

             from C:\DOCUME~1\Admin\LOCALS~1\Temp\arduino_build_14710\sketch\USBPortPrinter.cpp:18:

C:\Documents and Settings\Admin\Arduino\libraries\CH375-Arduino-master\src/CH375.h:108:10: note: bool CH375::setBaudRate(uint32_t, void (*)())

 bool setBaudRate(uint32_t baudRate, void (*setLocalBaudRate)(void));

      ^

C:\Documents and Settings\Admin\Arduino\libraries\CH375-Arduino-master\src/CH375.h:108:10: note: no known conversion for argument 2 from 'USBPortPrinter::ensureInitialized()::__lambda0' to 'void (*)()'

Using library ESP8266WiFi at version 1.0 in folder: C:\Documents and Settings\Admin\Local Settings\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi
Using library SoftwareSerial at version 1.0 in folder: C:\Documents and Settings\Admin\Local Settings\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\SoftwareSerial
Using library CH375-Arduino-master at version 0.1.0 in folder: C:\Documents and Settings\Admin\Arduino\libraries\CH375-Arduino-master
exit status 1
no matching function for call to 'CH375::setBaudRate(int, USBPortPrinter::ensureInitialized()::__lambda0)'

@gianluca-nitti
Copy link
Owner

Sorry for the delay.

The no matching function for call to 'CH375::setBaudRate(int, USBPortPrinter::ensureInitialized()::__lambda0)' was caused by the fact that lambdas that capture arguments cannot be passed as function pointers (it worked a while ago so I assume it worked accidentally in older gcc versions and was removed to comply with the C++ spec).

I fixed the library so that it uses the proper std::function type in commit 6a78463; with the updated library I can now compile the sketch successfully.

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

No branches or pull requests

2 participants