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!
error with lib. that dont work
-
- CodeLite Curious
- Posts: 2
- Joined: Wed Mar 12, 2014 9:41 am
- Genuine User: Yes
- IDE Question: c++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: error with lib. that dont work
The include paths you placed are wrongdalecoper wrote:in settings of HelloWorld1 i put:
in linker: Library Paths : ../bin and in libraries: HelloWorldLib
in compiler: include paths: ./include
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
-
- 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
thank you very mach!! that work now!!