小编Thr*_*ash的帖子

Android NDK查找动态链接:无法调试库

我有一个项目,可以很好地编译,加载和运行在Android设备中.当我调用gdb服务器时,它也可以正常工作.然后,当我调用gdb客户端运行断点时,就会出现消息:

Error while mapping shared library sections:
/system/bin/linker: No such file or directory.

libandroid.so: No such file or directory.
liblog.so: No such file or directory.
libEGL.so: No such file or directory.
libOpenSLES.so: No such file or directory.
libGLESv2.so: No such file or directory.
libGLESv2_POWERVR_SGX540_120.so: No such file or directory.
...
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code
warning: shared library handler failed to enable …
Run Code Online (Sandbox Code Playgroud)

c++ debugging android gdb android-ndk

9
推荐指数
1
解决办法
4076
查看次数

Qt5在OSX -qt-xcb上安装

我在OSX上安装Qt5时遇到了问题.

完成Mac OSXQt要求 - 安装Xcode和命令行.然后我按照步骤:

 # mkdir qt5
 # cd qt5
 # git clone git://gitorious.org/qt/qtbase.git
 # cd qt5
 # ./configure
 The test for linking against libxcb and support libraries failed!
 You might need to install dependency packages, or pass -qt-xcb.
Run Code Online (Sandbox Code Playgroud)

然后我也试过了

 # cd qtbase
 # ./configure -prefix $HOME/development/macosx/qt5  -nomake docs -nomake examples -nomake demos -nomake tests  -opensource -confirm-license -release -no-c++11
 Unknown part docs passed to -nomake.
 # ./configure
 The test for linking against libxcb and support libraries …
Run Code Online (Sandbox Code Playgroud)

c++ x11 macos qt xcb

7
推荐指数
2
解决办法
6479
查看次数

使用makefile C子目录规则来生成obj

我运行一个简单的Makefile没有问题:

CC=gcc
CFLAGS= -std=c99 -ggdb -Wall -I.
DEPS = hellomake.h
OBJ = hellomake.o hellofunc.o 

%.o: %.c $(DEPS)
    $(CC) -c -o $@ $< $(CFLAGS)

hellomake: $(OBJ)
    gcc -o $@ $^ $(CFLAGS)
Run Code Online (Sandbox Code Playgroud)

这些文件位于主项目的目录中:

./project/Makefile
./project/hellomake.c
./project/hellomake.h
Run Code Online (Sandbox Code Playgroud)

然后我尝试组织文件,并把事情如下:

./project/Makefile
./project/src/hellomake.c
./project/include/hellomake.h
Run Code Online (Sandbox Code Playgroud)

和额外的子目录目录:

./project/lib
./project/obj
Run Code Online (Sandbox Code Playgroud)

然后是新版本的Makefile:

IDIR =include
CC=gcc
CFLAGS= -std=c99 -ggdb -Wall -I$(IDIR)

ODIR=obj
LDIR =lib

LIBS=-lm

_DEPS = hellomake.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))

_OBJ = hellomake.o hellofunc.o 
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))


$(ODIR)/%.o: %.c $(DEPS)
    $(CC) -c -o $@ $< $(CFLAGS)

hellomake: $(OBJ) …
Run Code Online (Sandbox Code Playgroud)

c compiler-errors makefile compilation

6
推荐指数
1
解决办法
6601
查看次数

C/C++预处理错误

我偶然发现了一个编译错误:

Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/3dsloader.d"-MT"src/3dsloader.d" -o "src/3dsloader.o" "../src/3dsloader.c"
In file included from ../src/3dsloader.c:42:
../src/3dsloader.h:8:9: error: macro names must be identifiers
make: *** [src/3dsloader.o] Error 1
Run Code Online (Sandbox Code Playgroud)

它指向:

#ifndef 3DSLOADER_H_
#define 3DSLOADER_H_
Run Code Online (Sandbox Code Playgroud)

通过以下消息:

Multiple markers at this line
    macro names must be identifiers
    macro definition not found: #ifndef 3DSLOADER_H_ 
Run Code Online (Sandbox Code Playgroud)

我正在使用Eclipse IDE在Ubuntu上运行C/C++ OpenGL程序.到目前为止所有其他程序都运行正常.但是这个加载3DS文件的人已经和我一起嘲笑了两天而没有修复它.

有什么建议吗?所有评论都非常感谢!

c c++

5
推荐指数
1
解决办法
1286
查看次数

