I'm trying to make my project using Makefile. The Makefile works correctly for other Mac's but bring error in my case.
The output is as follows:
CC kernel.cpp
In file included from kernel.cpp:13:
In file included from ./kernel.hpp:22:
In file included from /usr/local/include/Poco/JSON/Object.h:24:
In file included from /usr/local/include/Poco/JSON/Array.h:25:
In file included from /usr/local/include/Poco/Dynamic/Var.h:26:
In file included from /usr/local/include/Poco/Dynamic/VarHolder.h:24:
In file included from /usr/local/include/Poco/NumberFormatter.h:24:
In file included from /usr/local/include/Poco/NumericString.h:25:
In file included from /usr/local/include/Poco/FPEnvironment.h:35:
In file included from /usr/local/include/Poco/FPEnvironment_C99.h:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: error:
no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: error:
no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: error:
no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/math.h:757:12: note:
'finite' declared here
extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __M...
^
In file included from kernel.cpp:13:
In file included from ./kernel.hpp:22:
In file included from /usr/local/include/Poco/JSON/Object.h:24:
In file included from /usr/local/include/Poco/JSON/Array.h:25:
In file included from /usr/local/include/Poco/Dynamic/Var.h:26:
In file included from /usr/local/include/Poco/Dynamic/VarHolder.h:24:
In file included from /usr/local/include/Poco/NumberFormatter.h:24:
In file included from /usr/local/include/Poco/NumericString.h:25:
In file included from /usr/local/include/Poco/FPEnvironment.h:35:
In file included from /usr/local/include/Poco/FPEnvironment_C99.h:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: error:
no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: error:
no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: error:
no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:7: error:
no member named 'isgreater' in the global namespace; did you mean
'::std::greater'?
using ::isgreater;
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:718:29: note:
'::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from kernel.cpp:13:
In file included from ./kernel.hpp:22:
In file included from /usr/local/include/Poco/JSON/Object.h:24:
In file included from /usr/local/include/Poco/JSON/Array.h:25:
In file included from /usr/local/include/Poco/Dynamic/Var.h:26:
In file included from /usr/local/include/Poco/Dynamic/VarHolder.h:24:
In file included from /usr/local/include/Poco/NumberFormatter.h:24:
In file included from /usr/local/include/Poco/NumericString.h:25:
In file included from /usr/local/include/Poco/FPEnvironment.h:35:
In file included from /usr/local/include/Poco/FPEnvironment_C99.h:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:7: error:
no member named 'isgreaterequal' in the global namespace; did you mean
'::std::greater_equal'?
using ::isgreaterequal;
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:747:29: note:
'::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
The makefile has been tested on Linux platforms, and it's works correctly.
Any recommendations, whats wrong in my Mac c++ configs ?
I'm using MacOS High Sierra(10.13), and Xcode v9.0.1
Edited
This is compiling command:
gcc -pipe -x c++ -std=c++11 -fPIC -pedantic -W -Wall -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith -Wshadow -Wendif-labels -Wundef -Wfloat-equal -Werror -Wconversion -DPROJECT_VERSION="0.0.1" -DUSE_SDK="no" -g -g3 -ggdb3 -D__i386__=1 -D__ppc64__=0 -Wno-sign-conversion -Wno-conversion -Wno-float-equal -Wno-unused-parameter -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/version -I/git/p2p/inc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/version src/kernel.cpp -o /git/p2p/obj/kernel.o
Instead of running gcc -x c++ I recommend you run g++ or, better on MacOS, clang++.
Also, your compile line appears to be missing the -c option which would tell the compiler to generate an object file; without that it will try to link your file and create an executable.
Also I find it very strange that you have added -D__i386__ and -D__ppc64__ to your compile line: those are typically system macros that are defined by your operating system, not provided on the command line of the compiler.
Another potential problem is why you are explicitly adding system header file directories to your compile line with -I. The compiler will add those itself, and using the proper configuration. System headers often require extra care to include in the correct order etc.
If you change to the proper directory and run this from your shell prompt:
clang++ -pipe -std=c++11 -fPIC -pedantic -W -Wall -Wwrite-strings \
-Wcast-align -Wcast-qual -Wpointer-arith -Wshadow -Wendif-labels \
-Wundef -Wfloat-equal -Werror -Wconversion -DPROJECT_VERSION="0.0.1" \
-DUSE_SDK="no" -g -g3 -ggdb3 -Wno-sign-conversion -Wno-conversion \
-Wno-float-equal -Wno-unused-parameter -I/usr/local/include \
-I/usr/local/opt/openssl/include -I/git/p2p/inc \
-c -o /git/p2p/obj/kernel.o src/kernel.cpp
does it compile properly?
Upgrade your packages :
$ brew update
$ brew upgrade
With XCode updated, it could be fixed.
Related
I was trying to use devtool to install a R package,
devtools::install_github("haimbar/SEMMS")
But it says there are some problem with
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:48:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo:23:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_check.hpp:72:4: error: "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
#error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
^
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:48:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo:87:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:152:12: error: unknown type name 'constexpr'
static constexpr bool is_row = false;
^`
I think it is about the clang version but don't know how to fix it.
I am trying to install an R package with the following command:
devtools::install_github('ococrook/bandle)
However, I keep running into compiler issues. When I run the command I get many, many errors. For example this error related to BH:
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c Bessel2ndKind.cpp -o Bessel2ndKind.o
In file included from Bessel2ndKind.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:34:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include/Rcpp.h:59:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include/Rcpp/exceptions_impl.h:38:
In file included from /usr/local/include/execinfo.h:28:
/usr/local/include/os/base.h:274:37: warning: type nullability specifier '_Nullable' is a Clang extension [-Wnullability-extension]
typedef void (*os_function_t)(void *_Nullable);
^
Bessel2ndKind.cpp:621:55: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
nk, tau, D = D, j + 1, nu).t();
~ ^ ~
Bessel2ndKind.cpp:774:49: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
nk, tau, D = D, j + 1).t();
~ ^ ~
In file included from Bessel2ndKind.cpp:2:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include/boost/math/special_functions/bessel.hpp:24:
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include/boost/math/special_functions/detail/bessel_ik.hpp:97:18: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
BOOST_ASSERT(abs(x) <= 2);
^
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include/boost/math/special_functions/detail/bessel_ik.hpp:366:9: note: in instantiation of function template specialization 'boost::math::detail::temme_ik<long double, boost::math::policies::policy<detail::forwarding_arg1, detail::forwarding_arg2>>' requested here
temme_ik(u, x, &Ku, &Ku1, pol); // Temme series
^
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include/boost/math/special_functions/bessel.hpp:246:4: note: in instantiation of function template specialization 'boost::math::detail::bessel_ik<long double, boost::math::policies::policy<detail::forwarding_arg1, detail::forwarding_arg2>>' requested here
bessel_ik(v, x, &I, &K, need_k, pol);
^
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include/boost/math/special_functions/bessel.hpp:258:11: note: in instantiation of function template specialization 'boost::math::detail::cyl_bessel_k_imp<long double, boost::math::policies::policy<detail::forwarding_arg1, detail::forwarding_arg2>>' requested here
return cyl_bessel_k_imp(v, x, bessel_no_int_tag(), pol);
^
Or this error related to RcppArmadillo:
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c leapfrogGPcpp.cpp -o leapfrogGPcpp.o
In file included from leapfrogGPcpp.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:34:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include/Rcpp.h:59:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include/Rcpp/exceptions_impl.h:38:
In file included from /usr/local/include/execinfo.h:28:
/usr/local/include/os/base.h:274:37: warning: type nullability specifier '_Nullable' is a Clang extension [-Wnullability-extension]
typedef void (*os_function_t)(void *_Nullable);
^
In file included from leapfrogGPcpp.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:49:
In file included from /Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include/armadillo:646:
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppArmadillo/include/armadillo_bits/op_inv_meat.hpp:200:28: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
const T abs_det_val = std::abs(det_val);
So far I have tried this, and this, and this, and this. However, so far, none of these solutions have worked and I am running out of ideas on how to solve this.
Any help would be greatly appreciated,
Thanks!
Try following the instructions here and change the default timeout to ensure the relatively large "pRolocdata" package is downloaded completely, i.e.
options(timeout = 600)
devtools::install_github('ococrook/bandle')
Using this approach, Bandle installed with a bunch of warnings but without error on my system.
sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] compiler_4.1.1 tools_4.1.1
My ~/.R/Makevars file:
LOC = /usr/local/gfortran
CC=$(LOC)/bin/gcc -fopenmp
CXX=$(LOC)/bin/g++ -fopenmp
CXX11 = $(LOC)/bin/g++ -fopenmp
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L$(LOC)/lib -Wl,-rpath,$(LOC)/lib
CPPFLAGS=-I$(LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
CXX1X=/usr/local/gfortran/bin/g++
CXX98=/usr/local/gfortran/bin/g++
CXX11=/usr/local/gfortran/bin/g++
CXX14=/usr/local/gfortran/bin/g++
CXX17=/usr/local/gfortran/bin/g++
i am trying to build a little qt project using Qt Creator.
i added this driver to my project: https://github.com/cisco-open-source/qtwebdriver
i includes its libraries,
and when i am trying to build i get this:
g++ -c -pipe -g -std=gnu++1y -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../OfirWebDriverProj -I. -I../ofir/qtwebdriver/out/dist/desktop/release/libs -I../ofir/qtwebdriver/out/dist/desktop/release/libs -I../ofir/qtwebdriver/out/dist/desktop/release/libs -I../ofir/qtwebdriver/out/dist/desktop/release/libs -I../ofir/qtwebdriver/out/desktop/release/Default/lib.target -I../ofir/qtwebdriver/out/desktop/release/Default/lib.target -I../ofir/qtwebdriver/out/desktop/release/Default/lib.target -I../ofir/qtwebdriver/out/desktop/release/Default/lib.target -I../ofir/qtwebdriver/out/dist/desktop/release/h/base -I../ofir/qtwebdriver/out/dist/desktop/release/h -I../ofir/qtwebdriver/out/dist/desktop/release/Test -I/opt/Qt5.9.1/5.9.1/gcc_64/include -I/opt/Qt5.9.1/5.9.1/gcc_64/include/QtWidgets -I/opt/Qt5.9.1/5.9.1/gcc_64/include/QtGui -I/opt/Qt5.9.1/5.9.1/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I/opt/Qt5.9.1/5.9.1/gcc_64/mkspecs/linux-g++ -o main.o ../OfirWebDriverProj/main.cpp
In file included from /usr/include/c++/7/chrono:41:0,
from /opt/Qt5.9.1/5.9.1/gcc_64/include/QtCore/qobject.h:59,
from /opt/Qt5.9.1/5.9.1/gcc_64/include/QtCore/qcoreapplication.h:46,
from /opt/Qt5.9.1/5.9.1/gcc_64/include/QtWidgets/qapplication.h:44,
from /opt/Qt5.9.1/5.9.1/gcc_64/include/QtWidgets/QApplication:1,
from ../OfirWebDriverProj/main.cpp:2:
/usr/include/c++/7/ctime:64:11: error: ‘::clock’ has not been declared
using ::clock;
^~~~~
/usr/include/c++/7/ctime:65:11: error: ‘::difftime’ has not been declared
using ::difftime;
^~~~~~~~
/usr/include/c++/7/ctime:66:11: error: ‘::mktime’ has not been declared
using ::mktime;
^~~~~~
/usr/include/c++/7/ctime:67:11: error: ‘::time’ has not been declared
using ::time;
^~~~
/usr/include/c++/7/ctime:68:11: error: ‘::asctime’ has not been declared
using ::asctime;
^~~~~~~
/usr/include/c++/7/ctime:69:11: error: ‘::ctime’ has not been declared
using ::ctime;
^~~~~
/usr/include/c++/7/ctime:70:11: error: ‘::gmtime’ has not been declared
using ::gmtime;
^~~~~~
/usr/include/c++/7/ctime:71:11: error: ‘::localtime’ has not been declared
using ::localtime;
^~~~~~~~~
/usr/include/c++/7/ctime:72:11: error: ‘::strftime’ has not been declared
using ::strftime;
^~~~~~~~
Probably too late to help the original poster but based on other answers, you probably have a file named time.h in your source. Rename the file (and adjust your code that includes it) to something else like time_utils.h and it should compile.
It can be compiled successfully a few minutes ago.
And the issue cames after my trying to build the project by pressing the "Profile" button. After that, my project cannot be compiled any more.
The error message is:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/latte_prefix.h:24:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/iostream:44:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/ostream:44:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/ios:42:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/iosfwd:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/c++locale.h:48:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/cstdio:52:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/tr1/stdio.h:37:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/cstdio:46:14: error: no member named 'snprintf' in namespace 'std'
using std::snprintf;
~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/cstdio:47:14: error: no member named 'vsnprintf' in namespace 'std'
using std::vsnprintf;
~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/cstdio:49:14: error: no member named 'vfscanf' in namespace 'std'
using std::vfscanf;
~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/cstdio:50:14: error: no member named 'vscanf' in namespace 'std'
using std::vscanf;
~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/cstdio:51:14: error: no member named 'vsscanf' in namespace 'std'
using std::vsscanf;
~~~~~^
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/latte_prefix.h:24:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/iostream:44:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/ostream:44:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/ios:42:
In file included from /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/iosfwd:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/c++locale.h:48:
/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/cstdio:99:11: error: no member named 'FILE' in the global namespace
using ::FILE;
~~^
/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/cstdio:100:11: error: no member named 'fpos_t' in the global namespace
using ::fpos_t;
~~^
/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../../../../../../../../usr/include/c++/4.2.1/cstdio:102:11: error: no member named 'clearerr' in the global namespace
using ::clearerr;
~~^
the compile script is:
ProcessPCH++ /var/folders/r7/g6yvk_7s2zg0w0tndvr74qwc0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/latte_prefix-calwfgjtbaftrwfxqlbgygvcoqtm/latte_prefix.h.pth latte_prefix.h normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte
setenv LANG en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++-header -arch x86_64 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-newline-eof -Wc++11-extensions -DNET_DUMP=0 -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.7 -g -Wno-conversion -Wno-sign-conversion -I/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/build/latte.build/Debug/latte.build/latte.hmap -I/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte -I/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/../../sdk -I/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/build/Debug/include -I/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/build/latte.build/Debug/latte.build/DerivedSources/x86_64 -I/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/build/latte.build/Debug/latte.build/DerivedSources -Wall -F/Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/build/Debug --serialize-diagnostics /var/folders/r7/g6yvk_7s2zg0w0tndvr74qwc0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/latte_prefix-calwfgjtbaftrwfxqlbgygvcoqtm/latte_prefix.h.dia -c /Users/wangyj1203/workspace/project_x/svn/src/c++/src/latte/latte_prefix.h -o /var/folders/r7/g6yvk_7s2zg0w0tndvr74qwc0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/latte_prefix-calwfgjtbaftrwfxqlbgygvcoqtm/latte_prefix.h.pth -MMD -MT dependencies -MF /var/folders/r7/g6yvk_7s2zg0w0tndvr74qwc0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/latte_prefix-calwfgjtbaftrwfxqlbgygvcoqtm/latte_prefix.h.d
snprintf() comes from the C99 standard. You should not use namespace std for it. Just use the global namespace.
Don't forget to include stdio.h
I just got help in how to compile this script a few mintues ago on SO but I have managed to get errors. I am only a beginner in C++ and have no idea what the below erros means or how to fix it.
This is the script in question. I have read the comments from some users suggesting they changed the #include parts but it seems to be exactly what the script has, see this comment.
[root#localhost wkthumb]# qmake-qt4 && make
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I. -o main.o main.cpp
main.cpp:5:20: error: QWebView: No such file or directory
main.cpp:6:21: error: QWebFrame: No such file or directory
main.cpp:8: error: expected constructor, destructor, or type conversion before ‘*’ token
main.cpp:11: error: ‘QWebView’ has not been declared
main.cpp: In function ‘void loadFinished(bool)’:
main.cpp:18: error: ‘view’ was not declared in this scope
main.cpp:18: error: ‘QWebSettings’ has not been declared
main.cpp:19: error: ‘QWebSettings’ has not been declared
main.cpp:20: error: ‘QWebSettings’ has not been declared
main.cpp: In function ‘int main(int, char**)’:
main.cpp:42: error: ‘view’ was not declared in this scope
main.cpp:42: error: expected type-specifier before ‘QWebView’
main.cpp:42: error: expected `;' before ‘QWebView’
make: *** [main.o] Error 1
I have the web kit on my Fedora Core 10 machine:
qt-4.5.3-9.fc10.i386
qt-devel-4.5.3-9.fc10.i386
Thanks all for any help
The error message indicates that the compiler cannot find what you're trying to include, i.e. <QWebView>. The way to tell the compiler where to look is with the -I flag, to specify include directories (these are not recursive).
Currently, you set the following include dirs:
-I/usr/lib/qt4/mkspecs/linux-g++
-I.
-I/usr/include/QtCore
-I/usr/include/QtGui
-I/usr/include
You need to find where QWebView is located on your system, and add the include path to the commandline (or install QWebView into one of the above dirs).
General note: When you get a lot of errors like this, focus on the first one or two. The later errors (such as ‘QWebView’ has not been declared) will probably be solved by fixing the missing-include error.
main.cpp:18: error: ‘view’ was not declared in this scope
Looks like namespaces have to be provided in the code. Read on namespaces.
main.cpp:20: error: ‘QWebSettings’ has not been declared
No type definition available, can be missing include.