Ubuntu 14.04中的Oracle Developer Studio:编译时找不到sys / cdefs.h

时间:2016-07-21 03:03:19

标签: linux oracle ubuntu solaris cc

所以我刚刚按照Oracles网站上的说明安装了Oracle Developer Studio 12.5的tarfile版本。使用以下方法测试安装:

https://docs.oracle.com/cd/E37069_01/html/E37072/gozue.html#scrolltoc

我在使用

编译时发现
cc -V hello.c

我收到以下错误(由于stackoverflow限制只有一小部分):

"/home/craig/Programs/OracleDeveloperStudio12.5-linux-x86-bin/developerstudio12.5/lib/compilers/include/cc/sys/cdefs.h", line 9: cannot find include file: <sys/cdefs.h>
"/usr/include/features.h", line 388: cannot find include file: <gnu/stubs.h>
"/home/craig/Programs/OracleDeveloperStudio12.5-linux-x86-bin/developerstudio12.5/lib/compilers/include/cc/stddef.h", line 39: syntax error before or at: typedef
"/usr/include/stdio.h", line 35: cannot find include file: <bits/types.h>
"/usr/include/stdio.h", line 48: syntax error before or at: typedef
"/usr/include/stdio.h", line 53: syntax error before or at: __USING_NAMESPACE_STD
"/usr/include/_G_config.h", line 9: cannot find include file: <bits/types.h>
"/usr/include/_G_config.h", line 23: syntax error before or at: __off_t
"/usr/include/_G_config.h", line 28: syntax error before or at: __off64_t
"/home/craig/Programs/OracleDeveloperStudio12.5-linux-x86-bin/developerstudio12.5/lib/compilers/include/cc/va_impl.h", line 168: parameter not in identifier list: __builtin_va_start
"/home/craig/Programs/OracleDeveloperStudio12.5-linux-x86-bin/developerstudio12.5/lib/compilers/include/cc/va_impl.h", line 170: parameter not in identifier list: __builtin_va_arg_incr
"/home/craig/Programs/OracleDeveloperStudio12.5-linux-x86-bin/developerstudio12.5/lib/compilers/include/cc/sys/cdefs.h", line 9: cannot find include file: <sys/cdefs.h>
"/usr/include/libio.h", line 154: void parameter cannot have name: _IO_lock_t
"/usr/include/libio.h", line 274: syntax error before or at: __off_t
"/usr/include/libio.h", line 293: syntax error before or at: __off64_t
"/usr/include/libio.h", line 320: only "register" valid as formal parameter storage class
"/usr/include/libio.h", line 320: parameter not in identifier list: _IO_2_1_stdin_
"/usr/include/libio.h", line 320: incomplete struct/union/enum _IO_FILE_plus: _IO_2_1_stdin_
"/usr/include/libio.h", line 321: only "register" valid as formal parameter storage class
"/usr/include/libio.h", line 321: parameter not in identifier list: _IO_2_1_stdout_
"/usr/include/libio.h", line 322: only "register" valid as formal parameter storage class
"/usr/include/libio.h", line 322: parameter not in identifier list: _IO_2_1_stderr_
"/usr/include/libio.h", line 338: syntax error before or at: __io_read_fn
"/usr/include/libio.h", line 338: parameter not in identifier list: __io_read_fn
"/usr/include/libio.h", line 346: syntax error before or at: __io_write_fn
"/usr/include/libio.h", line 346: parameter not in identifier list: __io_write_fn
"/usr/include/libio.h", line 355: syntax error before or at: __off64_t
"/usr/include/libio.h", line 390: only "register" valid as formal parameter storage class
"/usr/include/libio.h", line 390: syntax error before or at: *

特别是它所说的第一部分找不到。现在该文件存在于所述目录中,因此我不知道是什么导致了它。请注意,使用

的默认PATH时,代码编译正常
/usr/local/bin

只有当我将PATH设置为

时才会这样
/home/craig/Programs/OracleDeveloperStudio12.5-linux-x86-bin/developerstudio12.5/bin

因为它在网站上请求测试安装,它会引发这些错误。在solstudio中编译任何项目示例时也是如此。我想我必须更新或安装一些额外的软件包,但我不知道哪些是这样的,或者坦率地说这里发生了什么。该网站似乎只提供Oracle Solaris的更新或补丁,而不是Ubuntu或Linux,因此不知道该怎么做。如果这很简单,请道歉。不是高级Linux用户,也不是第一次使用Oracle Developer Studio。正如标题所说,我在Ubuntu 14.04下运行,而且我可以从文档中收集它,它应该与Ubuntu OS兼容。

1 个答案:

答案 0 :(得分:1)

cannot find include file: <sys/cdefs.h> 
cannot find include file:<gnu/stubs.h>
cannot find include file: <bits/types.h>

请执行:sudo apt update && sudo apt install g++

...这也是安装让gcc完全运行的文件:libc6-dev,linux-libc-dev。