CUPS印刷システムを作成しようとしています。私はプリンタの状態、何ページが何枚印刷されたかなどを知りたい。CUPS印刷ファイル分割エラー
これを行うには、私はCUPSの例で与えられたサンプルプログラムを実行している。
#include <cups/cups.h>
#include <stdio.h>
int main(){
int num_options;
cups_option_t *options;
cups_dest_t *dests;
int num_dests = cupsGetDests(&dests);
cups_dest_t *dest = cupsGetDest("name", NULL, num_dests, dests);
int job_id;
/* Print a single file */
job_id = cupsPrintFile(dest->name, "testfile.txt", "Test Print", num_options, options);
cupsFreeDests(num_dests, dests);
return 0;
}
私は./myout
を実行しようとすると私はラズベリー-PI 3を使用しています
セグメンテーションフォールト
を取得していますgcc myfile.c -o myout -lcups
を使用して、それをコンパイル私のCUPSサーバーとしてのボード。
ありがとうございます。
gdbは開発環境に存在しますか? – lockcmpxchg8b
@ lockcmpxchg8bはい。 – Sachith
実行方法が分かっているなら、SIGSEGVで壊れてしまい、 'where'コマンドはsegvで実行された場所をスタックトレースします。デバッグモードでコンパイルする方がよいでしょう。 – lockcmpxchg8b