Hello, folks.
I'm trying to upgrade a port I made years ago. But I'm stuck. I'm not a skilled C++ developer, so I really need help to figure out what to do here. I'm trying RTFM with no luck for days... and I spent a lot of time porting new dependencies for this app first.
What encourages me to ask is an simple code example I found in a gcc bug track, that raises quite the same error. So I don't understand if it is something related to the compiler ( a bug), or something that needed a patch (porting) or even a good and old workaround !
I have the same problem whatever using c++ or g++ .
The compiler stops with this file:
transmitter.h :
Raising this error (a hint, it repeats a lot until stop reaching err limit):
I'm really lost, since I see it happens out of this port, while trying to find an answer. I can't neither compile this simple program too (found here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24012 ):
Or this variation I made:
The error of the code above:
I'd appreciate a little help.
I'm trying to upgrade a port I made years ago. But I'm stuck. I'm not a skilled C++ developer, so I really need help to figure out what to do here. I'm trying RTFM with no luck for days... and I spent a lot of time porting new dependencies for this app first.
What encourages me to ask is an simple code example I found in a gcc bug track, that raises quite the same error. So I don't understand if it is something related to the compiler ( a bug), or something that needed a patch (porting) or even a good and old workaround !
I have the same problem whatever using c++ or g++ .
The compiler stops with this file:
transmitter.h :
Code:
#ifndef __libmisc_transmitter_h__
#define __libmisc_transmitter_h__
//#include <wchar.h> //testing
#include <sstream> //THIS IS LINE 24, where c++ or g++ complains
#include <iostream>
#include <pbd/signals.h>
#include "pbd/libpbd_visibility.h"
//using namespace std; //testing
class LIBPBD_API Transmitter : public std::stringstream
{
... more code
Raising this error (a hint, it repeats a lot until stop reaching err limit):
Code:
[846/881] cxx: libs/fst/scanner.cc -> build/libs/fst/scanner.cc.1.o
In file included from ../libs/fst/scanner.cc:9:
In file included from /usr/home/marcelbonnet/devel/ports/PORTS/audio/ardour-devel/work/ardour-devel-5.3/libs/pbd/pbd/transmitter.h:24:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:437:
/usr/include/c++/v1/cstdio:143:9: error: no member named 'snprintf' in the global namespace
using ::snprintf;
~~^
/usr/include/c++/v1/cstdio:148:9: error: no member named 'vfscanf' in the global namespace; did you mean 'fscanf'?
using ::vfscanf;
~~^
/usr/include/stdio.h:248:6: note: 'fscanf' declared here
int fscanf(FILE * __restrict, const char * __restrict, ...);
^
In file included from ../libs/fst/scanner.cc:9:
In file included from /usr/home/marcelbonnet/devel/ports/PORTS/audio/ardour-devel/work/ardour-devel-5.3/libs/pbd/pbd/transmitter.h:24:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:437:
/usr/include/c++/v1/cstdio:149:9: error: no member named 'vscanf' in the global namespace
using ::vscanf;
~~^
/usr/include/c++/v1/cstdio:150:9: error: no member named 'vsscanf' in the global namespace; did you mean 'sscanf'?
using ::vsscanf;
~~^
/usr/include/stdio.h:268:6: note: 'sscanf' declared here
int sscanf(const char * __restrict, const char * __restrict, ...);
^
I'm really lost, since I see it happens out of this port, while trying to find an answer. I can't neither compile this simple program too (found here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24012 ):
Code:
#define _POSIX_C_SOURCE 1
#include <iostream>
using namespace std;
int main () {
return 0;
}
Or this variation I made:
Code:
//#include <wchar.h> //works adding this include and preserving the next include
#define _POSIX_C_SOURCE 1
#include <iostream>
using namespace std;
int main () {
int x = 10;
int y = 20;
{
int x; // ok, inner scope.
x = 50; // sets value to inner x
y = 50; // sets value to (outer) y
cout << "inner block:\n";
cout << "x: " << x << '\n';
cout << "y: " << y << '\n';
}
cout << "outer block:\n";
cout << "x: " << x << '\n';
cout << "y: " << y << '\n';
return 0;
}
The error of the code above:
Code:
In file included from teste.cpp:3:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:437:
/usr/include/c++/v1/cstdio:143:9: error: no member named 'snprintf' in the global namespace
using ::snprintf;
~~^
/usr/include/c++/v1/cstdio:148:9: error: no member named 'vfscanf' in the global namespace; did you mean 'fscanf'?
using ::vfscanf;
~~^
/usr/include/stdio.h:248:6: note: 'fscanf' declared here
int fscanf(FILE * __restrict, const char * __restrict, ...);
^
In file included from teste.cpp:3:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:437:
/usr/include/c++/v1/cstdio:149:9: error: no member named 'vscanf' in the global namespace
using ::vscanf;
~~^
/usr/include/c++/v1/cstdio:150:9: error: no member named 'vsscanf' in the global namespace; did you mean 'sscanf'?
using ::vsscanf;
~~^
/usr/include/stdio.h:268:6: note: 'sscanf' declared here
int sscanf(const char * __restrict, const char * __restrict, ...);
^
...
I'd appreciate a little help.