Undefined reference to BufferedTransformation

41 Aufrufe
Direkt zur ersten ungelesenen Nachricht

zavodny...@gmail.com

ungelesen,
13.01.2018, 08:20:3613.01.18
an Crypto++ Users
Does anybody know why I'm getting this error? https://pastebin.com/YeGA4dgN

I just want make fingerprint of a file and put it into string.
CryptoPP::SHA256 sha256Hasher;
CryptoPP::FileSource createFileFingerprint(filePath.c_str(), true, new CryptoPP::HashFilter(sha256Hasher, new CryptoPP::HexEncoder(new CryptoPP::StringSink(fileFingerprint))));


Marcel Raad

ungelesen,
13.01.2018, 08:23:3013.01.18
an zavodny...@gmail.com, Crypto++ Users
Looks like you're not linking to Crypto++? How are you invoking the compiler?

Marcel

zavodny...@gmail.com

ungelesen,
13.01.2018, 08:29:0113.01.18
an Crypto++ Users
Using the G++ option -lcryptopp. The program will compile if I keep the CryptoPP::SHA256 sha256Hasher; and comment the FileSource.


Dne sobota 13. ledna 2018 14:20:36 UTC+1 zavodny...@gmail.com napsal(a):

zavodny...@gmail.com

ungelesen,
13.01.2018, 10:34:0913.01.18
an Crypto++ Users
The same error when trying to hash string using StringSource.

Dne sobota 13. ledna 2018 14:23:30 UTC+1 Marcel Raad napsal(a):

Jeffrey Walton

ungelesen,
13.01.2018, 10:39:0613.01.18
an Crypto++ Users


On Saturday, January 13, 2018 at 8:20:36 AM UTC-5, zavodny...@gmail.com wrote:
Does anybody know why I'm getting this error? https://pastebin.com/YeGA4dgN

Show the entire build process for your program. Be sure it includes your call to make, the compile commands used to compile source files, the link command used to link objects and libraries, and the error messages.

Jeff

Marcel Raad

ungelesen,
13.01.2018, 10:39:1513.01.18
an zavodny...@gmail.com, Crypto++ Users
Am 13.01.2018 14:29 schrieb <zavodny...@gmail.com>:
Using the G++ option -lcryptopp. The program will compile if I keep the CryptoPP::SHA256 sha256Hasher; and comment the FileSource.

OK, now that's strange. What version of Crypto++ is this? Are you building it yourself or are you using a system package?

Marcel

zavodny...@gmail.com

ungelesen,
13.01.2018, 11:03:2013.01.18
an Crypto++ Users
5.6.3 from Fedora repo.

Dne sobota 13. ledna 2018 16:39:15 UTC+1 Marcel Raad napsal(a):

zavodny...@gmail.com

ungelesen,
13.01.2018, 11:42:2213.01.18
an Crypto++ Users
The entire command to compile my project is g++ main.cpp -o main -std=c++17 -lcryptopp. -Wall option, show nothing.

Dne sobota 13. ledna 2018 16:39:06 UTC+1 Jeffrey Walton napsal(a):

Jeffrey Walton

ungelesen,
13.01.2018, 14:04:3913.01.18
an Crypto++ Users


On Saturday, January 13, 2018 at 11:42:22 AM UTC-5, zavodny...@gmail.com wrote:
The entire command to compile my project is g++ main.cpp -o main -std=c++17 -lcryptopp. -Wall option, show nothing.

When the compile command completes by showing  nothing, that means it succeeded.

Your next step is to run it with ./main

Jeff

zavodny...@gmail.com

ungelesen,
13.01.2018, 14:26:2713.01.18
an Crypto++ Users
Oh sorry... If i add the -Wall option it show nothing more. I still getting the same error as I pasted into Pastebin.

Dne sobota 13. ledna 2018 20:04:39 UTC+1 Jeffrey Walton napsal(a):
Die Nachricht wurde gelöscht

Jeffrey Walton

ungelesen,
15.01.2018, 09:55:5915.01.18
an zavodny...@gmail.com, Crypto++ Users
On Mon, Jan 15, 2018 at 9:50 AM, <zavodny...@gmail.com> wrote:
> Any toughts?

You have not provided enough information.

Please provide the entire build process for your program and the
library. Be sure it includes your call to make, the compile commands

zavodny...@gmail.com

ungelesen,
15.01.2018, 13:59:5815.01.18
an Crypto++ Users
What you mean by "entire build process"? I have installed CryptoPP from Fedora repos (5.6.3), then for build I do g++ main.cpp -o main -std=c++17 -lcryptopp. Nothing more. I don't use CMake and Make for this program yet. The error I get is pasted on Pastebin.

