qrencode-分段错误(核心已转储) [英] qrencode - Segmentation fault (core dumped)

查看:175
本文介绍了qrencode-分段错误(核心已转储)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个工作程序,该程序在给定特定字符串的情况下生成了图像。我的Slackware 32位发行版和其他32位发行版都可以正常使用。

I have made a working program that generated an image given a certain string. It is fully working on my Slackware 32bit distro and others distros also 32bit.

现在,我需要在客户端计算机上实现它,这是AIX powerpc。它编译没有问题,并且似乎可以正常工作(每个其他函数都可以工作并给出正确的结果),除非我将这两个函数称为 QRcode_encodeString和 QRcode_encodeData。
它不断给我带来细分错误。

Now i need to implement it on the client machine, which is an AIX powerpc. It compiled without any problem, and seems to work (every other function works and gives correct results), except when i call these 2 functions "QRcode_encodeString" and "QRcode_encodeData". It keeps giving me Segmentation fault.

您可以假定我的main()仅一行是该函数调用:

You can assume my main() only line is that function call:

#include <stdio.h>
#include <qrencode.h>

int main(void)
{
   QRcode* pQRC = QRcode_encodeString("abc", 0, QR_ECLEVEL_L, QR_MODE_8, 0);    
   return 0;
}

我的客户端计算机上没有gdb,也没有root priv。它可以与 QRcode_encodeStringMQR()一起使用,生成一个微型QRcode,但这对我来说不是一个解决方案。它会生成一个名为 core的转储文件,因为该计算机没有gdb,所以我无法使用它。我假设我无法在另一台计算机上打开它,因为它们不共享相同的架构。我真的不知道如何解决这个问题……

I don't have gdb on the client machine and no root priv. It works with "QRcode_encodeStringMQR()" which generates a micro QRcode, but that isn't a solution for me. It generates a dump file by the name "core" which I can't use it since that machine doesn't have gdb... And I'm assuming I can't open it on another machine since they don't share the same architecture. I have literaly no clue on how to troubleshoot this one...

再次,这段代码在我的Slackware发行版中起作用。

Again, this code works on my Slackware distro.

不幸的是,我对powerpc和AIX的了解仅限于这种经验。

My knowledge about powerpc and AIX is limited to this experience only, unfortunately.

我忘了提及,只有cc可用,我正在像这样编译:

I forgot to mention, only cc is available and I'm compiling like this:

cc qrgen.c -lqrencode -L/usr/local/lib -I/usr/local/include


推荐答案

我发现了问题...安装lib产生了问题并导致符号链接以简单文件的形式存在,而该库就不存在了。

I found the problem... The installation of the lib generated problems and caused the caused the symbolic links to exist as a simple file and the library just wasn't there...

这是丢失的文件 / usr / local / lib / libqrencode.so.3.4.4,它本身就是代码...我正在查看文件,但没有注意到它,因为有一个名为libqrencode.so.3.4的文件,但该文件被认为是符号文件链接到libqrencode.so.3.4.4,因为libqrencode.so.3.4.4不存在,而不是符号链接失败,而是c处理了一个同名的空文件...

This is the missing file "/usr/local/lib/libqrencode.so.3.4.4" which is the code itself... I was looking at the files and didn't notice it because there was a file called libqrencode.so.3.4 but this file was supose to be a symbolic link to libqrencode.so.3.4.4 since libqrencode.so.3.4.4 didn't exist, instead of the symbolic link failing, it created a empty file with that same name...

这篇关于qrencode-分段错误(核心已转储)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