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

Some auto-installed library do not compile, but adding this library manually do the trick #985

Closed
1 task
Elmaranin opened this issue Jun 21, 2017 · 1 comment
Labels
Milestone

Comments

@Elmaranin
Copy link

What kind of issue is this?

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

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: linux

PlatformIO Version (platformio --version): 3.3.1, tested on 3.0.4b12 also

Description of problem

Some automatically installed libraries do not compile, but they do compile normally if place them in "lib" dir manually.
My project uses "espressif8266" platform, but I don't think it matters.

Steps to Reproduce

  1. Create empty project, add to environment config: lib_deps = https://github.com/Imroy/pubsubclient.git
  2. Get from this library example folder "mqtt_basic.ino" file and place it in platformio project sources dir
  3. Try to run project

Actual Results

error while compiling

Compiling .pioenvs/board/src/mqtt_basic.ino.o
Archiving .pioenvs/board/libFrameworkArduinoVariant.a
sh: 1: Syntax error: "(" unexpected
Indexing .pioenvs/board/libFrameworkArduinoVariant.a

Expected Results

compilation completes with no errors

If problems with PlatformIO Build System:

looks like it is, some logs in "actual results"

The content of platformio.ini:

[platformio]

[env:board]
platform = espressif8266
framework = arduino
board = esp01
lib_deps = https://github.com/Imroy/pubsubclient/archive/master.zip
upload_port = /dev/ttyUSB0
targets = upload

Source file to reproduce issue:
mqtt_basic.txt

#include <ESP8266WiFi.h>
#include <PubSubClient.h>

const char *ssid =	"xxxxxxxx";		// cannot be longer than 32 characters!
const char *pass =	"yyyyyyyy";		//

// Update these with values suitable for your network.
IPAddress server(172, 16, 0, 2);

void callback(const MQTT::Publish& pub) {
  // handle message arrived
}

WiFiClient wclient;
PubSubClient client(wclient, server);

void setup() {
  // Setup console
  Serial.begin(115200);
  delay(10);
  Serial.println();
  Serial.println();

  client.set_callback(callback);
}

void loop() {
  if (WiFi.status() != WL_CONNECTED) {
    Serial.print("Connecting to ");
    Serial.print(ssid);
    Serial.println("...");
    WiFi.begin(ssid, pass);

    if (WiFi.waitForConnectResult() != WL_CONNECTED)
      return;
    Serial.println("WiFi connected");
  }

  if (WiFi.status() == WL_CONNECTED) {
    if (!client.connected()) {
      if (client.connect("arduinoClient")) {
	client.publish("outTopic","hello world");
	client.subscribe("inTopic");
      }
    }

    if (client.connected())
      client.loop();
  }
}

Additional info

The main misunderstanding is that if I place the same library to project "lib" directory and remove "lib_deps" from environment config - everything will compiles just great without any errors

@ivankravets ivankravets added this to the 3.4.0 milestone Jun 24, 2017
@ivankravets
Copy link
Member

Thanks a lot for a report!

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

No branches or pull requests

2 participants