Can't install OpenGLRaw-1.1.0.1 on OS X - opengl

When I run
$ cabal install OpenGLRaw
I get the following errors.
... ... ...
cbits/HsOpenGLRaw.c:78:20:
error: stdlib.h: No such file or directory
cbits/HsOpenGLRaw.c:79:19:
error: dlfcn.h: No such file or directory
cbits/HsOpenGLRaw.c: In function ‘hs_OpenGLRaw_getProcAddress’:
cbits/HsOpenGLRaw.c:97:0:
error: ‘NULL’ undeclared (first use in this function)
cbits/HsOpenGLRaw.c:97:0:
error: (Each undeclared identifier is reported only once
cbits/HsOpenGLRaw.c:97:0: error: for each function it appears in.)
cbits/HsOpenGLRaw.c:104:0:
warning: implicit declaration of function ‘dlopen’
cbits/HsOpenGLRaw.c:104:0:
error: ‘RTLD_LAZY’ undeclared (first use in this function)
cbits/HsOpenGLRaw.c:104:0:
warning: assignment makes pointer from integer without a cast
cbits/HsOpenGLRaw.c:115:0:
warning: implicit declaration of function ‘dlsym’
cbits/HsOpenGLRaw.c:115:0:
warning: assignment makes pointer from integer without a cast
cbits/HsOpenGLRaw.c:126:0:
warning: return makes pointer from integer without a cast
cabal: Error: some packages failed to install:
OpenGLRaw-1.1.0.1 failed during the building phase. The exception was:
ExitFailure 1
I just installed the latest Haskell Platform for OS X and ran cabal update for good measure.

Looks to me like ticket #5011 - XCode 4 on Mac + GHC 7.0.2 fails to link.
This is fixed in GHC 7.0.3 which will be part of the mid-April release of the Haskell Platform.
And alternative fix is to downgrade to the 2010.2 Haskell Platform.

Related

R: Compilation error "ISO C++ forbids in-class initialization of non-const static member" when installing feather package

