How to start an OpenGL project

General questions regarding the usage of CodeLite
mikeglaz
CodeLite Enthusiast
Posts: 13
Joined: Fri Mar 16, 2012 2:21 am
Genuine User: Yes
IDE Question: C++
Contact:

How to start an OpenGL project

Post by mikeglaz » Fri Mar 16, 2012 2:29 am

I have a small OpenGL program that runs fine from the command line with a Makefile which includes a bunch of linker options to OpenGL libraries. I tried creating a new Simple Executable (g++) but it doesn't let me use my main.cpp file. If I copy over my main.cpp file after creating the project it doesn't look inside my /usr/include/GL directory. And I don't know how to set the OpenGL libraries.

thanks,
mike

DavidGH
CodeLite Plugin
Posts: 635
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: How to start an OpenGL project

Post by DavidGH » Fri Mar 16, 2012 2:42 pm

Hi Mike,

If you already have a working makefile, you can tell CL to use this instead of its standard one. Either create a new project using the wizard, and select Others > Custom Makefile; or keep your current project but open the Project Settings, then in Customize > Custom Build tick the box and fill in the appropriate fields.

Regards,

David

mikeglaz
CodeLite Enthusiast
Posts: 13
Joined: Fri Mar 16, 2012 2:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to start an OpenGL project

Post by mikeglaz » Fri Mar 16, 2012 11:15 pm

Ok, when i create a test program with Console for Categories and select Simple Executable (g++) it builds me a main.cpp file which looks like this:
Image

When I create my OpenGL asteroids with Others for Categories and select Custom Makefile for Templates I get a workspace which looks like this after I build it:
Image
as you can see, there is no Src folder under my asteroids folder so I can't see any of my source.

Then I go into Workspace->Open Active Project Settings...->Customize I get this window which I don't know what to do with:
Image


Now when I try to run it I get this in my Output View window and nothing shows up in Terminal:
Current working directory: /home/mike/C++/OpenGL/asteroids2
Running program: /usr/bin/codelite_xterm ' ' '/bin/sh -f /usr/bin/codelite_exec '
Program exited with return code: -1

thanks in advance,
mike

DavidGH
CodeLite Plugin
Posts: 635
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: How to start an OpenGL project

Post by DavidGH » Sat Mar 17, 2012 12:13 am

as you can see, there is no Src folder under my asteroids folder so I can't see any of my source.
You need to add them: Right-click on (the project) asteroids and choose Import Files from Directory.
Running program: /usr/bin/codelite_xterm ' ' '/bin/sh -f /usr/bin/codelite_exec '
You haven't told it about the executable. In Project Settings > General, fill in the important fields e.g. Intermediate folder, Program and Working folder.

mikeglaz
CodeLite Enthusiast
Posts: 13
Joined: Fri Mar 16, 2012 2:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to start an OpenGL project

Post by mikeglaz » Sat Mar 17, 2012 1:17 am

Ok, figured it out. But I have a few more questions. What are the following for: Output File, Intermediate Folder, Working Folder?

thanks,
mike

DavidGH
CodeLite Plugin
Posts: 635
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: How to start an OpenGL project

Post by DavidGH » Sat Mar 17, 2012 1:26 am

But I have a few more questions. What are the following for: Output File, Intermediate Folder, Working Folder?
Have a look at http://www.codelite.org/LiteEditor/ProjectSettings

mikeglaz
CodeLite Enthusiast
Posts: 13
Joined: Fri Mar 16, 2012 2:21 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to start an OpenGL project

Post by mikeglaz » Sat Mar 17, 2012 3:48 am

Cool, thanx Dave, I really appreciate your help.

Post Reply