Cooperation between Eclipse and Crypto++

亡梦爱人 提交于 2020-01-06 05:40:29

问题


I am trying to use the Crypto++ Library for AES encryption/decryption. Installation went on well, and I created a Project in Eclipse. In the Project Explorer, under the "includes" category, I can see /usr/include/crypt.h, /usr/include/crypt++/aes.h and /usr/include/cryptpp/aes.h.

When I type #include <aes.h>, Eclipse interprets it as an "Unresolved Inclusion". On the one hand, it seems normal because aes.h is not located directly in the /usr/include directory. On the other hand, on every Tutorial I have found they seem to #include aes.h; neither do they refer to crypto++/aes.h nor to cryptopp/aes.h.

I have one year's experience in C and C++ using gedit, but this is my first attempt to use Eclipse. I have installed the C/C++ Development Plugin, and the include directory settings seem to be correct. Is there something I am missing?


回答1:


As you you've said that's normal since the file are located in a folder inside /usr/include, not directly into the include directory, anyway this has nothing to do with Eclipse or any other IDE but it's just a matter of GCC and the enviromental variable "C_INCLUDE_PATH" if you're using plain C or "CPLUS_INCLUDE_PATH" if you're with g++, if you really don't want to use the #include cryptopp/aes.h sintax just append the /usr/include/cryptopp folder to the appropriate enviromental variable, maybe with a line like this one in your .bashrc file

C_INCLUDE_PATH= $C_INCLUDE_PATH:/usr/include/cryptopp

anyway, I don't really see any problem in using #include cryptopp/aes.h



来源:https://stackoverflow.com/questions/18968579/cooperation-between-eclipse-and-crypto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!