Comments (4)
Cross-posted to https://community.platformio.org/t/multiple-include/28287
from asyncudp_wt32_eth01.
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.
Thanks all !
from asyncudp_wt32_eth01.
Hi @wmarchewka
Check the new AsyncUDP_WT32_ETH01 release v2.1.0 and the multiFileProject
Releases v2.1.0
- Fix multiple-definitions linker error. Check Multiple definitions #1
- 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncudp_wt32_eth01.