Setting up Eclipse for C++ OpenGL development on Arch (Help, please!)

I've recently switched over to Arch (and love it) from Windows 7, and am trying to start developing in OpenGL using C++. I've used Eclipse a lot on the Windows side for Java development, but I'm having trouble referencing the OpenGL libraries in the C++ stuff.
My code is as follows:
#include <GL/gl.h>
#include <GL/freeglut.h>
int main(int argc, char **argv) {
glutInit(&argc, argv);
return 0;
I don't believe the problem's there because the code won't even begin to compile.
I tried to find and select the libraries I need in the project properties, but I really have no idea what I'm doing in there. In the current state of things, this is my console output:
**** Build of configuration Debug for project CGame ****
make all
Building target: CGame
Invoking: Cross G++ Linker
g++ -L/usr/include/GL -o "CGame" ./main.o -l/usr/include/GL
/usr/bin/ld: cannot find -l/usr/include/GL
collect2: error: ld returned 1 exit status
make: *** [CGame] Error 1
**** Build Finished ****
This is what some parts of Eclipse's configuration look like:
Can anybody lend me a hand? I've been searching around on the Internet for a little while now, but I'm getting tired of all the shitty information there is. Many thanks if you can point out how to include the OpenGL/freeglut libraries in my project. If you want to see how my Eclipse stuff is configured, I can show you over Skype or TeamViewer.
Last edited by BLACKwave (2012-04-04 21:37:47)

Got it working? Great!
Personally, I use the GLFW window library for OpenGL coding. You can get it by:
pacman -S glfw
triangle.cpp
//========================================================================
// This is a small test application for GLFW.
// The program opens a window (640x480), and renders a spinning colored
// triangle (it is controlled with both the GLFW timer and the mouse).
//========================================================================
#include <stdio.h>
#include <stdlib.h>
#include <GL/glfw.h>
int main( void )
int width, height, x;
double t;
// Initialise GLFW
if( !glfwInit() )
fprintf( stderr, "Failed to initialize GLFW\n" );
exit( EXIT_FAILURE );
// Open a window and create its OpenGL context
if( !glfwOpenWindow( 640, 480, 0,0,0,0, 0,0, GLFW_WINDOW ) )
fprintf( stderr, "Failed to open GLFW window\n" );
glfwTerminate();
exit( EXIT_FAILURE );
glfwSetWindowTitle( "Spinning Triangle" );
// Ensure we can capture the escape key being pressed below
glfwEnable( GLFW_STICKY_KEYS );
// Enable vertical sync (on cards that support it)
glfwSwapInterval( 1 );
do
t = glfwGetTime();
glfwGetMousePos( &x, NULL );
// Get window size (may be different than the requested size)
glfwGetWindowSize( &width, &height );
// Special case: avoid division by zero below
height = height > 0 ? height : 1;
glViewport( 0, 0, width, height );
// Clear color buffer to black
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glClear( GL_COLOR_BUFFER_BIT );
// Select and setup the projection matrix
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 65.0f, (GLfloat)width/(GLfloat)height, 1.0f, 100.0f );
// Select and setup the modelview matrix
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
gluLookAt( 0.0f, 1.0f, 0.0f, // Eye-position
0.0f, 20.0f, 0.0f, // View-point
0.0f, 0.0f, 1.0f ); // Up-vector
// Draw a rotating colorful triangle
glTranslatef( 0.0f, 14.0f, 0.0f );
glRotatef( 0.3f*(GLfloat)x + (GLfloat)t*100.0f, 0.0f, 0.0f, 1.0f );
glBegin( GL_TRIANGLES );
glColor3f( 1.0f, 0.0f, 0.0f );
glVertex3f( -5.0f, 0.0f, -4.0f );
glColor3f( 0.0f, 1.0f, 0.0f );
glVertex3f( 5.0f, 0.0f, -4.0f );
glColor3f( 0.0f, 0.0f, 1.0f );
glVertex3f( 0.0f, 0.0f, 6.0f );
glEnd();
// Swap buffers
glfwSwapBuffers();
} // Check if the ESC key was pressed or the window was closed
while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS &&
glfwGetWindowParam( GLFW_OPENED ) );
// Close OpenGL window and terminate GLFW
glfwTerminate();
exit( EXIT_SUCCESS );
Then you can compile the code above by:
g++ triangle.cpp -o triangle -l GLFW -l GL
It just draws a rotating triangle, but should get you started on something more exiting.
Last edited by krigun (2012-04-04 23:39:45)

