Compiling Simple Static Opengl 4.0 Program Using Mingw, Freeglut and Glew

Compiling Simple static OpenGL 4.0 program using MinGW, freeglut and glew

Try adding -lopengl32 last on the line to compile your program and see if it helps.

GLEW/SFML program not compiling in MinGW - GLChar not recognised

Watch the case: the correct type spelling is GLchar, not GLChar.

freeglut installation from sources - MinGW

Try using the

./configure --prefix=/mingw
make
make install

to put the .dll file into the specific directory. This way your files won't get "lost" within the MSYS directories. The "--prefix=" can use the "/drivename/localpath" format where 'drivename' is 'c', 'd' etc.

If this doesn't help, try compiling FreeGLUT manually using this howto: http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/

How can I cross-compile GLEW on ubuntu to windows for a program I am cross-compiling?

When creating software that's intended to run on several platforms and you're planning to cross compile, it's always a good idea to include the sources of 3rd party libraries (or the libraries themself if you don't have the source code) into your projects source and build tree.

Ideally everything can be built out-of-source-tree, but sometimes (often) that's not the case, so you've to do several builds manually, copying the resulting binaries at some place your main project's build system can access them.

For cross compiling it usually boils down to exactly specify which toolchain binaries to use. For example on Linux the MinGW cross compilers usually are named something like i686-w64-mingw32-… (or similar). When configuring the 3rd party libraries build you've to specify which ones to use. Depending on the build system this either happens through the CC, CXX, LD and some other environment variables, or through the BUILD, HOST and TARGET variables (see here https://stackoverflow.com/a/5139451/524368).

The best situation is, if you can integrate everything that's 3rd party into your projects build system, because that relieves you from manually managing that. Personally I've come to like the CMake build system a lot, because it supports out-of-tree builds and if you've got libraries that use CMake themself you can simply copy their source trees into a subdirectory of your project and include their CMake configuration.

Note that's it's often a valid option to replace a projects build system if the build itself is not too complicated (replacing the build system of something like the Linux kernel or ffmpeg is madness, replacing the build system of something like GLFW may be a viable option).

Using MinGW to compile OpenGL and getting glut Linker errors

Well, everything you do looks right. My best bet is, that the build of FreeGLUT you're using (specifically the .def and .lib linker stubs) don't match (possibly also the .dll). My suggestion would be, to build FreeGLUT from sources using the very same compiler you're also using to build your program. Try that, and report on any differences.



Related Topics



Leave a reply



Submit