Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiling minimal GLEW application under Cygwin
    primarykey
    data
    text
    <p>Let's consider the following program and try to compile it under Cygwin:</p> <pre><code>#include &lt;GL/glut.h&gt; int main(int argc, char** argv) { glutInit(&amp;argc, argv); glLoadIdentity(); } </code></pre> <p>It compiles and runs just fine. <code>-I/usr/include/opengl</code> seems to be terribly important.</p> <pre><code>g++ -I/usr/include/opengl -I../include/cygwin -L../lib/cygwin test.cpp -o test.exe -lglut32 -lglu32 -lglew32 -lopengl32 </code></pre> <p>Now,</p> <pre><code>#include &lt;GL/glew.h&gt; // from newest NVIDIA SDK #include &lt;GL/glut.h&gt; int main(int argc, char** argv) { glewInit(); glutInit(&amp;argc, argv); glLoadIdentity(); } </code></pre> <p>compiled by</p> <pre><code>g++ -I/usr/include/opengl -I../include/cygwin -L../lib/cygwin test.cpp -o test.exe -lglut32 -lglu32 -lglew32 -lopengl32 </code></pre> <p>fails. How to build the second application?</p> <h3>First</h3> <p>There are several ways to build glew by from NVIDIA SDK: by VS, by cygwin, by cygwin with -D_WIN32. I also tried cygwin build of original glew from source.</p> <p>VS build gives</p> <pre><code>/cygdrive/c/DOCUME~1/kelebron/LOCALS~1/Temp/ccErbecl.o:test.cpp:(.text+0xa8): undefined reference to `_glLoadIdentity' collect2: ld returned 1 exit status </code></pre> <p>cygwin builds give many</p> <pre><code>../lib/cygwin/glew32.lib(glew.o):glew.c:(.text+0x38e): undefined reference to `_glXGetProcAddress' </code></pre> <p>and cygwin with -D_WIN32 does not compile at all (I was slightly motivated by <a href="http://sourceforge.net/mailarchive/forum.php?thread_name=cd39a5a20711290045u7f1f1f15g77a148c1453d8e79%40mail.gmail.com&amp;forum_name=glew-users" rel="noreferrer">this post</a>).</p> <h3>Second</h3> <p>There seem to be two ways to link with OpenGL<br> with -L/lib/w32api<br> or with -L/usr/X11R6/lib -lX11 -lXi -lXmu</p> <p>But, the -L directives do not change anything. I've got /usr/lib/w32api/libopengl32.a, but may be missing the X11 version (/usr/X11R6/lib/libGL?). What package should I include into Cygwin? I've installed all starting with libGL (not only...).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload