Author Topic: New User, stumped  (Read 4578 times)

Offline Chett

  • Single posting newcomer
  • *
  • Posts: 4
New User, stumped
« on: September 20, 2009, 08:38:28 am »
I only started using codeblocks a couple weeks ago. Learning codeblocks and dusting off some old out of date programming skills.

My current goal started out to install and use Cg ...then of course had to back up and get glut ..

After a bit I gave up on glut and switched to glfw. But I am really hitting the same problem with both:

ld.exe||cannot find -lgl|

I have so many paths and links added trying to fix this I am starting to lose track. (I even tried just dumping copies of the lib files in codeblocks lib)

Running ver. 8.02 on windows xp

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: New User, stumped
« Reply #1 on: September 20, 2009, 09:39:40 am »
Download and install mingw: http://www.tdragon.net/recentgcc/
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline Chett

  • Single posting newcomer
  • *
  • Posts: 4
Re: New User, stumped
« Reply #2 on: September 20, 2009, 09:53:45 am »
A whole new gcc compiler? care to explain?

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: New User, stumped
« Reply #3 on: September 20, 2009, 11:25:40 am »
A whole new gcc compiler? care to explain?
Ahh, sorry, I misread error message you posted. Try to use libopengl32.a instead libgl.a.
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline Chett

  • Single posting newcomer
  • *
  • Posts: 4
Re: New User, stumped
« Reply #4 on: September 20, 2009, 01:42:07 pm »
Since thats in the lib wouldn't it get used automatically? Would I need to actually remove other libs?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: New User, stumped
« Reply #5 on: September 20, 2009, 02:17:42 pm »
The question is unrelated to Code::Blocks. The error message is produced by the linker and it clearly states that -lgl (libgl.a) could not be found. polygon7 already told you what to do, even when these forums are not to solve programming issues (removing gl and having opengl32 instead is what you need).

Further questions regarding OpenGL, any other library and programming in general just do not belong here.

Offline Chett

  • Single posting newcomer
  • *
  • Posts: 4
Re: New User, stumped
« Reply #6 on: September 20, 2009, 04:44:13 pm »
I'm sorry what forum does help with codeblocks belong in?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: New User, stumped
« Reply #7 on: September 20, 2009, 07:12:57 pm »
Help: Code::Blocks installation/troubleshooting issues. This is NOT a general programming board.

Not being able to create an executable because the linker can not find a library is in no way related to Code::Blocks. A compiler is provided in the Setup program just for convenience. That compiler is the Windows port/target of GCC provided by MinGW, which is the most commonly used compiler with Code::Blocks (even Code::Blocks for Windows is built with it). That compiler happens to include OpenGL headers and libraries, thus making it possible to create OpenGL applications using the default installation. By checking the directory with the library files, there is no file called libgl.a. The question is: do you really need that file? With a bit of Google-ing, or by following polygon7's advice, you should find out that in Windows the right library file to link against is called libopengl32.a. What you have to do is to remove gl from the list of libraries to link against in the Build options and put opengl32 instead.

Thing is, finding out the right library names for each specific application is the user's task. If you are using MinGW and it's giving you some sort of strange problems, the right place to ask is in MinGW's website or mail list. If the problems are errors or warnings produced by your code, you should ask in a programming board specific to the programming language you are using. If you have questions about OpenGL, you should ask them at OpenGL's website or in a forum that provides help for it (usually game programming boards).

Even if there are people willing to help with those specific issues here, such posts only create 'noise' in the forums because they have nothing to do with the IDE. That also means that the moderators will have to read those posts to be sure there's nothing wrong (legally speaking), and that becomes extra work for them when they are doing it in their spare time to begin with. Anything Code::Blocks related is welcomed here. We are open for discussion about any problems and suggestions, as long as they stay on-topic. As a side note, some moderators have become a bit 'grumpy' due to the constant posting of unrelated questions, or asking the same questions over and over again because users do not search the forums first.

I am aware it may be a bit difficult to really know when a specific issue is Code::Blocks related or not. Getting it to know is also part of the learning curve (sort of), and it will help you to troubleshoot all your problems more easily by always knowing in which direction you must head (as in 'where to ask').

Sorry for the long answer, and I hope you get your program to work.