GithubHelp home page GithubHelp logo

Comments (4)

maxgerhardt avatar maxgerhardt commented on May 27, 2024

Cross-posted to https://community.platformio.org/t/multiple-include/28287

from asyncudp_wt32_eth01.

khoih-prog avatar khoih-prog commented on May 27, 2024

Hi @wmarchewka

This library is current using h-only style, and to use it correctly, you have either use the h-only style for your code or to include the library h files a little bit more carefully.

For example

A) h-only style

1. main.cpp

#include "UdpListener.h"

UdpListener udp_server;

void setup()
{
  delay(1);
}

void loop()
{
  delay(1);
}

2. UdpListener.h

#pragma once

#ifndef UDPLISTENER_H
#define UDPLISTENER_H

#include <AsyncUDP_WT32_ETH01.h>

class UdpListener
{

  private :

  public:
    UdpListener();
};

#include "UdpListener_Impl.h"

#endif

3. UdpListener_Impl.h

#pragma once

#ifndef UDPLISTENER_IMPL_H
#define UDPLISTENER_IMPL_H

UdpListener::UdpListener()
{
}

#endif

Also have a look at Fixed linker errors when included in multiple .cpp files #1

Anyway, I'll convert this outdated library later to use the same style as AsyncUDP_Teensy41 library, then you can use the example similar to multiFileProject

Thanks to @maxgerhardt for the providing the solution in https://community.platformio.org/t/multiple-include/28287

from asyncudp_wt32_eth01.

wmarchewka avatar wmarchewka commented on May 27, 2024

Thanks all !

from asyncudp_wt32_eth01.

khoih-prog avatar khoih-prog commented on May 27, 2024

Hi @wmarchewka

Check the new AsyncUDP_WT32_ETH01 release v2.1.0 and the multiFileProject


Releases v2.1.0

  1. Fix multiple-definitions linker error. Check Multiple definitions #1
  2. Add example multiFileProject to demo for multiple-file project to avoid multiple-definitions linker error

from asyncudp_wt32_eth01.

Related Issues (3)

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.