Daddy
Daddy

Reputation: 9035

Adding C++ to Objective-C, error on #include for cryptlib.h and curl.h

EDIT : OK, I fixed the issue I outlined originally with not being able to find headers for curl and cryptlib. But, after fixing these issues by installing curl and libcryptopp with macports, I encountered a zillion errors in the associated files. I'm marking this answer as complete though

I'm trying to add the Mega.co.nz client SDK to an Objective-C XCode project. The client is written in C++, with .h header files and .cpp implementation files. XCode recognizes these as needing to be compiled with the C++ compiler (I presume).

At this point all I want to do is get the project to compile with no errors. At this time I am getting two errors, both of them on some #include statements.

#include <curl/curl.h> 'curl/curl.h file not found'
#include <crypto++/cryptlib.h> 'crypto++/cryptlib.h file not found'

I think it has something to do with me not having the correct components installed or not referenced correctly within XCode. Should I be linking against a static library to get these headers? Is there a project setting I need to change to search in a specific directory to find these files?

If you can help, thank you very much.

Upvotes: 0

Views: 995

Answers (1)

kamjagin
kamjagin

Reputation: 3654

Xcode cannot find the above headers. This is because they are not in the include path. This is most likely to one of two reasons.

  1. You don't have the above libraries installed.
  2. You haven't added the correct path to your build config (like /opt/local/include if you are using macports)

Solutions to try:

  1. Make sure that you actually installed Curl and cryptopp (crypto++) (i.e. compiled them yourself or used a package manager like macports or brew)

  2. Make sure that your build includes the paths to these files (Look at the "header search paths" in xcode project settings

PS. Do not think about linking or such - this has nothing to do with it. You will run into these problems after you've actually compiled the code - i.e. in the linking phase :)

Upvotes: 3

Related Questions