Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Issue with opengl(Error saying cant find -lopengl32)
Issue with opengl [message #1860829] Tue, 05 September 2023 11:04
Cojocaru Mihai is currently offline Cojocaru MihaiFriend
Messages: 1
Registered: September 2023
Junior Member
Hello everyone! I hope someone can help me. i have the next code and i get the following error:C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopengl23. Can you please guide me through? i tried everything i found on the internet but i cant seem to figure it out


#include <stdio.h>
#include <stdlib.h>
#include <Gl/glut.h>

float med(float a, float b, float c){
return (a+b+c)/3;
}

struct elevi
{
char n[50],p[50];
float n1,n2,n3,m;
};

int n;
struct elevi s[100];

void display() {
glClear(GL_COLOR_BUFFER_BIT);

// Desenează lista de elevi sortată după medie
glRasterPos2f(-0.9, 0.9);
char text[1000];
snprintf(text, sizeof(text), "Elevi sortati dupa medie:\n");
for (int i = 0; i < n; i++) {
snprintf(text, sizeof(text), "%s %s: %.2f\n", s[i].n, s[i].p, s[i].m);
for (char *c = text; *c; c++) {
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, *c);
}
}

glFlush();
}

int cmp(const void *a, const void *b) {
struct elevi *e1 = (struct elevi *)a;
struct elevi *e2 = (struct elevi *)b;
return (e2->m - e1->m) > 0 ? 1 : -1;
}


int main()
{
FILE *fisier;
FILE *fisierSortat;
int n,i;


printf("Introduceti numarul de elevi care au participat la Bacalaureat:");
fflush(stdout);
scanf("%d", &n);

struct elevi s[n];

for(i=0;i<n;i++)
{

printf("Introduceti numele si prenumele elevului:");
fflush(stdout);
scanf("%s %s", s[i].n,s[i].p);

printf("Introduceti nota de la Limba si Literatura Romana:");
fflush(stdout);
scanf("%f", &s[i].n1);

printf("Introduceti nota la Matematica:");
fflush(stdout);
scanf("%f", &s[i].n2);

printf("Introduceti nota la a 3-a proba:");
fflush(stdout);
scanf("%f", &s[i].n3);

s[i].m=med(s[i].n1,s[i].n2,s[i].n3);

}


fisier = fopen("fisier.txt", "w+");
if (fisier == NULL) {
printf("Nu s-a putut deschide fisierul pentru scriere.\n");
return 1;
}

fisierSortat = fopen("elevi_sortati.txt", "w+");
if (fisierSortat == NULL) {
printf("Nu s-a putut deschide fisierul pentru scrierea datelor sortate.\n");
fclose(fisier);
return 1;
}


for(i=0;i<n;i++)
fprintf(fisier, "%s %s\t%.2f %.2f %.2f %.2f\n", s[i].n, s[i].p, s[i].n1, s[i].n2, s[i].n3, s[i].m);

fclose(fisier);

qsort (s, n, sizeof(struct elevi), cmp);

fprintf(fisierSortat, "Elevi sortati dupa medie:\n");
for (i = 0; i < n; i++) {
fprintf(fisierSortat, "%s %s: %.2f\n", s[i].n, s[i].p, s[i].m);
}

return 0;}
Previous Topic:line del
Next Topic:Project opening fail
Goto Forum:
  


Current Time: Tue Jan 14 04:24:13 GMT 2025

Powered by FUDForum. Page generated in 0.03213 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top