User forums > Using Code::Blocks
how to properly set up a library?
ouch:
your getting there.
undefined reference means it can't find your header file.
you either a: set your search directory wrong in the compile sub tab or b: you forgot to include the header in your hello world sample. (#include <stuff.h>)
blueeyedlion:
I included the header in the source code: #include <curses.h>
For the menus I did this:
project
build options
search directories
compiler
put in the directory of the header file (which is coincidentally the same directory as the library)
I did this the first time, an error resulted. I redid it, same error.
Is there anything else I could try?
Jenna:
--- Quote from: ouch on April 23, 2011, 07:14:38 am ---undefined reference means it can't find your header file.
--- End quote ---
That's wrong.
It means the header-file (with the declaration( is found (otherwise you get compiler errors.
But this is a linker error, that says, it does not find the stdscr in any of your linked libraries.
blueeyedlion:
Do you have any idea of what I can do to fix it?
ouch:
Yep jens right, it was late and I didn't catch that...
But it's not finding that function in the library.
check your spelling.
but it's probably more likely that the library you are using wasn't compiled with the gnu compiler (or compatible one). often people try to use static libraries written from microsoft's compilers with the gnu one and that doesn't work. Even less so if the library uses microsoft specific commands in the code. (and they almost always do)
You have to get a version of the library written with gnu in mind. best way to do that is to compile it yourself if possible.
where did you get this library?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version