Android Native NDK OpenGL ES:未实现的API

我正在努力用C++ for Android完全实现OpenGL ES 2.0.

目前,我们的程序在项目中没有JNI或任何java类运行,而只使用NativeActivity.

关注应用程序渲染部分本身,我们得到了一个简单的方法:

renderWorld()
{   GLfloat vVertices[] = {  0.0f,  0.5f, 0.0f,
                            -0.5f, -0.5f, 0.0f,
                             0.5f, -0.5f, 0.0f };
    glClear ( GL_COLOR_BUFFER_BIT );

    glVertexAttribPointer ( 0, 3, GL_FLOAT, GL_FALSE, 0, vVertices );
    glEnableVertexAttribArray ( 0 );

    glDrawArrays (GL_TRIANGLES, 0, 3 );
}
Run Code Online (Sandbox Code Playgroud)

在Android.mk中包括:

LOCAL_LDLIBS    := -landroid -llog -lEGL -lGLESv1_CM -lOpenSLES -lGLESv2
Run Code Online (Sandbox Code Playgroud)

并在AndroidManifest.xml中通知:

    <uses-feature android:glEsVersion="0x00020000"></uses-feature>
Run Code Online (Sandbox Code Playgroud)

因此,程序调试和编译没有问题.设置为运行时,会显示以下消息:

    error  libEGL   called unimplemented OpenGL ES API
Run Code Online (Sandbox Code Playgroud)

论坛给出了一个可用于java的建议 - Android:GLES20:称为未实现的OpenGL ES API,包括命令setEGLContextClientVersion:

    GLSurfaceView surfaceView = new GLSurfaceView(this);
    surfaceView.setEGLContextClientVersion(2);
Run Code Online (Sandbox Code Playgroud)

但是,setEGLContextClientVersion是一种适用于java的包装器方法.

setEGLContextClientVersion不属于OpenGL …

c++ opengl-es setup-deployment native-code android-ndk

5
推荐指数
1
解决办法
7187
查看次数

Qt Python radiobutton:激活事件

我正在为一个客户开发一个项目,其中设计有一个带有独家选项的单选按钮.

这是一段代码,它运行并显示两个漂亮的单选按钮:

    self.performGroupBox = QtGui.QGroupBox(self.centralwidget)
    self.performGroupBox.setGeometry(QtCore.QRect(50, 20, 181, 121))
    self.performGroupBox.setObjectName("performGroupBox")     

    self.consultRadioButton = QtGui.QRadioButton(self.performGroupBox)
    self.consultRadioButton.setGeometry(QtCore.QRect(40, 30, 84, 18))
    self.consultRadioButton.setObjectName("consultRadioButton")

    self.insertRadioButton = QtGui.QRadioButton(self.performGroupBox)
    self.insertRadioButton.setGeometry(QtCore.QRect(40, 60, 84, 18))
    self.insertRadioButton.setObjectName("insertRadioButton")
Run Code Online (Sandbox Code Playgroud)

它看起来像:

perform:
    () Consult
    () Insert
Run Code Online (Sandbox Code Playgroud)

这里的要点是,如何知道标记的选项:"consultRadioButton"或"insertRadioButton"?

以下是尝试获取此信息的示例:

    if self.consultRadioButton.isChecked():
        self.call_Consult()
    if self.insertRadioButton.isChecked():
        self.call_Insert()
Run Code Online (Sandbox Code Playgroud)

但是当选择radiobutton时它没有做任何事情.

否则,使用connect应该是另一种选择:

    QtCore.QObject.connect(self.consultRadioButton, QtCore.SIGNAL("currentIndexChanged(QString)"), self.call_Consult)  
    QtCore.QObject.connect(self.insertRadioButton, QtCore.SIGNAL("currentIndexChanged(QString)"), self.call_Insert) 
Run Code Online (Sandbox Code Playgroud)

但它也没有用.

这里缺少什么...有什么建议吗?

所有评论都非常欢迎和赞赏.

python user-interface qt qt4 pyqt

4
推荐指数
1
解决办法
7968
查看次数

ndk-build eclipse参数:找不到类

我们正在开发适用于Android设备的系统.为此,我们使用FC16,Eclipse,SDK,NDK.

在Eclipse中:运行>外部工具>外部Tolls配置>我们有选项卡:

[Main]
Location:
/usr/java/jdk1.7.0_02/bin/javah
Working Directory:
${workspace_loc:/MyProject/bin}
Arguments:
-d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity

