ubuntu8.04安装vmware时,编译错误的解决方法

本文转自: http://www.blogjava.net/xiaosilent/archive/2008/04/22/194699.html

ubuntu Hardy上,安装VMware workstation时:

Using  2.6 .x kernel build system.
make: Entering directory `
/ tmp / vmware - config2 / vmmon - only'
make 
- / lib / modules / 2.6 . 24.4 - 64 .fc8 / build / include / .. SUBDIRS = $PWD SRCROOT = $PWD / . modules
make[
1 ]: Entering directory ` / usr / src / kernels / 2.6 . 24.4 - 64 .fc8 - i686'
CC [M] 
/ tmp / vmware - config2 / vmmon - only / linux / driver.o
CC [M] 
/ tmp / vmware - config2 / vmmon - only / linux / hostif.o
CC [M] 
/ tmp / vmware - config2 / vmmon - only / common / comport.o
CC [M] 
/ tmp / vmware - config2 / vmmon - only / common / cpuid.o
In file included from include
/ asm / bitops.h: 2 ,
                 from 
/ tmp / vmware - config2 / vmmon - only / . / include / vcpuset.h: 74 ,
                 from 
/ tmp / vmware - config2 / vmmon - only / . / include / modulecall.h: 23 ,
                 from 
/ tmp / vmware - config2 / vmmon - only / common / vmx86.h: 18 ,
                 from 
/ tmp / vmware - config2 / vmmon - only / common / hostif.h: 18 ,
                 from 
/ tmp / vmware - config2 / vmmon - only / common / cpuid.c: 14 :
include
/ asm / bitops_32.h: 9 : 2 : error: #error only  < linux / bitops.h >  can be included directly
make[
2 ]:  ***  [ / tmp / vmware - config2 / vmmon - only / common / cpuid.o] Error  1
make[
1 ]:  ***  [_module_ / tmp / vmware - config2 / vmmon - only] Error  2
make[
1 ]: Leaving directory ` / usr / src / kernels / 2.6 . 24.4 - 64 .fc8 - i686'
make: 
***  [vmmon.ko] Error  2
make: Leaving directory `
/ tmp / vmware - config2 / vmmon - only'
Unable to build the vmmon module.

For more information on how to troubleshoot module
- related problems, please
visit our Web site at 
" http://www.vmware.com/download/modules/modules.html "  and
" http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html " .

Problem: include/asm/bitops_32.h:9:2: error: #error only <linux/bitops.h> can be included directly, and vmmon-only compile failes

Solution: change line 74 in vmmon-only source file to read: #include “linux/bitops.h”

Steps:

  1. cd /usr/lib/vmware/modules/source
  2. sudo cp vmmon.tar vmmon.tar.bak
  3. sudo tar xvf vmmon.tar
  4. cd vmmon-only/include/
  5. sudo gedit vcpuset.h
  6. change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
  7. rm vmmon.tar
  8. sudo tar cvf vmmon.tar vmmon-only
  9. sudo rm -rf vmmon-only
  10. sudo vmware-config.pl

That’s it, the compile will work now and vmware should be usable as normal

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值