Cannot Include Libraries

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Cannot Include Libraries

Post by blutbeere »

I am sry to open another noob topic, but I dont understand what I am doing wrong.
Maybe I am trying it to hard -.- lol. This probably belongs to a usual C++ Forum, but I hope anyone can help
me out once again.
All I want to do is include another Library mysqlcppapi, Box2D or irrNetLite for example.
The program compiles fine until I include the headers. But whenever I try to include a library, it wont find the headers.
I have defined the header folders for my Linker, I just dont get the problem with this...
http://imageshack.us/f/337/errorsso.jpg
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Cannot Include Libraries

Post by CuteAlien »

Headers are for the compiler - libraries are for the linker. So you have to set the include-paths to the header and the linker-path to the library.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

Wrote that wrong sry^^.
Lets take mysqlcppapi as example, I set the include paths in the search directories for the compiler
as I did with Irrlicht.
But I dont have any lib of mysqlcppapi, which I could set in the Linker :O
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Cannot Include Libraries

Post by CuteAlien »

The include folder you have to set seem to be in this case the parentfolder of mysqlcppapi (very that folder is called include).
And check - maybe the files really don't exist.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

I have posted a link for the picture in my first post.
I have checked the folders, they include the headers and it finds mysqlcppapi.h.
And if I use the parentdirectory it wont find mysqlcppapi.h anymore...
EDIT:
Getting the same problem with enet.
I set the correct header path : F:\enet\include\enet
and it pops 20 errors that headers are missing.
If i change the header path to F:\enet\include
The compiler is missing enet.h ...
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Cannot Include Libraries

Post by CuteAlien »

Well - you want it to find the missing headers. So the you have to set your include path in way it does that. If it does not find mysqlcppapi.h then anymore either use a second include directory (usually bad idea) or simply use the correct relative from your include-folder (usually the right idea) like #include "include/mysqlcppapi.h"
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

There is no difference...
I am just wondering if I need to compile those libraries myself? But there is no CMakerList to do so.
And since the include folder exists....I am not getting the problem at all.
Btw. I have the same problem with irrNetLite, including irrnetlite.h (and its headers) is no problem,
but whenever I want to add enet.h it pops hundrets of errors caused by missing headers.
To me this is nonsense, since I included the right folders...
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Cannot Include Libraries

Post by CuteAlien »

Well - just check the exact output. The files mentioned in your errors must be there - relative to an include-path which you have set. As I told you above in your case the parentfolder of mysqlcppapi. Either a) the file is not there, b) you didn't set the correct include path or c) you didn't set the include path at all but for example the library path instead.

And as long as you still get include errors you shouldn't worry about anything else. This are compiler errors - it makes no difference if you even have that library at all while compiling as long as you got the right headers.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

And as long as you still get include errors you shouldn't worry about anything else.
This is enough to worry about :P 3 Days now and I still cant get this to working...getting mad :>
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Cannot Include Libraries

Post by CuteAlien »

Yeah - what I mean is - don't start recompiling Libraries. That's a later step and has nothing to do with headers not being found. Headers problems are about compiling, libs are about linking which you can't do anyway unless you managed to compile it first.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

Yeah you right, the problem is: this is used to be so easy but I still havent found a solution yet.
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

Either a) the file is not there, b) you didn't set the correct include path or c) you didn't set the include path at all but for example the library path instead.
I have checked them all, its still now working...please take a look at my screenshot here
´Image
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Cannot Include Libraries

Post by zerochen »

you have 2 options

first, change the include path to c:\irrlicht-1.7.2\mysqlcppapi-2.0.0
and include the file with #include <mysqlcppapi\mysqlcppapi.h>

second, change in mysqlcppapi.h #include "mysqlcppapi\mysqlcppapi_internal.h" to #include "mysqlcppapi_internal.h"
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Cannot Include Libraries

Post by CuteAlien »

Uhm - I already wrote 2 times that you should use the parentfolder (!) of mysqlcppapi - why don't you just do that? So yeah - exactly like zerochen describes in his first solution.

Don't do the second thing if that is a library you include. Changing library-headers is nearly always a very bad idea (unless it's a configuration-header, but that's another topic).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
blutbeere
Posts: 29
Joined: Sat Nov 19, 2011 10:59 am
Location: Bergisch Gladbach, Germany

Re: Cannot Include Libraries

Post by blutbeere »

and include the file with #include <mysqlcppapi\mysqlcppapi.h>
thanks alot zerochen.

Sry Michael for not understanding you, I didnt see the forest for trees :).
The whole time I was trying to change the include path to the directory folder xD

Thanks for help guys
Post Reply