草庐IT

most_recent_conversations

全部标签

Android 导出给一个 "Conversion to Dalvik format failed error1"

当我尝试导出我的android项目时,我收到以下Eclipse错误消息“ConversiontoDalvikformatfailederror1””我尝试了以下步骤,但没有运气..项目»清理在eclipse.ini中添加-Xms128m/-Xmx512m使用-clean选项重新启动Eclipse导出步骤:-右击project->export->android,选择“exportandroidapplication” 最佳答案 在“项目菜单”上禁用“自动构建”并手动重新构建(右键单击项目->构建项目),然后再次尝试导出应用程序。Ecl

android - MeasureSpec.UNSPECIFIED 和 MeasureSpec.AT_MOST 何时应用?

我对MeasureSpec.UNSPECIFIED和MeasureSpec.AT_MOST有点困惑。我知道当match_parent或常量尺寸值设置为layout_width或layout_height时,MeasureSpec.EXACTLY将在测量View时应用。那么,MeasureSpec.UNSPECIFIED和MeasureSpec.AT_MOST呢?我的理解是,当layout_width或layout_height设置为wrap_content时,MeasureSpec.UNSPECIFIED将是应用,因为wrap_content意味着View的高度或宽度可以是任何大小,具

android - MeasureSpec.UNSPECIFIED 和 MeasureSpec.AT_MOST 何时应用?

我对MeasureSpec.UNSPECIFIED和MeasureSpec.AT_MOST有点困惑。我知道当match_parent或常量尺寸值设置为layout_width或layout_height时,MeasureSpec.EXACTLY将在测量View时应用。那么,MeasureSpec.UNSPECIFIED和MeasureSpec.AT_MOST呢?我的理解是,当layout_width或layout_height设置为wrap_content时,MeasureSpec.UNSPECIFIED将是应用,因为wrap_content意味着View的高度或宽度可以是任何大小,具

c++ - g++ 警告 : conversion to uint16_t from int may alter its value

根据高级SO用户的建议,我最近开始使用-Wconversion进行编译。在我的代码库上标记。这产生了很多警告,其中一些是合法的(例如,不必要地添加signed和unsigned类型),但也产生了一些令人头疼的警告,如下所示:#includeintmain(){uint16_ta=4;uint16_tb=5;b+=a;return0;}当我用g++-Wconversion-std=c++11-O0myFile.cpp编译时,我明白了warning:conversionto'uint16_t{akashortunsignedint}'from'int'mayalteritsvalue[-W

c++ - g++ 警告 : conversion to uint16_t from int may alter its value

根据高级SO用户的建议,我最近开始使用-Wconversion进行编译。在我的代码库上标记。这产生了很多警告,其中一些是合法的(例如,不必要地添加signed和unsigned类型),但也产生了一些令人头疼的警告,如下所示:#includeintmain(){uint16_ta=4;uint16_tb=5;b+=a;return0;}当我用g++-Wconversion-std=c++11-O0myFile.cpp编译时,我明白了warning:conversionto'uint16_t{akashortunsignedint}'from'int'mayalteritsvalue[-W

c++ - reinterpret_cast moSTLy 没用吗?

我已经阅读了关于theuseofreinterpret_cast的各种先前问题。,并且我还阅读了C++标准中的相关措辞。本质上,它归结为指针到指针reinterpret_cast操作的结果不能安全地用于任何东西,除了被转换回原始指针类型。然而,在实践中,reinterpret_cast的大多数实际使用似乎是基于(错误的)假设,即reinterpret_cast与C风格相同throw。例如,我看到很多代码使用reinterpret_cast将char*转换为unsignedchar*以进行字符集转换例行公事。这是完全无害的,但严格来说它不是可移植的-不能保证从char*到unsigned

c++ - reinterpret_cast moSTLy 没用吗?

我已经阅读了关于theuseofreinterpret_cast的各种先前问题。,并且我还阅读了C++标准中的相关措辞。本质上,它归结为指针到指针reinterpret_cast操作的结果不能安全地用于任何东西,除了被转换回原始指针类型。然而,在实践中,reinterpret_cast的大多数实际使用似乎是基于(错误的)假设,即reinterpret_cast与C风格相同throw。例如,我看到很多代码使用reinterpret_cast将char*转换为unsignedchar*以进行字符集转换例行公事。这是完全无害的,但严格来说它不是可移植的-不能保证从char*到unsigned

c++ - 常量不匹配 : 2 overloads have no legal conversion for 'this' pointer

我收到了这个奇怪的错误:errorC2663:'sf::Drawable::SetPosition':2overloadshavenolegalconversionfor'this'pointer我认为这与const不匹配有关,但我不知道在哪里,或者为什么。在下面的代码中,我有一个形状和Sprite的vector,当尝试访问其中一个vector形状并调用它的一个函数时,我遇到了错误。std::vectorShapes;std::vectorSprites;boolAddShape(sf::Shape&S){Shapes.push_back(S);returntrue;};boolAdd

c++ - 常量不匹配 : 2 overloads have no legal conversion for 'this' pointer

我收到了这个奇怪的错误:errorC2663:'sf::Drawable::SetPosition':2overloadshavenolegalconversionfor'this'pointer我认为这与const不匹配有关,但我不知道在哪里,或者为什么。在下面的代码中,我有一个形状和Sprite的vector,当尝试访问其中一个vector形状并调用它的一个函数时,我遇到了错误。std::vectorShapes;std::vectorSprites;boolAddShape(sf::Shape&S){Shapes.push_back(S);returntrue;};boolAdd

c++ - srand (time (null)) 导致编译器警告 : implicit conversion loses integer precision

如果这个问题已经得到解答,我们深表歉意。#include#include#includeusingnamespacestd;intmain(){srand(time(NULL));cout“隐式转换丢失整数精度:'time_t'(又名'long')到'unsignedint'”是我在执行上面的代码时收到的错误消息。我正在使用xcode4.6.1。现在,当我使用不同的编译器(例如来自codepad.org的编译器)时,它执行得非常好,生成看起来像随机数的东西,所以我假设这是我需要解决的xcode问题?我刚刚开始编程,所以在这方面我是一个完整的初学者。我的代码有问题还是我的编译器有问题?任