1
votes

I am using eclipse with C++ and opengl. However in my program I cannot use #include or I get the following error The program file specified in the launch configuration does not exist C:\Users\workspace\mapCreator\Debug\mapCreator.exe not found

The console looks like this

08:10:17 ** Incremental Build of configuration Debug for project mapCreator ** Info: Internal Builder is used for build g++ "-IC:\MinGW\lib\gcc\mingw32\4.6.2\include" "-IC:\MinGW\lib\gcc\mingw32\4.6.2\include-fixed" "-IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++" "-IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\backward" "-IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\mingw32" "-IC:\MinGW\include" -O0 -g3 -Wall -c -fmessage-length=0 -o

"src\main.o" "..\src\main.cpp" In file included from
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/char_traits.h:41, from
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/ios:41, from
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/ostream:40, from
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/iostream:40, from
..\src\main.cpp:4:
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h: In
function 'OI std::_copy_move_a(_II, _II, _OI)':
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:378:
error: expected primary-expression before ')' token

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:378: error: there are no arguments to '__is_trivial' that depend on a template parameter, so a declaration of '__is_trivial' must be available

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:378: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:383: error: '__simple' cannot appear in a constant-expression

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:384: error: template argument 2 is invalid

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h: In function 'BI2 std::_copy_move_backward_a(_BI1, _BI1, _BI2)': C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:573: error: expected primary-expression before ')' token

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:573: error: there are no arguments to '__is_trivial' that depend on a template parameter, so a declaration of '__is_trivial' must be available

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:578: error: '__simple' cannot appear in a constant-expression

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++/bits/stl_algobase.h:579: error: template argument 2 is invalid g++ -o mapCreator.exe

"src\main.o" -lopengl32 -lglut32 -lglu32 g++: src\main.o: No such file or directory

08:10:18 Build Finished (took 1s.31ms)

My code is just some sample code that i have been modifying and is the following:

#include <windows.h>
#include <GL/glut.h>
#include <iostream>
using namespace std;
const int WIDTH = 600;
const int HEIGHT = 480;
void init();
void display();
void loop();
void init() {
    glClearColor( 0.0, 0.0, 0.0, 1.0 ); /* Set the clear color */
}
/* Displays a black clear screen */
void display() {
    glClear( GL_COLOR_BUFFER_BIT ); /* Clear the screen with the clear color */
    glutSwapBuffers(); /* Double buffering */
}



/* The main function */
int main( int argc, char *argv[] ) {
    /* Glut setup function calls */
    glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB ); /* Use double buffering and RGB colors */
    glutInitWindowPosition( 100, 100 );
    glutInitWindowSize( WIDTH, HEIGHT );
    glutCreateWindow( argv[0] );
    init();
    glutDisplayFunc( display );  /* Call back display function */
    glutMainLoop(); /* Continue drawing the scene */
    return 0;
}

It currently crashes, however the second that I remove #include it works fine.

Some more information:

it would appear that the .exe is not being created for some reason- i've cleaned the project and i've built it and even restarted eclipse. But it has had no effect.

enter image description here

These errors are showing up

I have tried running an incredibly basic program but still using iostream,GL/glut.h, and windows.h and even then it still crashes. i would assume this means that it is something wrong with the way it is set up. Code if you really need it:

#include <iostream>
#include <GL/glut.h>
#include <windows.h>
using namespace std;
int main(){

cout<<"hello";
return 0;
}
2

2 Answers

0
votes

Try including windows.h after GL/glut.h in the first program.

0
votes
  1. Not compiling != "it crashes"
  2. "it would appear that the .exe is not being created for some reason" - how about a missing .o file? It's literally in the error messages.
  3. The errors from <iostream> can't be caused by a later inclusion of anything. You stated that you tried every combination, and even showed including <iostream> first. Did that cause the same errors? If so, your compiler installation is broken.