在64位Ubuntu(14.04)的python中使用-m32选项进行编译

时间:2016-01-19 10:50:21

标签: python linux ubuntu 32bit-64bit ctypes

我试图用python' ctypes'来包装32位.so文件。模块

如果我在python中加载.so文件,则会出错

var mongoose = require('mongoose')
mongoose.connect('mongodb://localhost:27017/playground')

var Schema = mongoose.Schema

var TestSchema = new Schema({
  testField: {
    type: Boolean,
    required: true
  }
})

// Try to ensure, that testField can only be true
TestSchema
  .path('testField')
  .validate(function (testField) {
    return (testField === true || testField === 'true')
  }, 'Test-field must be true!');

var Test = mongoose.model('test', TestSchema);


var newDoc = Test({
  testField: 'some random string'
})

newDoc.save(function (err, newDoc) {
  (err) ? console.log(err): console.log('newDoc was created')
})

为了解决这个问题,我搜索了很多网站并找到了两个解决方案

首先使用配置选项,CFLGAS和LDFLAGS。但是,对我来说,遵循它是非常困难和简短的。

第二个是安装python2.7:i386。当然,它可以工作,但它删除了原始版本的python,它无法编译64位程序。

您能否建议其他解决方案或解释如何处理./configure?

0 个答案:

没有答案
相关问题