Hi,
Yesterday, I tried to compile libmf (a recommender system) on FreeBSD 10 amd64, using G++ 4.8 from ports. However, it failed with many errors like this one:
On the other hand, it can be compiled under Linux and OpenBSD successfully (using G++ 4.8 too). I know I can add
P.S.
And I just write a very simple C++ source file called iprintf.cpp and try to compile it on Linux, FreeBSD and OpenBSD using G++ 4.8:
1. Fedora Linux 20
When I compile it with the command
2. FreeBSD 10.0
No matter I use
3. OpenBSD 5.5
It compiles successfully no matter I use
I'm now confused... :OOO
Yesterday, I tried to compile libmf (a recommender system) on FreeBSD 10 amd64, using G++ 4.8 from ports. However, it failed with many errors like this one:
Code:
src/convert.cpp:16:60: error: 'printf' was not declared in this scope
printf("usage: libmf convert text_file [binary_file]\n");
#include<cstdio>
to src/convert.cpp
, to eliminate the errors, but why there are no errors on Linux and OpenBSD if cstdio is required by printf?P.S.
And I just write a very simple C++ source file called iprintf.cpp and try to compile it on Linux, FreeBSD and OpenBSD using G++ 4.8:
Code:
#include<iostream>
int
main() {
printf("printf");
return 0;
}
1. Fedora Linux 20
When I compile it with the command
g++ -o iprintf iprintf.cpp
, it complains 'printf' was not declared in this scope; however, if I use g++ -o iprintf iprintf.cpp -std=c++0x
, it compiles successfully.2. FreeBSD 10.0
No matter I use
g++48 -o iprintf iprintf.cpp
or g++48 -o iprintf iprintf.cpp -std=c++0x
, it always fails with 'printf' was not declared in this scope.3. OpenBSD 5.5
It compiles successfully no matter I use
eg++ -o iprintf iprintf.cpp
or eg++ -o iprintf iprintf.cpp -std=c++0x
.I'm now confused... :OOO