0

As usual, before posting I've try to read many forums, google answers and still can't find the issue. I got a piece of code that is working. It compiles in any linux dist, it compiled in mountain lion before, and it compiles from the terminal, when I try to compile it through netbeans 7.4, I get the following errors Here is the compile command:

g++    -c -g -I../../Downloads/boost_1_50_0 -I. -I../../Downloads/RInside/inst/include -I/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/include -I/ -I/Library/Developer/CommandLineTools/usr/include -I/usr/include -I/usr/include/c++/4.2.1 -MMD -MP -MF "build/Debug/GNU-MacOSX/main.o.d" -o build/Debug/GNU-MacOSX/main.o main.cpp

And here are the errors

In file included from main.cpp:7:
In file included from /usr/include/c++/4.2.1/cstdlib:71:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:193:2: error: unknown type name 'uint8_t'
uint8_t  ri_uuid[16];
    ^
/usr/include/sys/resource.h:194:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;

Line 7 reads:

#include <cstdlib>

I guess its a problem with the include libraries, but it is just a guess, I re-installed netbeans, got java 1.7.0_45, installed command line tools, delete cache_dir, and still same problem, the really odd part is that when I compile it from the terminal

g++ main.cpp -o main -I./

That works....and it worked before when I had mountain lion...Any help would be deeply appreciated. Best, Jorge

Jorge Kageyama
  • 393
  • 4
  • 17
  • Wild guess: Does Netbeans use the XCode compiler? If so, you'll probably need to update XCode. – Gene Feb 24 '14 at 15:35
  • http://stackoverflow.com/questions/8953274/unknown-type-name-uint8-t-mingw – willll Feb 24 '14 at 15:37
  • Indeed, I updated X-code, and command line tools and didnt help :( – Jorge Kageyama Feb 24 '14 at 15:37
  • @Gene I just added stdint.h and the error doesnt change, If I add the second library in that post, I get a bunch of new unidentified types :( and the weird thing is that it compiles from terminal, so not entirely sure about that. – Jorge Kageyama Feb 24 '14 at 15:43

2 Answers2

0

Ok, So a friend suggested to start deleting libraries until the command ran (because with a simple sintax it runs in the command terminal), and that is exactly what I did, and this is the library that is causing the problem:

-I/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/include

It seems that when mavericks is updated it switches to clang, so somehow this line is causing a problem with the proper compilation of the code, I wish I had a proper answer of what is going on, but at least this will solve the problem, any proper answer would be appreciated :)

Jorge Kageyama
  • 393
  • 4
  • 17
0

Similar issue happened for me too (but for clang). Brew helped me to fix this. brew doctor listed a lot of header files (all in /usr/include/, with some warning I don't now recall.

Simply moving those header files worked for me.

jatinderjit
  • 1,359
  • 8
  • 21