Also, I want apology for my English, since I'm not native. I'll try my best for you, to understand me.

Pondělí 15. ledna 2018 15:55:59 UTC+1 Jeffrey Walton napsal(a):

Jeffrey Walton

ungelesen,
15.01.2018, 14:19:0615.01.18
an zavodny...@gmail.com, Crypto++ Users
On Mon, Jan 15, 2018 at 1:59 PM, <zavodny...@gmail.com> wrote:
> What you mean by "entire build process"? I have installed CryptoPP from
> Fedora repos (5.6.3), then for build I do g++ main.cpp -o main -std=c++17
> -lcryptopp. Nothing more. I don't use CMake and Make for this program yet.
> The error I get is pasted on Pastebin.

Fedora does not build with -std=c++17. You have to build with the same
CFLAGS and same CXXFLAGS as the library was built with.

First, visit https://admin.fedoraproject.org/pkgdb/package/rpms/cryptopp/
. Second, click on "Package Source" and it take you to
http://pkgs.fedoraproject.org/cgit/rpms/cryptopp.git/ . Third, click
on "Tree" and it takes you to
http://pkgs.fedoraproject.org/cgit/rpms/cryptopp.git/tree/ . Finally,
click on "cryptopp.pc" and it takes you to
http://pkgs.fedoraproject.org/cgit/rpms/cryptopp.git/tree/cryptopp.pc
.

The *.pc is the package config file. It is located at
/usr/local/lib64/pkgconfig/cryptopp.pc on your system. Notice it does
not use the flags you are using. Related, why you have to use Cflags
(and not Cxxflags), see
https://lists.freedesktop.org/archives/pkg-config/2017-November/001087.html
.

The first thing you should do it try again, but this time without -std=c++17 .

Jeff

zavodny...@gmail.com

ungelesen,
17.01.2018, 14:43:5117.01.18
an Crypto++ Users
Still the same. I tried to uninstall cryptopp and cryptopp-devel packages, then do dnf clean all, then install the packages back and still the same error. The problem is somewhere in this line:

CryptoPP::FileSource createFileFingerprint(filePath.c_str(), true, new CryptoPP::HashFilter(sha256Hasher, new CryptoPP::HexEncoder(new CryptoPP::StringSink(fileFingerprint))));

Everything works fine only if I delete the line above and keep only the hasher init:
CryptoPP::SHA256 sha256Hasher;


Dne pondělí 15. ledna 2018 20:19:06 UTC+1 Jeffrey Walton napsal(a):

Jeffrey Walton

ungelesen,
17.01.2018, 15:56:1617.01.18
an zavodny...@gmail.com, Crypto++ Users
On Wed, Jan 17, 2018 at 2:43 PM, <zavodny...@gmail.com> wrote:
> Still the same. I tried to uninstall cryptopp and cryptopp-devel packages,
> then do dnf clean all, then install the packages back and still the same
> error. The problem is somewhere in this line:
> CryptoPP::FileSource createFileFingerprint(filePath.c_str(), true, new
> CryptoPP::HashFilter(sha256Hasher, new CryptoPP::HexEncoder(new
> CryptoPP::StringSink(fileFingerprint))));

When you make, pipe your output through c++filt:

g++ main.cpp -o main -lcryptopp 2>&1 | c++filt

Then post the error message.

I've got a feeling you are mixing and matching header files. Maybe the
you are using upcoming Crypto++ 6.0 header files and a Crypto++ 5.6.3
library from Fedora. That's because of:

undefined reference to
CryptoPP::BufferedTransformation::Skip(unsigned long)

The 'unsigned long' is _now_ the word64 type, but that change
occurred at Crypto++ 5.6.5. At 5.6.4 and below a word64 was 'unsigned
long long'. At Crypto++ 5.6.5 it was changed to a 'unsigned long'
under LP64 data models.

You should not be missing a "BufferedTransformation::Skip(unsigned
long)". If you are missing anything, it should be
"BufferedTransformation::Skip(unsigned long long)".

The change is detailed under "Notes for Distros" at
https://www.cryptopp.com/release565.html .

Jeff

zavodny...@gmail.com

ungelesen,
18.01.2018, 09:11:1718.01.18
an Crypto++ Users
Yes, you were right. I was mixing the header files. I removed all junk files and installed cryptopp again from repo. Works fine now. Thank you. :)

Dne středa 17. ledna 2018 21:56:16 UTC+1 Jeffrey Walton napsal(a):
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten