I had MESA(OpenGL) installed from before. I had been given the fltk to write a program on that will run on Linux. I ran make and installed it. I didnt receive any error message at that time. But the program won't compile as given in the tutorials. The compiler didn't detect the header files even when I had put all the FLTK header files in the folder containing my program or vice versa.
FLTK compiling problem
Started by chax, Oct 10 2007 03:43 AM
1 reply to this topic
#1
Posted 10 October 2007 - 03:43 AM
Size does matter for science and its laws changes accordingly.
[SIGPIC][/SIGPIC]
An C
[SIGPIC][/SIGPIC]
An C
|
|
|
#2
Posted 10 October 2007 - 04:51 AM
I assume you've found a tutorial, which includes a sourcecode. Now you want to try the sourcecode, and see how it works. So you copy+paste the sourcecode, into a document. The sourcecode looks somewhat like this:
There's three ways to solve your problem.
1. Include your program-folder as the compilers include-folders, i.e. where the compiler will look for the files needed. It differs from compiler to compiler, how to do it, but to illustrate it, I'll give you an example with GCC.
2. You could move all the files into the compilers include-folders. Remember; library-files and header-files are not put into the same folder, at least not with most compilers. They'll be in a library-folder and include-folder (GCC: "lib" and "include", respectively.)
3. Change the way of your including. Instead of using the chevrons, you could use double-quotes for the including. Remember; standard libraries is still in the compilers include-folders, so they still need chevrons.
// #include-statements #include <the_library_you_need.h> // Code, code and code here...When your compiler reads this, it assumes that the header-files you needs is in the compilers include-folder. But you've putted them in your program-folder, and that's why it can't find the header-files. It's the same with the library-files, you need for the linking process.
There's three ways to solve your problem.
1. Include your program-folder as the compilers include-folders, i.e. where the compiler will look for the files needed. It differs from compiler to compiler, how to do it, but to illustrate it, I'll give you an example with GCC.
gcc -I. <All your other stuff here>The parameter -I is used for including other folders for looking. The argument passed is '.', and it simply mean "this folder."
2. You could move all the files into the compilers include-folders. Remember; library-files and header-files are not put into the same folder, at least not with most compilers. They'll be in a library-folder and include-folder (GCC: "lib" and "include", respectively.)
3. Change the way of your including. Instead of using the chevrons, you could use double-quotes for the including. Remember; standard libraries is still in the compilers include-folders, so they still need chevrons.


Sign In
Create Account


Back to top