[Refresh]
Specify Resources
MyProject - JNI
Run Code Online (Sandbox Code Playgroud)

然后单击"应用"和"运行"时出现错误消息:

Error: Could not find class file for 'com.myproject.MyActivity'.
Run Code Online (Sandbox Code Playgroud)

但是,另一方面,如果我们在终端上进入目录/ MyProject并运行命令:

ndk-build
Run Code Online (Sandbox Code Playgroud)

没有出现错误,程序在Android上作为本机C++运行.

Eclipse IDE缺少什么?应该与[外部通行费配置]中的[Argment]有关,还是我们错过的其他内容?

欢迎所有意见和建议,并高度赞赏.

c++ eclipse installation android android-ndk

4
推荐指数
1
解决办法
2675
查看次数

Python QPushButton setIcon:在按钮上放置图标

我想把一个ICON放入一个按钮..代码应该像这样工作:

    self.printButton = QtGui.QPushButton(self.tab_name)
    self.printButton.setIcon(QtGui.QPixmap('printer.tif'))
    self.printButton.setGeometry(QtCore.QRect(1030, 500, 161, 61))
Run Code Online (Sandbox Code Playgroud)

但相反,它给出了错误消息:

    TypeError: argument 1 of QAbstractButton.setIcon() has an invalid type
Run Code Online (Sandbox Code Playgroud)

这里缺少什么?

所有意见和建议都非常感谢.

python user-interface icons qt button

2
推荐指数
3
解决办法
9485
查看次数

Qt Python:QTreeWidget Child Problem

如果我的树形图上只有一个级别,我有一个QTreewidget可以正常工作.如果我决定添加子级别,它会给我一个错误.这是代码,仅在没有"childs"行的情况下才能正常工作(请参阅"child 1"和"child 2"之后).

def eqpt_centralwdg(self,MainWindow):
    self.centralwidget = QtGui.QWidget(MainWindow)
    self.centralwidget.setObjectName("centralwidget")

    self.colorTreeWidget = QtGui.QTreeWidget(self.centralwidget)
    self.colorTreeWidget.setGeometry(QtCore.QRect(60, 60, 191, 141))
    self.colorTreeWidget.setObjectName("colorTreeWidget")

    # father root 1
    item = QtGui.QTreeWidgetItem(self.colorTreeWidget)
    #child 1 - from father 1
    item = QtGui.QTreeWidgetItem(item)
    #child 2 - from father 1
    item = QtGui.QTreeWidgetItem(item)
    # father root 2
    item = QtGui.QTreeWidgetItem(self.colorTreeWidget)         

    self.connect(self.colorTreeWidget, QtCore.SIGNAL('itemClicked(QTreeWidgetItem*, int)'), self.eqpt_activateInput)

    MainWindow.setCentralWidget(self.centralwidget)

def eqpt_retranslateUi(self, MainWindow):
    MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)
    self.colorTreeWidget.headerItem().setText(0, QtGui.QApplication.translate("MainWindow", "color", None, QtGui.QApplication.UnicodeUTF8) 
    __sortingEnabled = self.colorTreeWidget.isSortingEnabled()    
    self.colorTreeWidget.setSortingEnabled(False) 
    # father root 1
    self.colorTreeWidget.topLevelItem(0).setText(0, QtGui.QApplication.translate("MainWindow", "Yellow", None, QtGui.QApplication.UnicodeUTF8) 
    #child …
Run Code Online (Sandbox Code Playgroud)

user-interface qt qt4 pyqt pyqt4

1
推荐指数
1
解决办法
4808
查看次数

Qt Python:QTextEdit - 显示输入

我有一个 QTextEdit...当按钮调用“CleanComments”来清理用户完成的输入时,它与“clear()”一起工作。这是代码:

def CleanComments(self):
    self.textEditInput.clear()

def showInput(self):
    print "show input: %s" % self.textEditInput.show()

def buildEditInput(self):
    self.textEditInput = QtGui.QTextEdit(self.boxForm)
    self.textEditInput.setGeometry(QtCore.QRect(10, 300, 500, 100)) 
Run Code Online (Sandbox Code Playgroud)

唯一的问题是,当调用 'showInput' 以使用“show()”在 QTextEdit 上显示内容时,它会给出“” show input: 'None' ""。那么,这里缺少什么?

非常感谢所有评论和建议。

python qt qtextedit

1
推荐指数
1
解决办法
5734
查看次数