View previous topic :: View next topic |
Author |
Message |
root_tux_linux l33t
Joined: 21 Dec 2003 Posts: 966
|
Posted: Mon May 10, 2010 3:50 pm Post subject: C++: undefinierte referenz auf crypt_init [solved] |
|
|
Hi
Ich hatte/hab eigentlich vor ein kleines Programm zu schreiben (um c++ richtig zu erlernen) und dieses Programm sollte ein cryptsetup Frontend werden in Qt.
Nun hab ich aber beim cryptsetup Teil das Problem das ständig "undefined reference to crypt..." auftaucht.
Selbst wenn ich vom cryptsetup Project den api-test.c (kann man von git ziehen) compilieren will bekomm ich permanent undefined reference to...
Kann mir da jemand helfen oder sagen wo es hängt? oO
Test Code:
Code: | pycoder@gentoo ~/DBus $ cat main.cpp
//#include <main.h>
#include <QtDBus>
#include <QDBusConnectionInterface>
#include <QDBusConnection>
#include <QCoreApplication>
#include <QDBusMessage>
#include <QList>
#include <QVariant>
#include <QString>
#include <QDebug>
#include <QFile>
#include <iostream>
#include <libcryptsetup.h>
int main(int argc, char *argv[]) {
QCoreApplication app(argc, argv);
// Qt Code zur überschaubarkeit entfernt hat sowieso noch nix mit cryptsetup zu tun
crypt_device *cd; // ggf = Null;
int res = crypt_init(&cd, "/dev/md0");
std::cout << res << std::endl;
return app.exec();
|
Bei meinem einfachen Code:
Code: | pycoder@gentoo ~/DBus $ make
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtDBus -I. -I. -o main.o main.cpp
g++ -Wl,-rpath,/usr/lib64/qt4 -o DBus main.o -L/usr/lib64/qt4 -lQtDBus -L/usr/lib64 -L/usr/lib64/qt4 -lQtXml -lQtGui -L/usr/X11R6/lib -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lpthread
main.o: In function `main':
/home/pycoder/DBus/main.cpp:58: undefined reference to `crypt_init'
collect2: ld gab 1 als Ende-Status zurück
make: *** [DBus] Fehler 1
|
Beim api-test.c vom cryptsetup git:
Code: | gentoo tests # gcc -o api-test.out api-test.c
/tmp/ccOUyTt1.o: In function `check_ok':
api-test.c:(.text+0x351): undefined reference to `crypt_get_error'
/tmp/ccOUyTt1.o: In function `check_ko':
api-test.c:(.text+0x3e7): undefined reference to `crypt_get_error'
/tmp/ccOUyTt1.o: In function `LuksUUID':
api-test.c:(.text+0x590): undefined reference to `crypt_luksUUID'
api-test.c:(.text+0x5dd): undefined reference to `crypt_luksUUID'
api-test.c:(.text+0x634): undefined reference to `crypt_luksUUID'
/tmp/ccOUyTt1.o: In function `IsLuks':
api-test.c:(.text+0x73a): undefined reference to `crypt_isLuks'
api-test.c:(.text+0x787): undefined reference to `crypt_isLuks'
api-test.c:(.text+0x7d4): undefined reference to `crypt_isLuks'
/tmp/ccOUyTt1.o: In function `LuksOpen':
api-test.c:(.text+0x8a8): undefined reference to `crypt_luksOpen'
api-test.c:(.text+0x8f5): undefined reference to `crypt_luksOpen'
api-test.c:(.text+0x942): undefined reference to `crypt_luksOpen'
api-test.c:(.text+0x981): undefined reference to `crypt_luksOpen'
/tmp/ccOUyTt1.o: In function `query_device':
api-test.c:(.text+0xa08): undefined reference to `crypt_query_device'
|
_________________ Intel Core i7 6700K@4.6GHz, Gigabyte GTX 980 Ti G1, Gigabyte Gaming 7, Hyper X Fury 32GB, 2 TB Samsung EVO 840 Basic
ASUS ROG Swift PG348Q Display
ASUS ROG ASUS G771JW Notebook
Last edited by root_tux_linux on Mon May 10, 2010 4:53 pm; edited 1 time in total |
|
Back to top |
|
|
franzf Advocate
Joined: 29 Mar 2005 Posts: 4565
|
|
Back to top |
|
|
root_tux_linux l33t
Joined: 21 Dec 2003 Posts: 966
|
Posted: Mon May 10, 2010 4:53 pm Post subject: |
|
|
Oh das wars ^^
DANKE _________________ Intel Core i7 6700K@4.6GHz, Gigabyte GTX 980 Ti G1, Gigabyte Gaming 7, Hyper X Fury 32GB, 2 TB Samsung EVO 840 Basic
ASUS ROG Swift PG348Q Display
ASUS ROG ASUS G771JW Notebook |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|