Page 1 of 1

error with lib. that dont work

Posted: Wed Mar 12, 2014 6:36 pm
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!

Re: error with lib. that dont work

Posted: Wed Mar 12, 2014 10:27 pm
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

Re: error with lib. that dont work

Posted: Sat Mar 22, 2014 5:07 am
by dalecoper
thank you very mach!! that work now!!