Comments (13)
What errors do you get?
from znc-modules.
ZNC Version 1.2
I had to change the include lines to
#include <znc/Chan.h>
#include <znc/Modules.h>
#include <pcrecpp.h>
At that point there is a flood of errors.
Building "highlightattach.so" for ZNC 1.2... highlightattach.cpp:142:5: error: ‘vector’ does not name a type
vector<CPattern> m_vPatterns;
^
highlightattach.cpp: In member function ‘bool CHighlightAttach::Add(const CString&)’:
highlightattach.cpp:105:9: error: ‘vector’ was not declared in this scope
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:105:9: note: suggested alternative:
In file included from /usr/include/c++/4.8/vector:64:0,
from /usr/include/znc/ZNCString.h:24,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_vector.h:210:11: note: ‘std::vector’
class vector : protected _Vector_base<_Tp, _Alloc>
^
highlightattach.cpp:105:24: error: expected primary-expression before ‘>’ token
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:105:25: error: ‘::iterator’ has not been declared
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:105:25: note: suggested alternatives:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
from /usr/include/c++/4.8/bits/stl_tree.h:61,
from /usr/include/c++/4.8/map:60,
from /usr/include/znc/ZNCString.h:21,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
struct iterator
^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
highlightattach.cpp:105:36: error: expected ‘;’ before ‘it’
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:106:16: error: ‘it’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp:106:22: error: ‘m_vPatterns’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp:112:9: error: ‘m_vPatterns’ was not declared in this scope
m_vPatterns.push_back(pattern);
^
highlightattach.cpp: In member function ‘bool CHighlightAttach::Delete(const CString&)’:
highlightattach.cpp:119:9: error: ‘vector’ was not declared in this scope
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:119:9: note: suggested alternative:
In file included from /usr/include/c++/4.8/vector:64:0,
from /usr/include/znc/ZNCString.h:24,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_vector.h:210:11: note: ‘std::vector’
class vector : protected _Vector_base<_Tp, _Alloc>
^
highlightattach.cpp:119:24: error: expected primary-expression before ‘>’ token
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:119:25: error: ‘::iterator’ has not been declared
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:119:25: note: suggested alternatives:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
from /usr/include/c++/4.8/bits/stl_tree.h:61,
from /usr/include/c++/4.8/map:60,
from /usr/include/znc/ZNCString.h:21,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
struct iterator
^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
highlightattach.cpp:119:36: error: expected ‘;’ before ‘it’
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:120:16: error: ‘it’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp:120:22: error: ‘m_vPatterns’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp: In member function ‘bool CHighlightAttach::Matches(CString&)’:
highlightattach.cpp:132:9: error: ‘vector’ was not declared in this scope
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:132:9: note: suggested alternative:
In file included from /usr/include/c++/4.8/vector:64:0,
from /usr/include/znc/ZNCString.h:24,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_vector.h:210:11: note: ‘std::vector’
class vector : protected _Vector_base<_Tp, _Alloc>
^
highlightattach.cpp:132:24: error: expected primary-expression before ‘>’ token
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:132:25: error: ‘::iterator’ has not been declared
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:132:25: note: suggested alternatives:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
from /usr/include/c++/4.8/bits/stl_tree.h:61,
from /usr/include/c++/4.8/map:60,
from /usr/include/znc/ZNCString.h:21,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
struct iterator
^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
highlightattach.cpp:132:36: error: expected ‘;’ before ‘it’
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:133:16: error: ‘it’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp:133:22: error: ‘m_vPatterns’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp: In member function ‘void CHighlightAttach::ListCmd(const CString&)’:
highlightattach.cpp:155:9: error: ‘vector’ was not declared in this scope
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:155:9: note: suggested alternative:
In file included from /usr/include/c++/4.8/vector:64:0,
from /usr/include/znc/ZNCString.h:24,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_vector.h:210:11: note: ‘std::vector’
class vector : protected _Vector_base<_Tp, _Alloc>
^
highlightattach.cpp:155:24: error: expected primary-expression before ‘>’ token
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:155:25: error: ‘::iterator’ has not been declared
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:155:25: note: suggested alternatives:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
from /usr/include/c++/4.8/bits/stl_tree.h:61,
from /usr/include/c++/4.8/map:60,
from /usr/include/znc/ZNCString.h:21,
from /usr/include/znc/Nick.h:21,
from /usr/include/znc/Chan.h:21,
from highlightattach.cpp:24:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
struct iterator
^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: note: ‘std::iterator’
highlightattach.cpp:155:36: error: expected ‘;’ before ‘it’
vector<CPattern>::iterator it = m_vPatterns.begin();
^
highlightattach.cpp:156:16: error: ‘it’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
highlightattach.cpp:156:22: error: ‘m_vPatterns’ was not declared in this scope
for (; it != m_vPatterns.end(); ++it) {
^
[ !! ] Error while building "highlightattach.so"
from znc-modules.
Try
using std::vector;
at the top.
from znc-modules.
That did the trick :)
#include <znc/Chan.h>
#include <znc/Modules.h>
#include <pcrecpp.h>
using std::vector;
from znc-modules.
That did the trick for compiling it, thanks. The thing is I'm getting this error when trying to load it: "Unable to find modinfo [highlightattach] [Unable to open module [highlightattach] [/usr/local/lib/znc/highlightattach.so: undefined symbol: _ZN7pcrecpp2RE6no_argE]]"
I googled around for an hour and all I could find is some people who had that error a long time ago and got it fixed by either updating or downgrading pcre++. I have pcre++ installed and on the newest version. On another website, where someone else was getting the same line, it was said "my guess is that somehow you compiled with one version of the library, but are actually running it with another".
I don't know how znc-buildmod works and how I could check if that's true. ldd didn't clarify anything to me, and I'm pretty helpless when it comes to Linux.
from znc-modules.
It seems the PCRE regex library can't be loaded.
from znc-modules.
I installed PCRE 8.36 and PCRE2 10.10 from the tar files from the official website. No luck there. Do you know what I could do?
from znc-modules.
Was the library not in your distro's package manager?
from znc-modules.
It was, but trying to update it didn't have any effect. I'm on Debian Wheezy.
from znc-modules.
Any fix for it possible, i have the same problem. OS = ubuntu
from znc-modules.
I created a pull request based on this
#2
from znc-modules.
@Xtravaganz @SkewerR @sk89q
I was able to load and compile it fine by using
LIBS="-lpcrecpp" znc-buildmod highlightattach.cpp
to compile it after making the previously mentioned source code modifications.
from znc-modules.
Warning: I had to shutdown znc for the module to even load at all.
After what seemed a successful compile using
# znc-buildmod highlightattach.cpp
I tried /znc loadmod highlightattach
but my client, *status reported...
Unable to find modinfo [highlightattach] [Unable to open module [highlightattach] [/usr/local/lib/znc/highlightattach.so: Undefined symbol "_ZN7pcrecpp2RE6no_argE"]]
Recognising the pcrecpp from this thread, building on FreeBSD was now a case of ...
# setenv LIBS "-lpcrecpp" && znc-buildmod highlightattach.cpp
just as @alyptik nailed, but for his distro (so a slightly diff way to set the env on FreeBSD).
However, I've enabled the module in the webui for the user that I want to reattach, added a plain word to match 'test', but that didnt work here. I guess there is an actual issue somewhere in the code now, and not a build issue anymore.
I am building against latest znc source Jan 2018 @ github
from znc-modules.
Related Issues (1)
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 znc-modules.