Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build #1

Open
carlosmanri opened this issue Nov 11, 2016 · 5 comments
Open

Can't build #1

carlosmanri opened this issue Nov 11, 2016 · 5 comments

Comments

@carlosmanri
Copy link

Hi,
I tried to build the library using cmake CmakeLists.txt and I get the next error:
CMake Error at cmake/modules/MacroOutOfSourceBuild.cmake:10 (MESSAGE):
libtvdb requires an out of source build.
What is happening?

@dgnorton
Copy link
Owner

@Manri98 The error message means that builds can't be run in the source directory tracked by git. Here's the solution:

cd build && cmake ..

If that runs successfully, edit libtvdb/src/tvdb_key.h to include your TVDB API key. Then run make in the build dir. If that runs successfully, a static library should be generated...

build/src/libtvdb.a

If you ran into missing dependencies during the build, make sure libcurl and libxml2 are installed. On Debian or Ubuntu:

sudo apt-get install libcurl4-gnutls-dev libxml2-dev

@dgnorton
Copy link
Owner

Also, once you get it building, there is some example code here.

@carlosmanri
Copy link
Author

Thank you so much, got it.
So no if I want to use the functions I can just include the .a file or I need to link it when I compile it.

@dgnorton
Copy link
Owner

Copy tvdb_key_template.h to a file named tvdb_key.h and then edit it to use your TVDB API key. In your code that will use the functions:

#include "tvdb.h"
#include "tvdb_key.h"

And, you will need to link in libtvdb.a at compile time.

@carlosmanri
Copy link
Author

Excuse me again but I have another issue. When I init libtvdb with
htvdb_t tvdb = tvdb_init(MY_API_KEY);
I get the next error:
error: undefined reference to tvdb_init(char const*)
but tvdb_init is already defined in tvdb.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants