Closed Ant1r closed 3 years ago
So it could be related to compiling with g++ instead of gcc.
I don't know if that's the problem, but I think you should build the C files with gcc, yes.
I am also updating this to pd 0.51-3 when it is finalized, although the multi instance support is not quite working well due to a number of reasons. The multi example here doesn't run very well.
OK, I'm starting to understand.
In the file usr/include/boost/io/detail/quoted_manip.hpp
, the name "_s"
is used once in a function declaration:
quoted_proxy(String s_, Char escape_, Char delim_) : string(s_), escape(escape_), delim(delim_) {}
But since "_s"
is replaced with "(pd_this->pd_s_)"
by m_pd.h
, the compiler throws an error while parsing quoted_manip.hpp
.
So currently PDINSTANCE is incompatible with compiling with boost... The problem is OF doesn't allow to selectively choose the compiler.
Build libpd separately and link the .a. I just merged a PR which adds a STATIC=true makefile option and poops out a libpd.a into the libs
directory.
OK I found a fix!
in the top of ofxPd.cpp, add
#include "ofMain.h"
before
#include "ofxPd.h"
This way, OF stuff (including boost one) is parsed before m_pd.h can polute the namespace, and the error disappears!
Oophh. ofMain.h is huge and I try not to bring it in when I can. Can you try ofConstants.h first?
Adding ofConstants.h
doesn't work.
The smallest possible OF file is ofFileUtils.h
, because it's the only one that includes boost/filesystem.hpp
, which in turn calls boost/filesystem/path.hpp
, which calls boost/io/detail/quoted_manip.hpp
...
IMO including ofFileUtils.h
seems a bit obscure, while ofMain.h
is simpler to understand; and it's only impacting ofxPd.cpp
compilation.
But I'd be fine with ofFileUtils.h
if you prefer. It would fix my problem anyway.
I'd prefer ofFileUtils.h
. Should be fixed with f8728c5 I mean 0935775
thanks!
I have a strange error while trying to make pdMultiExample after defining PDINSTANCE and PDTHREADS from the config.make file:
PROJECT_CFLAGS = -DHAVE_UNISTD_H -DUSEAPI_DUMMY -DPD -DLIBPD_EXTRA -DLIBPD_USE_STD_MUTEX -DPDINSTANCE -DPDTHREADS
the compiler complains:
It seems that the error is only triggered for the
s_
symbol definition: if I comment this line out, ofxPd.cc compiles fine (obviously some of puredata source files cannot compile anymore). BTW I successfully compiledlibpd/samples/c/pdtest_multi
, which also defines of PDINSTANCE and PDTHREADS. So it could be related to compiling with g++ instead of gcc.Any idea?