我已经在这里找到并阅读了这个问题,也在这里和这里提出了问题,不幸的是它仍然没有得到解决.(虽然我使用了该线程中的所有提示尽可能多地提供信息)
有几天我一直试图找到一种能够交叉编译Qt的方法,因为我最近有一个,现在想学习如何编写一些基本的嵌入式应用程序.
我在这里关注教程: http ://visualgdb.com/tutorials/raspberry/qt/embedded/
apt-get install libudev-dev libinput-dev libts-dev libxcb*第一次运行它,configure说是缺少libs)2015-11-21-raspbian-jessie与raspberry-gcc-4.9.2-r2.exeqt-everywhere-opensource-src-5.5.0.tar.xz)../qt-everywhere-opensource-src-5.5.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -opengl es2 -device linux-rasp-pi2-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -qt-xcb几个小时后,一切都建好了,大概没有错误.(我的输出与教程中的屏幕截图相同)
但是,尝试运行任何构建的示例,只会产生一行: Illegal instruction
按照我在开头提到的主题,这是file输出:
root@raspberrypi:/usr/local/qt5/examples/opengl/cube# file cube
cube: ELF 32-bit LSB executable, ARM, EABI5 version 1 …Run Code Online (Sandbox Code Playgroud)我正在尝试从cin获取字符串,而不是将其写入二进制文件。我已经读过写纯字符串是行不通的,所以我尝试将其转换为char *。
下面的代码将它写成ok(...大概),但是只有前8个字符,因此文件中的输出是不完整的。
std::string nick, ip, port;
std::cout << "IP: ";
std::cin >> ip;
std::cout << "port: ";
std::cin >> port;
ofstream file1("lastServers.bin", ios::out | ios::binary);
if (file1.good())
{
const char* p_IP = ip.c_str();
const char* p_PORT = port.c_str();
int length = sizeof(&p_IP)+sizeof(&p_PORT);
char* tmp1 = new char[length];
int index = 0;
memcpy((tmp1 + index), p_IP, sizeof(&p_IP));
index = index + sizeof(&p_IP);
memcpy((tmp1 + index), p_PORT, sizeof(&p_PORT));
file1.write(tmp1, length);
file1.close();
delete[] tmp1;
}
else
{ …Run Code Online (Sandbox Code Playgroud) 我正在为twitch.tv频道编写一个简单的 Google Chrome 扩展。我需要的唯一功能是发送聊天消息,最好不要显式使用聊天文本框和按钮。
通过查看BetterTTV插件的源代码,我找到了负责发送聊天消息的函数:
App.__container__.lookup('controller:chat').currentRoom.tmiRoom.sendMessage('test message');
现在,当我使用 Chrome DevTools 中的控制台执行此操作时,它工作得很好。
但是,从扩展的内容脚本中使用它会抛出:script1.js:28 Uncaught ReferenceError: App is not defined
尝试使用时也会出现同样的情况window.Ember(在控制台中工作,在内容脚本中未定义抛出)。
以防万一,这是内容脚本的完整测试代码:
$(document).ready(function() {
setTimeout(function() {
main();
}, 5000);
});
function main() {
var tmi = App.__container__.lookup('controller:chat').currentRoom;
tmi.tmiRoom.sendMessage('TEST');
}
Run Code Online (Sandbox Code Playgroud)
虽然我在 chrome 扩展方面有一些经验,但我从未处理过有关 Ember.js 的任何事情。而且我还没有发现任何类似的问题。
javascript google-chrome google-chrome-extension ember.js twitch
c++ ×2
binary ×1
char ×1
ember.js ×1
javascript ×1
qt ×1
raspberry-pi ×1
string ×1
toolchain ×1
twitch ×1