Archived

This topic is now archived and is closed to further replies.

Puzzler183

Gah GLUT 2.0

Recommended Posts

Puzzler183    540
OK, I''m using Dev-C++ for all of this, so here''s the deal. I got the xmission GLUT, and in the zip there was glut.h which I moved to the includes/gl/ folder. I was about to move the glut32.lib to the lib/ directory, when I noticed that all the files in there had the .a extension. And as luck may have it, there was a libglut32.a and a libglut.a (all the files has lib at the beginning). I didn''t know what to do with DEF file (I am assume the latter may be the problem) so I left it be. I also moved the dll to C:\windows\system32\ and C:\windows\system. My code is:
#include <iostream.h>
#include <gl/glut.h>

int main()
{
     cout << GLUT_LEFT_BUTTON << "\n";
     cout << GLUT_MIDDLE_BUTTON << "\n";
     cout << GLUT_RIGHT_BUTTON << "\n";
     cout << GLUT_UP << "\n";
     cout << GLUT_DOWN << "\n";
     return 0;
}
   
And I changed my linker options to reflect how it said I should do it with the other OpenGL libraries: -libopengl32 -llibglut32 I then tried to compile, and got: [Linker error] undefined reference to `__glutInitWithExit'' [Linker error] undefined reference to `__glutCreateWindowWithExit'' [Linker error] undefined reference to `__glutCreateMenuWithExit'' I really don''t know what''s going on there although I''m assuming it has something to do with that DEF file or my libglut32.a file missing functions... So do anyone have any ideas?

Share this post


Link to post
Share on other sites
Raloth    379
Ugh...I dream of the day people will stop asking about linker errors...

project->project options->parameters->add library or object

Find the glut library and add it.

Share this post


Link to post
Share on other sites
Fruny    1658
That will be the day when people stop answering without reading the whole question.

He's not using MSVC.

Puzzler - have you tried rebuilding the lib from source ?

C++Note - you shouldn't use <iostream.h> but <iostream>, along with std::cout and std::endl.



[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]


[edited by - Fruny on September 1, 2003 1:52:58 PM]

Share this post


Link to post
Share on other sites
Puzzler183    540
quote:
Original post by Fruny
C++Note - you shouldn''t use but , along with std::cout and std::endl.




Dev-C++ didn''t like that when I did it, and this is just a little temp test so meh. I''ll try rebuilding the lib I guess, although I''m thinking I''ll just find another place to download it and try again.

Share this post


Link to post
Share on other sites
Fruny    1658
quote:
Original post by Puzzler183
Dev-C++ didn''t like that when I did it, and this is just a little temp test so meh. I''ll try rebuilding the lib I guess, although I''m thinking I''ll just find another place to download it and try again.



Fair enough. Good luck.


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]

Share this post


Link to post
Share on other sites
Raloth    379
quote:
Original post by Fruny
That will be the day when people stop answering without reading the whole question.

He''s not using MSVC.

Puzzler - have you tried rebuilding the lib from source ?

C++Note - you shouldn''t use but , along with std::cout and std::endl.
I read every last word. The steps I gave are the steps to link a library in Dev-CPP.

Share this post


Link to post
Share on other sites
Puzzler183    540
quote:
Original post by Raloth
quote:
Original post by Fruny
That will be the day when people stop answering without reading the whole question.

He''s not using MSVC.

Puzzler - have you tried rebuilding the lib from source ?

C++Note - you shouldn''t use but , along with std::cout and std::endl.
I read every last word. The steps I gave are the steps to link a library in Dev-CPP.



I''m not building a project; I''m building a single file... Anyway, I''m in the process of reinstalled Dev-C++ and heck, I''ll get a newer better version so it''s all good.

Share this post


Link to post
Share on other sites
Puzzler183    540
OK, here we go again...

I reinstalled it but no luck! This is really pissing me off. I even tried creating a project and including both libglut32.a and glut32.lib but still nothing. The source and errors have canged slightly:


#include <iostream>
#include <gl/glut.h>

int main()
{
std::cout << GLUT_LEFT_BUTTON << "\n";
std::cout << GLUT_MIDDLE_BUTTON << "\n";
std::cout << GLUT_RIGHT_BUTTON << "\n";
std::cout << GLUT_UP << "\n";
std::cout << GLUT_DOWN << "\n";
return 0;
}


And the new errors are the same as the old ones only with @8, @8, and @12 appended respectively. Any more ideas Fruny?

Share this post


Link to post
Share on other sites
ZealousElixir    256
Apparently the GCC package even in your newest version of DC++ is outdated. I recommend doing like what you mention and trying to find a GCC-compatible set of GLUT libs for Win32, or rebuilding them. The former will likely be easier on you, but my casual searching didn''t turn anything up.

Raloth: Had you read and understood every word, you would have realized that the library was already correctly linked and that the problem was one of using a different version of the lib from that of the headers.

BTW: the @N notation represents the number of total bytes in the parameters the function receives.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

Share this post


Link to post
Share on other sites
Puzzler183    540
quote:
Original post by ZealousElixir
Apparently the GCC package even in your newest version of DC++ is outdated. I recommend doing like what you mention and trying to find a GCC-compatible set of GLUT libs for Win32, or rebuilding them. The former will likely be easier on you, but my casual searching didn''t turn anything up.

Raloth: Had you read and understood every word, you would have realized that the library was already correctly linked and that the problem was one of using a different version of the lib from that of the headers.

BTW: the @N notation represents the number of total bytes in the parameters the function receives.

Later,
ZE.


Thanks although that sounded kinda bleak to me... Oh well, I guess I''ll have to try it:/

Share this post


Link to post
Share on other sites
ZealousElixir    256
Never give up. Try this.

Nah, try this first (put it before your inclusion of glut.h):
#define GLUT_DISABLE_ATEXIT_HACK

[edited by - zealouselixir on September 1, 2003 5:40:38 PM]

Share this post


Link to post
Share on other sites