Similar Messages

  • On my HP printer Officejet4620 I get an error message "waiting for printer to become available".  Help please?

    On my HP printer Officejet4620 I get an error message "waiting for printer to become available".  Help please?

    Restart the computer and restart the printer. If you continue to have the problem the follow the steps Apple outlines in Reset Printing System feature article.

  • I can't change the country for my new credit card. Help please.

    I stopped family sharing, but I still receive a message that I belong to a family when I try to change the country for my new credit card. Help please.

    Sometimes logging out of iTunes can free up the editing.
    Do you use iTunes Match?

  • If someone phones my mobile number, they are prompted to leave a 10-second message which them comes to me as a text.  I want real voicemail with real voices but I don't know how to set it up on my iPhone4S.  Can someone help please?

    If someone phones my mobile number, they are prompted to leave a 10-second message which them comes to me as a text.  I want real voicemail with real voices but I don't know how to set it up on my iPhone4S.  Can someone help please?

    Ask your wireless provider.  None of what you describe has to do with the phone itself.

  • Setting up Eclipse for SDL

    I used the tutorial in this forum to set up SDL for Xcode, but I'm really more comfortable working with Eclipse. I can't get SDL running in eclipse.
    It does see <SDL/SDL.h> but I can't get it working in Eclipse. I copied all the project settings from the Xcode project.
    It will find <SDL/SDL.h>
    however i keep getting a:
    /usr/bin/ld: Undefined symbols:
    _main
    I read somewhere that SDL creates its own main and then somehow links
    it to yours. I've installed the SDL + developer libraries. I included
    SDLmain.m + h in my project & my project properties I've put under the Mac osX linker section at miscellaneous:other objects: /Library/Frameworks/SDL.framework/Versions/A/SDL and at Libraries: /Library/Frameworks/SDL.framework/Versions/A/Headers
    Did anyone get it up and running and could they possibly help me out? I'd appreciate it.
    Sincerely, Eelke

    I solved it. It took me a little week to find out but here's the solution:
    Copy SDLMain.m and SDLMain.h in the directory where your SDL program resides.
    In Eclipse use the following settings:
    GCC C++ compiler
    -Directories : "/System/Library/Frameworks/SDL.framework/Versions/A/Headers"
    Mac OSX C++ Linker
    - Miscellanous - Linker flags : -framework SDL -framework Cocoa ~/Dev/cs480/SDL_kenyon/SDLMain.m
    And it only took me a week to figure out! but it runs!

  • Ask for a way to learn Oracle and Developer 2000. HELP PLEASE!!

    Hi,
    I want to learn Oracle database and developer 2000. So I need the softwares.I am going to download
    1. Oracle Forms Developer/Server Release 6i for Windows NT
    2. Oracle8i Personal Edition on NT
    Before download them, I want to know if they can work together. I am in Australia, do you know where I can get the free softwares, or with lower price.
    If you have another way for self-training, please let me know.
    Thanks in advance.
    Sue

    They do work together, though the installation process is moderately complicated. You may want to check this web site: http://www.chow1.myweb.nl/
    This site has some experiences and procedures that have worked in the past for this combination.
    You should also check Amazon.com or your local tech bookstore for books on Developer.

  • How Can i SEt Dynamic Variant For WEEK on SELECTION Screen.pls help me..

    <b>Hi ALL..
    Pls Help Me for this Problem..i am very confused how can i do that...plese tell me proper process..
    i  want set Dynamice Varient for WEEK on Selection screen..
    I have ALrady SET Dynamice Varient for DATE on Selection Screen.ther isd option is D...but in case of WEEK there is a no option...
    Plese help me..
    thaks in advance..
    pls help me..</b>

    Hello,
    Define your select-option in TVARV (assume Z_THISWEEK). And use a program like:
    DATA:
      zlv_week TYPE KWEEK.
    call function 'DATE_GET_WEEK'       
       exporting date = syst-datum
       importing week = zlv_week.
    SELECT SINGLE *
          FROM tvarvc
         WHERE name = 'Z_THISWEEK'
           AND type = 'S'
           AND numb = '0000'.
    tvarvc-low = zlv_week.
    IF syst-subrc <> 0.
        tvarvc-name     = 'Z_THISWEEK'.
        tvarvc-type     = 'S'.
        tvarvc-opti     = 'EQ'.
        tvarvc-sign     = 'I'.
        tvarvc-numb     = '0000'.
        insert tvarvc.
    ELSE.
      update tvarc.
    ENDIF.
    Regards,
    John.

  • New to mac and i cant set up mail account with yahoo plus...help please!

    hello,its my first post and im having all sorts of problems settting up my mail account even though ive upgraded to yahoo plus as recommended....i just dont understand the port numbers and pop,can anyone help please?

    See these for help:
    Apple - Support - Mail Setup Assistant
    Configuring email accounts in Mail
    This is old but may still apply: OS X 10.5 Mail- Unable to set up Yahoo email account in Mail.

  • I can't setting 480p rightly working in adobe premiere pro, need help please.

    hi,
    i use premiere po and wish work in 480p (854x480).
    All my stuffs created and rendered (3d animation and images) are in this resolution format : 854x480
    In premiere pro, there is no 480p profil ! strange! why ?.. very disturbing !!
    Then i select the avchd 1280p and decided to change the parameters preview to 854x480 and save the profil :
    [IMG]http://www.michael-remy.fr/forum/901.jpg[/IMG]
    [IMG]http://www.michael-remy.fr/forum/902.jpg[/IMG]
    ps : What is red scared is what i don't manage to fixe or change !
    But, when i make my export video (export media) i saw big borders around my video !
    [IMG]http://www.michael-remy.fr/forum/900.jpg[/IMG]
    In fact, my content have been threated in 1280x480 instead of 854x480p even the right size of my sources files !
    Click here to see my workingspace :
    [URL="http://www.michael-remy.fr/forum/903.jpg"]http://www.michael-remy.fr/forum/903.jpg[/URL]
    what can i do ? i can't offord me to work in 1280p at source and don't want to upscale my 3d media source (bad quality result in upscale x2)
    i check every setting screen, and there are several with 1280x720 i don't manage to change :
    [IMG]http://www.michael-remy.fr/forum/904.jpg[/IMG]
    any help please ?
    ps : sorry for me expression, i'm french in fact...

    all my footage is already feautred, i can't do it again.
    Copy and paste your edited clips into the new sequence. Or, use the crop settings in the Export Settings window:

  • I'm not able to upgrade my Mac to itunes 10.5. Keep getting message "Run pre upgrade script for apple mobile device support" any help please?

    Hi I'm not able to upgrade my Mac OS X 10.5.8 to itunes 10.5 Keep getting message "the following install failed. run pre upgrade script for apple mobile device support" contact software manufacture for assistance. any help please?

    Did you ever figure out the problem? "Contact Software Manufacturer"?? That sounds ominous... I've got the same issue and I'm pretty durn aggravated right about now....
    Thanks!

  • TS2755 I have just updated my phone to iso 7 on my wifes i tunes on her computer, now when i send a message to people they get my email address come up and when i need to update it askes for her apple id.. any help please

    I have just updated my iphone to iso 7.0.2 on my wifes i tunes on her computer,now when i send a message to people they get my email address come up and when i need to update apps it asks for her apple id... any help please????

    ChrisJ4203,
    Thank you for the help.  Every app on my phone was downloaded using my old I-tunes ID.  I just hope that they will re-download under my new ID because I still can't change it on my phone.  In order to change to the new ID it says I have to sign out from the old ID and change to the new one.  My problem is that I don't remember my password to be able to sign out from my old ID.  Then the phone says it can change my password through e-mail and I  agree but I never get an e-mail at my old address or the new one.
    BHuyett

  • How to set polling interval for database adapter in interconnect?help plz!!

    Hi
    i have 4 database adapters with same name subscribing to same event in 4 different interconnect instances(i.e., same business event and application event in different hubs) and pointing to same source application database , same destination application database.
    source application database have one oai bridge schema.When a message has to be sent,message will be enqueued in messageobjecttable.This message can be taken by 4 databse adapters.and send to 4hubs then 4 messages will be sent to destination application instead of single message.
    To avoid this,I want to set database polling interval in 4 adapters sych a way that if one adapter take message in MESSAGEOBJECT TABLE,the other three adapters don't pick same message.
    this way i can avoid redundacy at destination application.Please reply soon
    Thanks

    You would seem to have an extremely unusual use case for interconnect. The whole purpose of Interconnect is to concentrate the message processing into one hub and distribute the message to those applications interested in it. The use of 4 hubs from one application is probably not supported for precisely the reasons you are having trouble. Can you give us more details of your use case?
    I am not sure that adjusting the polling interval for the different adapters will help. Since at some point you will get a collision where 2 or more adapters poll at the same time.

  • HT201342 Setting up IMAP for iCloud mail & gmail in Mozilla - Help

    On first setting up up Mozilla I successfully included iCloud and gMail.  Something happened and it lost them. The only crash I have had on here since new, over a year ago.  I am running Mozilla in Windows 7 Ultimate.
    It will not set the iCloud or gmail accounts up again. Perhaps I guessed the settings correctly the first time round.  So, next time I will make a note.
    Can anyone please give me the IMAP settings for both to enter into Mozilla's creat an account?
    Thanks!

    Took some time, so I have answerred my own query, but others may benefit!
    Apple is here
    IMAP (Incoming Mail Server) information:
    Server name: imap.mail.me.com
    SSL Required: Yes
    Port: 993
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    SMTP (outgoing mail server) information:
    Server name: smtp.mail.me.com
    SSL Required: Yes
    Port: 587
    SMTP Authentication Required: Yes
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    Note: If you receive errors using SSL, try using TLS instead.
    Additional Information
    SSL is required for both IMAP and SMTP connection with iCloud. POP is not supported by iCloud. 
    Gmail as follows
    Incoming Mail (IMAP) Server - Requires SSL
    imap.gmail.com
    Port: 993
    Requires SSL:Yes
    Outgoing Mail (SMTP) Server - Requires TLS
    smtp.gmail.com
    Port: 465 or 587
    Requires SSL: Yes
    Requires authentication: Yes
    Use same settings as incoming mail server
    Full Name or Display Name: [your name]
    Account Name or User Name: your full Gmail address ([email protected]). Google Apps users, please enter username@your_domain.com
    Email address: your full Gmail address ([email protected]) Google Apps users, please enter username@your_domain.com
    Password: your Gmail password
    If your client does not support SMTP authentication, you won't be able to send mail through your client using your Gmail address.
    Also, if you're having trouble sending mail but you've confirmed that encryption is active for SMTP in your mail client, try to configure your SMTP server on a different port: 465 or 587.

  • After reopening Firefox does not remember which desktop was used for each window. Can you help, please.

    I'm using two displays and several desktops on my Mac (OS X 10.9.4).
    When I need to restart Firefox, it remembers to open windows from last session in correct display, but does not remember which desktop was used for each window. So when the application starts, it opens all windows on a desktop which is currently active instead of reopening them on desktops used during the last session. How to fix the issue?

    Hi Nerva,
    Thank you for your question, there is a add on I have been recommended to custom set up of opening windows in new monitors. It's called [https://addons.mozilla.org/en-US/firefox/addon/monitor-master/ Monitor Master].
    However, in regards to the session remembering which monitor the window was open in, in the profile folder there is a file that stores window positions and dimensions. It is called localstore.rdf.
    Please stay tuned for more investigation, as there are definitely bugs on file for similar issues. Pinpointing it is the hard part.

  • Looking for best DVD quality as possible - help please !!!

    Hello All
    I have some footage ( 55min ) recorded on a Sony Z1 - HDV 1080 60i - 16:9 and edit on FCP. I exported the file on the same setting. Then sent to compressor to creat a DVD on DVD SP. I dont wanna let DVD SP encode the files, even because it will not accept files on HDV to autoring a SD DVD.
    Whats the best settings I can get to produce the best quality dvd as possible.
    What I did is use the DVD Best quality 90 min and raised the bit rate to its maximum - 7.7 or so. Is there a better way to do it or should I choose a different setting.
    Hope I could make myself clear.
    P.S. - Sorry for English.

    Hi
    I think that the following tutorial will help you: [Exporting HDV Video from the Timeline to Standard Definition DVD|http://www.kenstone.net/fcphomepage/hdv_timeline_to_sddvd.html].
    You need FCP 6 (FinalCut Studio2) ti use ProRes codec.
    PS: Sorry for my english ... I'm from Argentina !
    Hope that helps !
      Alberto
    Message was edited by: Silal

Maybe you are looking for

  • Need advice on backup hardware

    I am using an Xserve for a disk-to-disk backup, and as our data has expanded, we need more backup room. The Xserve is connected to a RAID, and we need to back up about 1.5 TB from that RAID once a week for offsite storage. Each night, the backups go

  • Can i connect imac and macbook by usb?

    can i connect imac and macbook pro by using USB clable? i just want pass my files and music from macbook to imac. thank you

  • Applications installed with pacman only start with root

    Hi, I used linuxdcpp a few times some weeks ago, but now when I try to run it in terminal nothing happens and... $ linuxdcpp $ as if it closed directly after it starts. $ linuxdcpp $ echo $? returns 0. Also, I can run it in root without any problem.

  • Pause button for iTunes

    Is there a way to reserve the Pause button (on my keyboard) for iTunes? I don't need slide shows, but I need to start/pause my music often during work. Thanks!

  • Changes to SC Workflow - queries

    Hi all, We have implemented the WF 140000133 for 2 step approval of SC based on the cost centre details in the first line item of the SC. Now we want to change the WF such that Work item goes to all the different cost centres which are there in a mul