| hypercube1 (66) | |||
|
after reading about the rsa cipher i wanted to make my own version. it uses the gmp library, i think the code is all correct (except the chartonum, it enciphers each letter seperately making it a simple monalphebetic but will change later) the problem is a bunch of linker errors if you have used gmp on dev you may have a solution. i've seen this sort of thing when using statics and constants.
errors C:\DOCUME~1\***\LOCALS~1\Temp\ccwdcaaa.o(.text+0x197) In function `main': [Linker error] undefined reference to `__gmpz_init' [Linker error] undefined reference to `__gmpz_init_set_ui' [Linker error] undefined reference to `__gmpz_array_init' [Linker error] undefined reference to `__gmpz_init' and so on with similar ones... any help would be apreciated | |||
|
|
|||
| Athar (3764) | |
| Linking gmp might help. | |
|
|
|
| hypercube1 (66) | |
| the includes, libraries, and binaries are all linked | |
|
|
|
| yoyowinwin (5) | |
|
Hello, hypercube1. pay attention to Line 37: cout << ciphertext[i] << endl;so,you need to add an include "gmpxx.h", and link gmp with -lgmp -lgmpxx or change this line like this : gmp_printf("%Zd\n",ciphertext[i]);cheers | |
|
|
|
| hypercube1 (66) | |
| much thanks about the output, however it is linked to those libs, or atleast dev says it is. is there a way to link with specific libs from a preprocessor standpoint? or is there another step to linking in dev other than adding the libs to the directories from compiler options? | |
|
|
|
| hypercube1 (66) | |
| Nevermind, i figured it out, i didn't realize that you have to put it into project format and use the project options to link specific libs. if anyone knows a way around that it would be appreciated, i'd rather use individual .cpp files than the pesky .devs | |
|
|
|
| Zhuge (2471) | |
| Most IDEs (the ones I've seen) determine which cpps to link together to a single executable by grouping them in a project. | |
|
|
|
| hypercube1 (66) | |
| i just haven't used many other libs or done anything with a whole lot of cpps | |
|
|
|
| Athar (3764) | |
| Should've said so in my first post, but first thing you should do is to ditch Dev-C++ (and make sure the bundled MinGW is fully deleted as well) and install Code::Blocks instead. | |
|
|
|