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
Partial Template Specialization Based on "Signed-Ness" of Integer Type
How to Debug C++11 Code with Unique_Ptr in Ddd (Or Gdb)
Fseek Does Not Work When File Is Opened in "A" (Append) Mode
Gcc 7, -Wimplicit-Fallthrough Warnings, and Portable Way to Clear Them
Why Do You Need to Append an L or F After a Value Assigned to a C++ Constant
Lambda Capture by Value Mutable Doesn't Work with Const &
C++ Regular Expressions with Boost Regex
Std::Istream_Iterator<> with Copy_N() and Friends
Windows Named Pipe Support in Linux
Are Destructors Run When Calling Exit()
Why How to Implicitly Convert an Int Literal to an Int * in C But Not in C++
Using Raii to Manage Resources from a C-Style API
Bring Window to Front -> Raise(),Show(),Activatewindow() Don't Work
Adding Header and .Cpp Files in a Project Built with Cmake
Popen() Writes Output of Command Executed to Cout
What Does a Comma Separated List of Values, Enclosed in Parenthesis Mean in C? a = (1, 2, 3);