Author Topic: help: graphics on codeblock  (Read 8275 times)

Stefanolima

  • Guest
help: graphics on codeblock
« on: January 26, 2010, 01:43:18 pm »
Hi!

I'm used to write simple programs on codeblock which run on consle. i.e.console applications. When I try to compile programs which need graphic features, I get stuck as many libraries 9especially header files) are not in MINGW/include folder so I have to search on the net and add those files into include. My question is, by default, to enable graphics features on code block which "folder" should I download and incorporate it into codeblock? I tried to follow examples on glut, opengl, that is you have to download glut and add it somewhere on codeblock. Now I just want to have graphics functionality especially which need graphics.h file, searched on the net and find that sometime you have to download BGI, sometimes you have to download SDL, etc.

I hope you get the picture of what I'm trying to understand, it seems that by default codeblock doesn't come with graphic functionality e.g.graphics.h file, now what shall I download, and where do I add it so that I can draw graphs etc on codeblock.

[codeblock has /include folder in C:\Program Files\CodeBlocks\MinGW\include, now whenever I download new feature e.g. glut has its own version of include, lib folders etc. Is it necessary to add those include, lib on inlude, lib of C:\Program Files\CodeBlocks\MinGW? or it should work on its own original path? suppose I download glut on C:\Program Files\CodeBlocks\Glut. Now, what folder should I download to have graphics on codeblock?...

I hope my question has been understood although I have explained in a repeatitive way as I'm a newbie on compiling programs

Cheers,
Stefano

Offline TerryP

  • Multiple posting newcomer
  • *
  • Posts: 26
    • My journal
Re: help: graphics on codeblock
« Reply #1 on: January 26, 2010, 05:52:42 pm »
Note: I don't use MinGW installs bundled with other programs (like Code::Blocks or Strawberry Perl), just the MinGW and MSys packages from MinGWs website.


MinGW should supply the necessary library files for linking in the lib folder. On UNIX the names for the -l switch are usually GL and GLU; for Windows it is opengl32 and glu32. My MinGW install supplies suitable files for linking in that lib folder, and the actual DLL files are stored in %SystemRoot%\system32\, under the name opengl32.dll and so on; because they are built into Windows.

In MinGW's include folder, you should see a GL folder containing gl.h, glext.h, and glu.h. Assuming you are using the usual #include <GL/gl.h> style, it should be fine.




I would suggest double checking your compiler configuration.

Various other third party libraries should have variables set per compiler, that point to the necessary search directories, and added to your project through the variables, or if used a lot, just added to the compilers standard search paths.
Just Another Computer Geek

Offline koso

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: help: graphics on codeblock
« Reply #2 on: January 26, 2010, 06:41:15 pm »
This has practicaly nothing with C::B, but it is related to compiler and linking external libraries. In this case, you have two possibilities:

1. move downloaded files to folder, which is in your compiler search path. This path is shown in the output of "gcc -v". Mostly header files are placed in "include" directory under MinGW, and libraries under "lib" folder.

2. move downloaded files everywhere you want, and add this path to the C::B project settings. It is under build options -> search paths.