error with lib. that dont work

CodeLite installation/troubleshooting forum
dalecoper
CodeLite Curious
Posts: 2
Joined: Wed Mar 12, 2014 9:41 am
Genuine User: Yes
IDE Question: c++
Contact:

error with lib. that dont work

Post by dalecoper »

Hello, i am studing c: , and i try to do a simple library.
That is the Code:

#include <stdio.h>
#include "helloworld1.h"
#include "helloworld.h"

int main(int argc, char **argv)
{
sayName();
sayHello();
return 0;
}

helloworld.h is a library, but when i compile say that:
c:/test/HelloWorldApp/HelloWorld1/src/main.c:3:24: fatal error: helloworld.h: No such file or directory
the file and directori of helloworld.h is
c:/test/HelloWorldApp/HelloWorldLib/include/helloworld.h

in settings of HelloWorld1 i put:
in linker: Library Paths : ../bin and in libraries: HelloWorldLib
in compiler: include paths: ./include

what is wrong? :(
thanks!
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: error with lib. that dont work

Post by eranif »

dalecoper wrote:in settings of HelloWorld1 i put:
in linker: Library Paths : ../bin and in libraries: HelloWorldLib
in compiler: include paths: ./include
The include paths you placed are wrong

You used relative path in the include path, however, it is relative to the HelloWorldApp.project (when using relative paths, its relative to the .project file of the current project)
So if your HelloWorldApp .project file is under

Code: Select all

c:/test/HelloWorldApp/HelloWorld1/
,
then the compiler will handle ./include as "c:/test/HelloWorldApp/HelloWorld1/include" which does not exist


Eran
Make sure you have read the HOW TO POST thread
dalecoper
CodeLite Curious
Posts: 2
Joined: Wed Mar 12, 2014 9:41 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: error with lib. that dont work

Post by dalecoper »

thank you very mach!! that work now!!
Post Reply