I'm using R version 3.1.2 and want to install the "feather" package in RStudio:
install.packages("feather", type="source")
Using a source version because there doesn't seem to be a binary version.
It does extract the file and checks for MD5 sums correctly, but throws errors for several sub-steps:
error: ISO C++ forbids in-class initialization of non-const static member 'xy'
Here's an extract of what exactly RStudio tells me:
from c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/algorithm:63,
from ./feather/buffer.h:18,
from ./feather/metadata.h:23,
from ./feather/reader.h:21,
from feather/feather-c.cc:21:
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:196:57: error: ISO C++ forbids in-class initialization of non-const static member 'is_specialized'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:201:48: error: ISO C++ forbids in-class initialization of non-const static member 'digits'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:204:50: error: ISO C++ forbids in-class initialization of non-const static member 'digits10'
...(for many other parts)...
(also for some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1587:58: note: 'bool std::numeric_limits::has_quiet_NaN' is not const
(and:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1607:51: error: the value of 'std::numeric_limits::has_infinity' is not usable in a constant expression
(then some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/bits/random.tcc:345:7: error: '_M_x' was not declared in this scope
(and finally:)
confused by earlier errors, bailing out
make: *** [feather/feather-c.o] Error 1
Warnung: Ausführung von Kommando 'make -f "Makevars" -f "C:/PROGRA~1/R/R-31~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="feather.dll" OBJECTS="RcppExports.o feather-read.o feather-types.o feather-write.o"' ergab Status 2
ERROR: compilation failed for package 'feather'
* removing 'C:/Users/.../R/win-library/3.1/feather'
* restoring previous 'C:/Users/.../R/win-library/3.1/feather'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users...\R\win-library\3.1" C:\Users...\AppData\LocalTemp\RtmpKsxa73/downloaded_packages/feather_0.3.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘feather’ had non-zero exit status
I wanted to install the feather-package via CRAN. It doesn't work in RStudio, nor does it in the R console. Running this on Windows 8.1.
Anybody have an idea why this won't install?
To me the problem lies somewhere with the package?
Or could it be a problem with authorization (I do not have administrative rights with my user, but I can install anything in C:\Users\my_user)
This specific language feature was first supported in GCC 4.7. You have GCC 4.6.3.
You will need to acquire a newer GCC or Clang installation.
If I read the error message correctly, you got your GCC from RTools 3.1. Looking at the project page for Rtools, Rtools 3.3 and up default to GCC 4.9 and up, which should support the code used by your feather extension.

Cannot compile any C++ programs; error: unknown type name 'uint8_t'

EDIT2: The problem was NOT a simple typographical error. I made a typo in the logs below, which I corrected, but the problem was still there.
EDIT: I mistakenly ran with gcc instead of g++, once, after attempting below. The problem was there before with g++ and it is there now.
I am currently on a MacOS High Sierra box. I recently moved a lot of files from a MacBook Air to this machine, including what I assume were all of Xcode's junk. Now, when I try to compile a very simple C++ program:
#include <iostream>
int main()
{
// VAR_DEC
int a = 4;
// VAR_MANIP
a = a*2;
// VAR_PRINT
std::cout << a << std::endl;
return 0;
}
I get the following ridiculous error:
jrfarah#Josephs-MBP: [config_file_script] $ g++ test.cpp -o test
In file included from test.cpp:1:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:15:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string:470:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string_view:171:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__string:56:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:640:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/memory:629:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/typeinfo:61:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/exception:82:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/cstdlib:86:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:94:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:196:2: error: unknown type name 'uint8_t'
uint8_t ri_uuid[16];
^
/usr/include/sys/resource.h:197:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;
^
/usr/include/sys/resource.h:198:2: error: unknown type name 'uint64_t'
uint64_t ri_system_time;
^
/usr/include/sys/resource.h:199:2: error: unknown type name 'uint64_t'
uint64_t ri_pkg_idle_wkups;
^
/usr/include/sys/resource.h:200:2: error: unknown type name 'uint64_t'
uint64_t ri_interrupt_wkups;
^
/usr/include/sys/resource.h:201:2: error: unknown type name 'uint64_t'
uint64_t ri_pageins;
^
/usr/include/sys/resource.h:202:2: error: unknown type name 'uint64_t'
uint64_t ri_wired_size;
^
/usr/include/sys/resource.h:203:2: error: unknown type name 'uint64_t'
uint64_t ri_resident_size;
^
/usr/include/sys/resource.h:204:2: error: unknown type name 'uint64_t'
uint64_t ri_phys_footprint;
^
/usr/include/sys/resource.h:205:2: error: unknown type name 'uint64_t'
uint64_t ri_proc_start_abstime;
^
/usr/include/sys/resource.h:206:2: error: unknown type name 'uint64_t'
uint64_t ri_proc_exit_abstime;
^
/usr/include/sys/resource.h:210:2: error: unknown type name 'uint8_t'
uint8_t ri_uuid[16];
^
/usr/include/sys/resource.h:211:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;
^
/usr/include/sys/resource.h:212:2: error: unknown type name 'uint64_t'
uint64_t ri_system_time;
^
/usr/include/sys/resource.h:213:2: error: unknown type name 'uint64_t'
uint64_t ri_pkg_idle_wkups;
^
/usr/include/sys/resource.h:214:2: error: unknown type name 'uint64_t'
uint64_t ri_interrupt_wkups;
^
/usr/include/sys/resource.h:215:2: error: unknown type name 'uint64_t'
uint64_t ri_pageins;
^
/usr/include/sys/resource.h:216:2: error: unknown type name 'uint64_t'
uint64_t ri_wired_size;
^
/usr/include/sys/resource.h:217:2: error: unknown type name 'uint64_t'
uint64_t ri_resident_size;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
I've tried installing and reinstalling everything I could think of related to the problem, such as gcc, g++, cc, brew, Xcode, command-line-tools, etc. I've also tried all the suggestions on the following pages:
Unknown type name uint8_t?
Include search path on Mac OS X Yosemite 10.10.1
Cythonizing fails because of unknown type name 'uint64_t'
unknown type name 'uint8_t', MinGW
JT Bullitt's very comprehensive blog
and more, but those summarize it pretty well. None of the solutions have worked.
I think the last one has the most likely solution. (If you search for "unknown" on the page you'll see the fix.) According to the developer:
Fix: Remove /opt/local/include/** and /opt/local/lib/** from the "Header Search Paths" build settings. Replace them with much more specific paths to the desired include directories. In my particular case, this meant replacing them with /opt/local/include/glib-2.0 /opt/local/lib/glib-2.0/include /opt/local/include/. It's up and running again!
However, I didn't install Xcode, I only installed the command line developer tools. Therefore, I don't have an easy way to access the "Header Search Paths" build settings, and thus, I can't try out his solution.
I am looking for a solution to this problem, preferably one that doesn't require me installing the entire OS. Alternatively, if someone could kindly guide me through finding the build settings file, I would be very grateful.
Maybe you can try:
mv /usr/local/include /usr/local/include.old
then:
brew install llvm
It's fairly obvious that you borked your system GCC installation. Please note that GCC is a suite of compilers and that G++ is the C++ front-end. Package managers often have a separate package called gcc-g++, however, when compiling from source, you simply do --enable-languages=c,c++. Now if reinstalling XCode doesn't resolve the problem (you should've already done this, if "it takes up too much space" just remove it), then you can try compiling GCC from source. Adapted from the GNU wiki:
First, grab your desired GCC tar ball from here
Untar it with tar zxvf gcc*
cd gcc* then ./contrib/download_prerequisites
Do an out of source build: mkdir build && cd build
../gcc*/configure --prefix=$HOME/gcc-install --enable-languages=c,c++
make and make install
Now just add $HOME/gcc-install/bin to your path and you should be good to go.
I experienced this error during compilation of Perl-5.34.0 from source. An alternative solution that worked for me was setting the SDK environment variable:
export SDK=`xcrun --show-sdk-path`
Sometimes, you may need to set SDKROOT in the same way:
export SDKROOT=`xcrun --show-sdk-path`
Placing it into your ~/.profile file will (conveniently) make this setting permanent.

program with boost thread 1.51 doesn't build

I am trying to compile a program using boost thread with the latest version. I am using
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
With the 1.50 I had an issue saying that the reference to boost::thread::~thrad() couldn't be found. So I updated to the new one I got the following
/usr/local/include/boost/thread/detail/thread.hpp:65: error: expected ';' before 'thread_data'
/usr/local/include/boost/thread/detail/thread.hpp:68: error: expected `;' before 'thread_data'
/usr/local/include/boost/thread/detail/thread.hpp:88: error: expected ';' before 'thread_data'
/usr/local/include/boost/thread/detail/thread.hpp:91: error: expected `;' before 'void'
/usr/local/include/boost/thread/detail/thread.hpp:105: error: expected ';' before 'thread_data'
/usr/local/include/boost/thread/detail/thread.hpp:108: error: expected `;' before 'void'
/usr/local/include/boost/thread/detail/thread.hpp:121: error: expected ';' before 'private'
/usr/local/include/boost/thread/detail/thread.hpp:153: error: expected primary-expression before ')' token
/usr/local/include/boost/thread/detail/thread.hpp:153: error: there are no arguments to 'BOOST_THREAD_RV_REF' that depend on a template parameter, so a declaration of 'BOOST_THREAD_RV_REF' must be available
/usr/local/include/boost/thread/detail/thread.hpp:153: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/local/include/boost/thread/detail/thread.hpp:153: error: expected `)' before 'f'
/usr/local/include/boost/thread/detail/thread.hpp:153: error: invalid in-class initialization of static data member of non-integral type 'boost::detail::thread_data_ptr'
/usr/local/include/boost/thread/detail/thread.hpp:153: confused by earlier errors, bailing out
I had no clue why is doing this way. Is there any workaround?
I had this same issue with g++ 4.2.1 on OSX, though I don't think its a compiler issue per se.
I had previously installed boost libraries and headers installed to /usr/local/lib and /usr/local/include by invoking b2 install. This works on a new installation, but it doesn't correctly overwrite a previous boost installation (I had 1.49). All I had to do was point my build at the boost build directory I was using, or to delete /usr/local/include/boost and run b2 install again. The first time I ran b2 install it only copied the libs which was fast, the second time it took much longer and copied over all the header files.

How to compile C++ files generated by google's protobuf compiler on OS X

I'm using a Mac. I have a library written in C++, let's call it "wibble", along with its source code. I can compile this source with GCC 4.3 from macports (g++-mp-4.3), and can link the resulting library into other stuff as long as I use GCC 4.3.
However, I need to link this into another application (let's call it "blort") which will only load libs compiled with the GCC 4.2 that is bundled with OS X 10.6 (because that's what it was built with)
I can, more or less, mess with wibble's Makefile however I may please, but blort is a fixed target. I can write whatever code or build scripts to glue them together I may need. There appears to be no way to get wibble to compile on 4.2 (barring a rewrite, which is out of the question), and the guy who wrote it confirms that.
I am not very familiar with the whole build and linking process in C++, having only been handed this integration, and am completely stumped. Is what I'm trying to achieve even possible? If so, how?
In case it matters, what I'm trying to do is call the methods in wibble from Perl via Inline::CPP, but I'm willing to write raw XS if I have to (I've done that before, at least). I need to use the system perl so this will easily build and install on other people's machines. :-/
UPDATE, 2012-03-01, 1
I am looking into compiling protobufs using the Mac's compiler, and seeing if I can get wibble to compile with the same compiler using that build of protobufs. I will post the results shortly.
Hrmph same errors:
g++ -Wall -Wno-unused-function -Wno-long-long -pedantic -O3 -I/Users/sscaffid/local/include -L/Users/sscaffid/local/lib -fPIC -std=c++98 -c wire.pb.cc
In file included from /Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:43,
from wire.pb.cc:10:
/Users/sscaffid/local/include/google/protobuf/wire_format_lite.h:94: error: comma at end of enumerator list
/Users/sscaffid/local/include/google/protobuf/wire_format_lite.h:117: error: comma at end of enumerator list
/Users/sscaffid/local/include/google/protobuf/wire_format_lite.h:132: error: comma at end of enumerator list
In file included from wire.pb.cc:10:
/Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:303: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:304: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:305: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:306: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:307: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/wire_format_lite_inl.h:308: error: extra ‘;’
In file included from wire.pb.cc:11:
/Users/sscaffid/local/include/google/protobuf/descriptor.h:322: error: comma at end of enumerator list
/Users/sscaffid/local/include/google/protobuf/descriptor.h:341: error: comma at end of enumerator list
/Users/sscaffid/local/include/google/protobuf/descriptor.h:352: error: comma at end of enumerator list
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1206: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1223: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1243: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1249: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1257: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1264: error: extra ‘;’
/Users/sscaffid/local/include/google/protobuf/descriptor.h:1274: error: extra ‘;’
In file included from wire.pb.cc:13:
/Users/sscaffid/local/include/google/protobuf/wire_format.h:226: error: comma at end of enumerator list
make: *** [wire.pb.o] Error 1
From the question:
Solution:
Using the -pedantic option to GCC 4.2 makes it very angry with protobuf code. Don't use it.

How do I get Anjuta to higlight errors/lines produced by my build system (waf)?

Waf outputs errors like the following
Waf: Entering directory `/home/atomos/dc_mmo/netclient/build'
[47/53] c: c_lib/c_lib.c -> build/c_lib/c_lib.c.1.o
In file included from ../c_lib/c_lib.c:12:
../c_lib/./physics/common.c: In function ‘rk4_accelerate’:
../c_lib/./physics/common.c:301: warning: unused variable ‘spring’
In file included from ../c_lib/c_lib.c:15:
../c_lib/./objects/grenade.c: In function ‘grenade_draw’:
../c_lib/./objects/grenade.c:91: error: ‘a’ undeclared (first use in this function)
../c_lib/./objects/grenade.c:91: error: (Each undeclared identifier is reported only once
../c_lib/./objects/grenade.c:91: error: for each function it appears in.)
In file included from ../c_lib/c_lib.c:16:
../c_lib/./objects/neutron.c: In function ‘neutron_draw’:
../c_lib/./objects/neutron.c:191: error: ‘a’ undeclared (first use in this function)
In file included from ../c_lib/./agent/agent_include.h:21,
from ../c_lib/c_lib.c:23:
../c_lib/./agent/./agent_client.c: In function ‘set_agent_control_state’:
../c_lib/./agent/./agent_client.c:58: warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘int *’
How can i get Anjuta to show errors at bottom and allow me to jump to error by clicking on it?
How can I configure Anjuta to run my build system on compile?
The problem is that eclipse looks for make: in the error code (this should be configurable) So you have to patch eclipse or waf so they agree on the format of the error message.
There was a patch to waf in this bug