Author Topic: error on compiling OpenGL stuff on Ubuntu using Code::Blocks  (Read 3692 times)

wcharm1987

  • Guest
error on compiling OpenGL stuff on Ubuntu using Code::Blocks
« on: February 18, 2010, 11:47:41 am »
Hello.
I got some sources from book and tried to compile it on Ubuntu using Code::Blocks..
However, I got an error message as following:

---------------------------------------------------------------------------------------
error: windows.h: No such file or directory
---------------------------------------------------------------------------------------

I know the problem but do not know how to fix it.. I try to find statement "#define WIN32_" but there were no definition like that in all of my source and header files.
Here is my main.cpp source.. It should run code after 'else' statement, but it runs codes after '_WIN32', which shouldn't be.

---------------------------------------------------------------------------------------
#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN

#define GLX_GLXEXT_LEGACY //Must be declared so that our local glxext.h is picked up, rather than the system one

#ifdef _WIN32
#include <windows.h>
#include "glwindow.h"
#else
#include "glxwindow.h"
#endif

#include "example.h"

#ifdef _WIN32
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR cmdLine,
                   int cmdShow)
{
#else
int main(int argc, char** argv)
{
#endif
----------------------------------------------------------

Anyone know how to avoid WIN32_?
Thanks

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: error on compiling OpenGL stuff on Ubuntu using Code::Blocks
« Reply #1 on: February 18, 2010, 12:02:04 pm »
Anyone know how to avoid WIN32_?
Surer, but not in this forum. This is not a general programming forum. Please respect our forum rules. Try a OpenGL related / C/+++ related forum.

Topic locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