• Advertisement

Archived

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

alternative for 'windows.h' when using Linux??

This topic is 5096 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I tried to write a 3dengine unsing SDL. I used DEV-C++ with MS-Windows to write the main code. I allways tried to keep the code clear from Windows specific code but itseems like that I forgot something. I need an alternative include file for 'windows.h' because many basic things can not be compiled with my KDevelop 3.2 and my Debian Linux running a 2.4.22 Kernel SDL, FreeType6 and OpenGL devs installed. Here is the compiler output. I'm sure its easier to understand what I want when I print this here instead of my (bad) explanation here we go:
quote:
cd "/home/mcnugget/src/MF-Engine/mfengine/debug/src" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-enginetest.o -MD -MP -MF ".deps/mfengine-enginetest.Tpo" -c -o mfengine-enginetest.o `test -f 'enginetest.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`enginetest.cpp; then mv -f ".deps/mfengine-enginetest.Tpo" ".deps/mfengine-enginetest.Po"; else rm -f ".deps/mfengine-enginetest.Tpo"; exit 1; fi *In file included from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.h:5, *from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:1: */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:9: error: ' BITMAPFILEHEADER' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:10: error: ' BITMAPINFOHEADER' is used as a type, but is not defined as a type. *In file included from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.h:9, *from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:1: */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:12: error: '__int64' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:14: error: Fehler beim Parsen before `,' token */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:18: error: 'DWORD' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:19: error: 'DWORD' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:22: error: 'DWORD' is used as a type, but is not defined as a type. *make: *** [mfengine-enginetest.o] Fehler 1 *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFEngine.o -MD -MP -MF ".deps/mfengine-MFEngine.Tpo" -c -o mfengine-MFEngine.o `test -f 'MFEngine.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`MFEngine.cpp; then mv -f ".deps/mfengine-MFEngine.Tpo" ".deps/mfengine-MFEngine.Po"; else rm -f ".deps/mfengine-MFEngine.Tpo"; exit 1; fi *In file included from /home/mcnugget/src/MF-Engine/mfengine/src/MFEngine.cpp:3: */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:9: error: ' BITMAPFILEHEADER' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:10: error: ' BITMAPINFOHEADER' is used as a type, but is not defined as a type. *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFText.o -MD -MP -MF ".deps/mfengine-MFText.Tpo" -c -o mfengine-MFText.o `test -f 'MFText.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`MFText.cpp; then mv -f ".deps/mfengine-MFText.Tpo" ".deps/mfengine-MFText.Po"; else rm -f ".deps/mfengine-MFText.Tpo"; exit 1; fi *make: *** [mfengine-MFEngine.o] Fehler 1 */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp: In member function `int *MFText::LoadFont(const char*, unsigned int, const char*)': */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:202: error: `_stricmp' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:202: error: (Each undeclared identifier is reported only once for each function it appears in.) */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp: In member function `void *MFText::UnloadFont(const char*)': */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:263: error: `_stricmp' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp: In member function `int *MFText:rint(const char*, float, float, const char*, ...)': */home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:274: error: `_stricmp' undeclared (first use this function) *make: *** [mfengine-MFText.o] Fehler 1 *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFTexture.o -MD -MP -MF ".deps/mfengine-MFTexture.Tpo" -c -o mfengine-MFTexture.o `test -f 'MFTexture.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`MFTexture.cpp; then mv -f ".deps/mfengine-MFTexture.Tpo" ".deps/mfengine-MFTexture.Po"; else rm -f ".deps/mfengine-MFTexture.Tpo"; exit 1; fi *In file included from /home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:1: */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:9: error: ' BITMAPFILEHEADER' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:10: error: ' BITMAPINFOHEADER' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp: In member function ` *uint MFTexture::LoadTexture(const char*)': */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:85: error: `_stricmp' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:85: error: (Each undeclared identifier is reported only once for each function it appears in.) */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp: In member function ` *uint MFTexture::FindTexture(const char*)': */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:105: error: `_stricmp' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp: In member function ` *void MFTexture::UnloadTexture(const char*)': */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:115: error: `_stricmp' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp: In member function ` *uint MFTexture::LoadBMP(const char*)': */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:162: error: 'struct BITMAP_IMAGE' has no member named 'bmfHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:165: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */ho *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFTimer.o -MD -MP -MF ".deps/mfengine-MFTimer.Tpo" -c -o mfengine-MFTimer.o `test -f 'MFTimer.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`MFTimer.cpp; then mv -f ".deps/mfengine-MFTimer.Tpo" ".deps/mfengine-MFTimer.Po"; else rm -f ".deps/mfengine-MFTimer.Tpo"; exit 1; fi *me/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:168: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:170: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:171: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:171: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:173: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:186: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' */home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:186: error: 'struct BITMAP_IMAGE' has no member named 'bmiHeader' *make: *** [mfengine-MFTexture.o] Fehler 1 *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFVector2D.o -MD -MP -MF ".deps/mfengine-MFVector2D.Tpo" -c -o mfengine-MFVector2D.o `test -f 'MFVector2D.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`MFVector2D.cpp; then mv -f ".deps/mfengine-MFVector2D.Tpo" ".deps/mfengine-MFVector2D.Po"; else rm -f ".deps/mfengine-MFVector2D.Tpo"; exit 1; fi *In file included from /home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:1: */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:12: error: '__int64' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:14: error: Fehler beim Parsen before `,' token */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:18: error: 'DWORD' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:19: error: 'DWORD' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:22: error: 'DWORD' is used as a type, but is not defined as a type. */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp: In constructor ` *MFTimer::MFTimer()': */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: `LARGE_INTEGER' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: (Each undeclared identifier is reported only once for each *if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFVector3D.o -MD -MP -MF ".deps/mfengine-MFVector3D.Tpo" -c -o mfengine-MFVector3D.o `test -f 'MFVector3D.cpp' || echo '/home/mcnugget/src/MF-Engine/mfengine/src/'`MFVector3D.cpp; then mv -f ".deps/mfengine-MFVector3D.Tpo" ".deps/mfengine-MFVector3D.Po"; else rm -f ".deps/mfengine-MFVector3D.Tpo"; exit 1; fi *function it appears *in.) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: Fehler beim Parsen before `)' token */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: `pf' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: ` QueryPerformanceFrequency' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:7: error: `tickold' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp: In member function `void *MFTimer::_Val2Proc()': */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: Fehler beim Parsen before `)' token */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: `pc2' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: ` QueryPerformanceCounter' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:19: error: `pc1' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:20: error: Fehler beim Parsen before `)' token */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp: In member function `int *MFTimer::_GetFps()': */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:27: error: `tick' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:28: error: `tickdiff' undeclared (first use this function) *make: *** [mfengine-MFTimer.o] Fehler 1 */home/mcnugget/src/MF-Engine/mfengine/src/MFVector2D.cpp: In member function ` *double MFVector2D::Angle(MFVector2D)': */home/mcnugget/src/MF-Engine/mfengine/src/MFVector2D.cpp:117: error: `_isnan' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFVector2D.cpp:117: error: (Each undeclared identifier is reported only once for each function it appears in.) *make: *** [mfengine-MFVector2D.o] Fehler 1 */home/mcnugget/src/MF-Engine/mfengine/src/MFVector3D.cpp: In member function ` *double MFVector3D::Angle(MFVector3D)': */home/mcnugget/src/MF-Engine/mfengine/src/MFVector3D.cpp:185: error: `_isnan' undeclared (first use this function) */home/mcnugget/src/MF-Engine/mfengine/src/MFVector3D.cpp:185: error: (Each undeclared identifier is reported only once for each function it appears in.) *make: *** [mfengine-MFVector3D.o] Fehler 1 *make: Das Target »all« wurde wegen Fehlern nicht aktualisiert. **** Exited with status: 2 ***
With best regards DarkKiller [edited by - DarkKiller on March 6, 2004 2:14:46 PM]

Share this post


Link to post
Share on other sites
Advertisement
I'm very sorry about the style of my post!

Tell me what tag I need

like
 and   
(I don't think that the forum will show my examples...) to clean it up!

Sorry!




ok, I found it! 'quote' was good enough

[edited by - DarkKiller on March 6, 2004 2:15:41 PM]

Share this post


Link to post
Share on other sites
You have to rewrite your code so that it doesn''t use windows.h. There is no such alternative on *nix systems.

Stuff like DWORD and the BITMAP stuff is easy: just copy the defines from windows.h, or, better, get rid of it altogether.

Anything that starts with an underscore (like _stricmp) is MSVCRT-specific, but should have a glibc equivalent (strcasecmp in this case, I think).

QueryPerformanceCounter I''m not entirely sure how to get rid of, but I''m pretty sure SDL has it''s own timer library, although it''s precision isn''t very good. There was topic in this forum on Unix timers not long ago.

Share this post


Link to post
Share on other sites
You could perhaps use Winelib if you have to.

Since you''re using SDL, why don''t you use the facitities it provides?

You have SDL_GetTicks and SDL_LoadBMP, for example.

And I''m sure _stricmp could be replaced with something in the standard C library.

DWORD and such can easily be typedefed.

Share this post


Link to post
Share on other sites
"*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: Fehler beim Parsen before `)'' token "

German compiler?

Share this post


Link to post
Share on other sites
Thankx for this ''super-fast'' answer!

Well, I searched the SDL-Manual... I''ll that do again, but I think the only thing a found was an equivalent to GetTickCount(). This works well!

But thank you for the other things you said like ''strcasecmp'' I''ll try that!

I''ll drop a line here when its working!

regards

DarkKiller

Share this post


Link to post
Share on other sites
Your code is full with windows specific code.

Some solutions :

- DWORD is probably a typedef for unsigned long, so dump that in a header file or just replace it with unsigned long

- QueryPerformanceTimer can be replaced by gettimeofday (linux specific) or even better with SDL_GetTicks(), which is cross platform.

- The whole BITMAP stuff : use SDL''s bitmap loading functionality (SDL_LoadBMP)

- _stricmp : there''s strcasecmp which ignores the case and compares two strings (not exactly the same, but you can allways write it yourself).

- _isnan : why use something WIN32 specific when there is isnan in the standard C library ?

In general avoid functions in Windows which start with an underscore, they are not cross platform.


Share this post


Link to post
Share on other sites
Ho Bulma !

My German compiler speaks Germish (or Denglish)

@Robinei: I use PNG for the Textures. The file is much smaller and I can use things like transparency with the alpha-value (0-255) included within this file definition!

Winelib seems to be interesting! The SDL_GetTicks() is allready in use!

QueryPerformanceCounter() is used to get the time one single frame needs to be rendered! The SDL_GetTicks() and GetTickCount() is not able to give such a precision! So its absolutly necessary have somthing like that! It returns the time in micro seconds!

Share this post


Link to post
Share on other sites
ok, many things can compile correct now!

Great help after such a short time!!

But I''m still searching for


__int64
and LARGE_INTEGER

And I''m still searching for the defs for the BitMap..

Share this post


Link to post
Share on other sites
It looks like this now:

quote:

cd "/home/mcnugget/src/MF-Engine/mfengine/debug/src" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-ciSDL.o -MD -MP -MF ".deps/mfengine-ciSDL.Tpo" -c -o mfengine-ciSDL.o `test -f ''ciSDL.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`ciSDL.cpp; then mv -f ".deps/mfengine-ciSDL.Tpo" ".deps/mfengine-ciSDL.Po"; else rm -f ".deps/mfengine-ciSDL.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-enginetest.o -MD -MP -MF ".deps/mfengine-enginetest.Tpo" -c -o mfengine-enginetest.o `test -f ''enginetest.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`enginetest.cpp; then mv -f ".deps/mfengine-enginetest.Tpo" ".deps/mfengine-enginetest.Po"; else rm -f ".deps/mfengine-enginetest.Tpo"; exit 1; fi
*In file included from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.h:5,
*from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:1:
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:9: error: '' BITMAPFILEHEADER'' is used as a type, but is not defined as a type.
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:10: error: '' BITMAPINFOHEADER'' is used as a type, but is not defined as a type.
*In file included from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.h:9,
*from /home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:1:
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:12: error: ''__int64'' is used as a type, but is not defined as a type.
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:14: error: Fehler beim Parsen before `,'' token
*make: *** [mfengine-enginetest.o] Fehler 1
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-globals.o -MD -MP -MF ".deps/mfengine-globals.Tpo" -c -o mfengine-globals.o `test -f ''globals.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`globals.cpp; then mv -f ".deps/mfengine-globals.Tpo" ".deps/mfengine-globals.Po"; else rm -f ".deps/mfengine-globals.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFColor.o -MD -MP -MF ".deps/mfengine-MFColor.Tpo" -c -o mfengine-MFColor.o `test -f ''MFColor.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFColor.cpp; then mv -f ".deps/mfengine-MFColor.Tpo" ".deps/mfengine-MFColor.Po"; else rm -f ".deps/mfengine-MFColor.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFEngine.o -MD -MP -MF ".deps/mfengine-MFEngine.Tpo" -c -o mfengine-MFEngine.o `test -f ''MFEngine.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFEngine.cpp; then mv -f ".deps/mfengine-MFEngine.Tpo" ".deps/mfengine-MFEngine.Po"; else rm -f ".deps/mfengine-MFEngine.Tpo"; exit 1; fi
*In file included from /home/mcnugget/src/MF-Engine/mfengine/src/MFEngine.cpp:3:
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:9: error: '' BITMAPFILEHEADER'' is used as a type, but is not defined as a type.
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:10: error: '' BITMAPINFOHEADER'' is used as a type, but is not defined as a type.
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFInput.o -MD -MP -MF ".deps/mfengine-MFInput.Tpo" -c -o mfengine-MFInput.o `test -f ''MFInput.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFInput.cpp; then mv -f ".deps/mfengine-MFInput.Tpo" ".deps/mfengine-MFInput.Po"; else rm -f ".deps/mfengine-MFInput.Tpo"; exit 1; fi
*make: *** [mfengine-MFEngine.o] Fehler 1
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFMatrix.o -MD -MP -MF ".deps/mfengine-MFMatrix.Tpo" -c -o mfengine-MFMatrix.o `test -f ''MFMatrix.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFMatrix.cpp; then mv -f ".deps/mfengine-MFMatrix.Tpo" ".deps/mfengine-MFMatrix.Po"; else rm -f ".deps/mfengine-MFMatrix.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFPoint2D.o -MD -MP -MF ".deps/mfengine-MFPoint2D.Tpo" -c -o mfengine-MFPoint2D.o `test -f ''MFPoint2D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFPoint2D.cpp; then mv -f ".deps/mfengine-MFPoint2D.Tpo" ".deps/mfengine-MFPoint2D.Po"; else rm -f ".deps/mfengine-MFPoint2D.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFPoint3D.o -MD -MP -MF ".deps/mfengine-MFPoint3D.Tpo" -c -o mfengine-MFPoint3D.o `test -f ''MFPoint3D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFPoint3D.cpp; then mv -f ".deps/mfengine-MFPoint3D.Tpo" ".deps/mfengine-MFPoint3D.Po"; else rm -f ".deps/mfengine-MFPoint3D.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFQuaternion.o -MD -MP -MF ".deps/mfengine-MFQuaternion.Tpo" -c -o mfengine-MFQuaternion.o `test -f ''MFQuaternion.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFQuaternion.cpp; then mv -f ".deps/mfengine-MFQuaternion.Tpo" ".deps/mfengine-MFQuaternion.Po"; else rm -f ".deps/mfengine-MFQuaternion.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFRotation.o -MD -MP -MF ".deps/mfengine-MFRotation.Tpo" -c -o mfengine-MFRotation.o `test -f ''MFRotation.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFRotation.cpp; then mv -f ".deps/mfengine-MFRotation.Tpo" ".deps/mfengine-MFRotation.Po"; else rm -f ".deps/mfengine-MFRotation.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFText.o -MD -MP -MF ".deps/mfengine-MFText.Tpo" -c -o mfengine-MFText.o `test -f ''MFText.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFText.cpp; then mv -f ".deps/mfengine-MFText.Tpo" ".deps/mfengine-MFText.Po"; else rm -f ".deps/mfengine-MFText.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFTexture.o -MD -MP -MF ".deps/mfengine-MFTexture.Tpo" -c -o mfengine-MFTexture.o `test -f ''MFTexture.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFTexture.cpp; then mv -f ".deps/mfengine-MFTexture.Tpo" ".deps/mfengine-MFTexture.Po"; else rm -f ".deps/mfengine-MFTexture.Tpo"; exit 1; fi
*In file included from /home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:1:
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:9: error: '' BITMAPFILEHEADER'' is used as a type, but is not defined as a type.
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.h:10: error: '' BITMAPINFOHEADER'' is used as a type, but is not defined as a type.
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp: In member function `
*uint MFTexture::LoadBMP(const char*)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:162: error: ''struct BITMAP_IMAGE'' has no member named ''bmfHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:165: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:168: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:170: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:171: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:171: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:173: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:186: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTexture.cpp:186: error: ''struct BITMAP_IMAGE'' has no member named ''bmiHeader''
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFTimer.o -MD -MP -MF ".deps/mfengine-MFTimer.Tpo" -c -o mfengine-MFTimer.o `test -f ''MFTimer.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFTimer.cpp; then mv -f ".deps/mfengine-MFTimer.Tpo" ".deps/mfengine-MFTimer.Po"; else rm -f ".deps/mfengine-MFTimer.Tpo"; exit 1; fi
*make: *** [mfengine-MFTexture.o] Fehler 1
*In file included from /home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:1:
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:12: error: ''__int64'' is used as a type, but is not defined as a type.
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.h:14: error: Fehler beim Parsen before `,'' token
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp: In constructor `
*MFTimer::MFTimer()'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: `LARGE_INTEGER'' undeclared (first use this function)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: Fehler beim Parsen before `)'' token
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: `pf'' undeclared (first use this function)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:5: error: ` QueryPerformanceFrequency'' undeclared (first use this functi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFVector2D.o -MD -MP -MF ".deps/mfengine-MFVector2D.Tpo" -c -o mfengine-MFVector2D.o `test -f ''MFVector2D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFVector2D.cpp; then mv -f ".deps/mfengine-MFVector2D.Tpo" ".deps/mfengine-MFVector2D.Po"; else rm -f ".deps/mfengine-MFVector2D.Tpo"; exit 1; fi
*on)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp: In member function `void
*MFTimer::_Val2Proc()'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: Fehler beim Parsen before `)'' token
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: `pc2'' undeclared (first use this function)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:18: error: ` QueryPerformanceCounter'' undeclared (first use this function)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:19: error: `pc1'' undeclared (first use this function)
*/home/mcnugget/src/MF-Engine/mfengine/src/MFTimer.cpp:20: error: Fehler beim Parsen before `)'' token
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -O0 -g3 -MT mfengine-MFVector3D.o -MD -MP -MF ".deps/mfengine-MFVector3D.Tpo" -c -o mfengine-MFVector3D.o `test -f ''MFVector3D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFVector3D.cpp; then mv -f ".deps/mfengine-MFVector3D.Tpo" ".deps/mfengine-MFVector3D.Po"; else rm -f ".deps/mfengine-MFVector3D.Tpo"; exit 1; fi
*make: *** [mfengine-MFTimer.o] Fehler 1
*make: Das Target »all« wurde wegen Fehlern nicht aktualisiert.
**** Exited with status: 2 ***

Share this post


Link to post
Share on other sites
int64 on most 32 bit architectures is a long long

I've got the following in my universal header:

// Fixed-Width Integer Types
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed long int32_t;
typedef unsigned long uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;

// Fixed-Width Float Types
typedef float float32_t;
typedef double float64_t;
typedef long double float128_t;


I think that <stddef.h> does some of these, but I don't think it's ISO...

[edited by - me22 on March 6, 2004 2:50:57 PM]

[edited by - me22 on March 6, 2004 2:51:34 PM]

Share this post


Link to post
Share on other sites
For ''isnan'', you can do it two ways. Either check whether the number is not equal to itself: as surprising as it sounds, NaN != NaN.
Alternatively you can test for the specific bit pattern: maximal exponent field, non-zero mantissa field (maximal exponent and zero mantissa represents infinity).


“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
— Brian W. Kernighan (C programming language co-inventor)

Share this post


Link to post
Share on other sites
ok, thats good to know!

I found the same function: ''isnan'' within the standard c++ includes! I think its implemented in math.h. This should work on both systems. If not I''ll write a little macro.


How can I inplement the typecast: LARGE_INTEGER for

QueryPerformanceCounter((LARGE_INTEGER*)&pc2);

Share this post


Link to post
Share on other sites
@George2: Hey, youre right! I found GetTimeOfDay() as an equivalent for my QueryPerformanceCounter()! Thankx a lott for this information!

Share this post


Link to post
Share on other sites
which lib do I have to include within the project options (like libSDL) to use the OpenGL functions like... whatever you can think of....

??

Which package do I need?

Share this post


Link to post
Share on other sites
About my System:

I have a Debian running with a 2.4.22 Kernel and a NVidia GeForge2 TI with nvidia-driver correctly installed, openGL is running.

But I cannot compile the Engine because I don''t have the libGL (or however it is called - cannot find any information via google).
It also seems like that I don''t have the freetype libs.

Here is the compilerlisting:



quote:


cd "/home/mcnugget/src/MF-Engine/mfengine/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k
*make all-recursive
*Making all in src
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-ciSDL.o -MD -MP -MF ".deps/mfengine-ciSDL.Tpo" -c -o mfengine-ciSDL.o `test -f ''ciSDL.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`ciSDL.cpp; then mv -f ".deps/mfengine-ciSDL.Tpo" ".deps/mfengine-ciSDL.Po"; else rm -f ".deps/mfengine-ciSDL.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-enginetest.o -MD -MP -MF ".deps/mfengine-enginetest.Tpo" -c -o mfengine-enginetest.o `test -f ''enginetest.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`enginetest.cpp; then mv -f ".deps/mfengine-enginetest.Tpo" ".deps/mfengine-enginetest.Po"; else rm -f ".deps/mfengine-enginetest.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-globals.o -MD -MP -MF ".deps/mfengine-globals.Tpo" -c -o mfengine-globals.o `test -f ''globals.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`globals.cpp; then mv -f ".deps/mfengine-globals.Tpo" ".deps/mfengine-globals.Po"; else rm -f ".deps/mfengine-globals.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFColor.o -MD -MP -MF ".deps/mfengine-MFColor.Tpo" -c -o mfengine-MFColor.o `test -f ''MFColor.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFColor.cpp; then mv -f ".deps/mfengine-MFColor.Tpo" ".deps/mfengine-MFColor.Po"; else rm -f ".deps/mfengine-MFColor.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFEngine.o -MD -MP -MF ".deps/mfengine-MFEngine.Tpo" -c -o mfengine-MFEngine.o `test -f ''MFEngine.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFEngine.cpp; then mv -f ".deps/mfengine-MFEngine.Tpo" ".deps/mfengine-MFEngine.Po"; else rm -f ".deps/mfengine-MFEngine.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFInput.o -MD -MP -MF ".deps/mfengine-MFInput.Tpo" -c -o mfengine-MFInput.o `test -f ''MFInput.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFInput.cpp; then mv -f ".deps/mfengine-MFInput.Tpo" ".deps/mfengine-MFInput.Po"; else rm -f ".deps/mfengine-MFInput.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFMatrix.o -MD -MP -MF ".deps/mfengine-MFMatrix.Tpo" -c -o mfengine-MFMatrix.o `test -f ''MFMatrix.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFMatrix.cpp; then mv -f ".deps/mfengine-MFMatrix.Tpo" ".deps/mfengine-MFMatrix.Po"; else rm -f ".deps/mfengine-MFMatrix.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFPoint2D.o -MD -MP -MF ".deps/mfengine-MFPoint2D.Tpo" -c -o mfengine-MFPoint2D.o `test -f ''MFPoint2D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFPoint2D.cpp; then mv -f ".deps/mfengine-MFPoint2D.Tpo" ".deps/mfengine-MFPoint2D.Po"; else rm -f ".deps/mfengine-MFPoint2D.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFPoint3D.o -MD -MP -MF ".deps/mfengine-MFPoint3D.Tpo" -c -o mfengine-MFPoint3D.o `test -f ''MFPoint3D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFPoint3D.cpp; then mv -f ".deps/mfengine-MFPoint3D.Tpo" ".deps/mfengine-MFPoint3D.Po"; else rm -f ".deps/mfengine-MFPoint3D.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFQuaternion.o -MD -MP -MF ".deps/mfengine-MFQuaternion.Tpo" -c -o mfengine-MFQuaternion.o `test -f ''MFQuaternion.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFQuaternion.cpp; then mv -f ".deps/mfengine-MFQuaternion.Tpo" ".deps/mfengine-MFQuaternion.Po"; else rm -f ".deps/mfengine-MFQuaternion.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFRotation.o -MD -MP -MF ".deps/mfengine-MFRotation.Tpo" -c -o mfengine-MFRotation.o `test -f ''MFRotation.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFRotation.cpp; then mv -f ".deps/mfengine-MFRotation.Tpo" ".deps/mfengine-MFRotation.Po"; else rm -f ".deps/mfengine-MFRotation.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFText.o -MD -MP -MF ".deps/mfengine-MFText.Tpo" -c -o mfengine-MFText.o `test -f ''MFText.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFText.cpp; then mv -f ".deps/mfengine-MFText.Tpo" ".deps/mfengine-MFText.Po"; else rm -f ".deps/mfengine-MFText.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFTimer.o -MD -MP -MF ".deps/mfengine-MFTimer.Tpo" -c -o mfengine-MFTimer.o `test -f ''MFTimer.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFTimer.cpp; then mv -f ".deps/mfengine-MFTimer.Tpo" ".deps/mfengine-MFTimer.Po"; else rm -f ".deps/mfengine-MFTimer.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFVector2D.o -MD -MP -MF ".deps/mfengine-MFVector2D.Tpo" -c -o mfengine-MFVector2D.o `test -f ''MFVector2D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFVector2D.cpp; then mv -f ".deps/mfengine-MFVector2D.Tpo" ".deps/mfengine-MFVector2D.Po"; else rm -f ".deps/mfengine-MFVector2D.Tpo"; exit 1; fi
*if g++ -DHAVE_CONFIG_H -I. -I/home/mcnugget/src/MF-Engine/mfengine/src -I.. -I/usr/include/SDL -D_REENTRANT -O0 -g3 -MT mfengine-MFVector3D.o -MD -MP -MF ".deps/mfengine-MFVector3D.Tpo" -c -o mfengine-MFVector3D.o `test -f ''MFVector3D.cpp'' || echo ''/home/mcnugget/src/MF-Engine/mfengine/src/''`MFVector3D.cpp; then mv -f ".deps/mfengine-MFVector3D.Tpo" ".deps/mfengine-MFVector3D.Po"; else rm -f ".deps/mfengine-MFVector3D.Tpo"; exit 1; fi
*/bin/sh ../libtool --mode=link g++ -O0 -g3 -o mfengine mfengine-ciSDL.o mfengine-enginetest.o mfengine-globals.o mfengine-MFColor.o mfengine-MFEngine.o mfengine-MFInput.o mfengine-MFMatrix.o mfengine-MFPoint2D.o mfengine-MFPoint3D.o mfengine-MFQuaternion.o mfengine-MFRotation.o mfengine-MFText.o mfengine-MFTimer.o mfengine-MFVector2D.o mfengine-MFVector3D.o -lSDL -lpthread
*mkdir .libs
*g++ -O0 -g3 -o mfengine mfengine-ciSDL.o mfengine-enginetest.o mfengine-globals.o mfengine-MFColor.o mfengine-MFEngine.o mfengine-MFInput.o mfengine-MFMatrix.o mfengine-MFPoint2D.o mfengine-MFPoint3D.o mfengine-MFQuaternion.o mfengine-MFRotation.o mfengine-MFText.o mfengine-MFTimer.o mfengine-MFVector2D.o mfengine-MFVector3D.o /usr/lib/libSDL.so -lm -ldl -L/usr/X11R6/lib -lX11 -lXext -lpthread
*mfengine-enginetest.o(.text+0x1bc): In function `SetupOpenGL(int, int)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:22: undefined reference to `glShadeModel''
*mfengine-enginetest.o(.text+0x1d0):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:23: undefined reference to `glPolygonMode''
*mfengine-enginetest.o(.text+0x1dc):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:26: undefined reference to `glEnable''
*mfengine-enginetest.o(.text+0x1e8):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:27: undefined reference to `glEnable''
*mfengine-enginetest.o(.text+0x1f4):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:28: undefined reference to `glDepthFunc''
*mfengine-enginetest.o(.text+0x208):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:29: undefined reference to `glBlendFunc''
*mfengine-enginetest.o(.text+0x21c):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:30: undefined reference to `glHint''
*mfengine-enginetest.o(.text+0x244):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:31: undefined reference to `glClearColor''
*mfengine-enginetest.o(.text+0x24e):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:32: undefined reference to `glClearDepth''
*mfengine-enginetest.o(.text+0x270):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:34: undefined reference to `glViewport''
*mfengine-enginetest.o(.text+0x27c):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:35: undefined reference to `glMatrixMode''
*mfengine-enginetest.o(.text+0x281):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:36: undefined reference to `glLoadIdentity''
*mfengine-enginetest.o(.text+0x2af):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:38: undefined reference to `gluPerspective''
*mfengine-enginetest.o(.text+0x2bb):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:40: undefined reference to `glMatrixMode''
*mfengine-enginetest.o(.text+0x2c0):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:41: undefined reference to `glLoadIdentity''
*mfengine-enginetest.o(.text+0x2fe): In function `DrawScene()'':
*/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:49: undefined reference to `glClear''
*mfengine-enginetest.o(.text+0x303):/home/mcnugget/src/MF-Engine/mfengine/src/enginetest.cpp:50: undefined reference to `glLoadIdentity''
*mfengine-MFText.o(.text+0x2cb): In function `MFText::_FontData::MakeDList(FT_FaceRec_*, unsigned char, unsigned, unsigned*)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:56: undefined reference to `FT_Get_Char_Index''
*mfengine-MFText.o(.text+0x2e2): In function `MFText::_FontData::MakeDList(FT_FaceRec_*, unsigned char, unsigned, unsigned*)'':
*/usr/include/c++/3.3/bits/vector.tcc:257: undefined reference to `FT_Load_Glyph''
*mfengine-MFText.o(.text+0x313): In function `MFText::_FontData::MakeDList(FT_FaceRec_*, unsigned char, unsigned, unsigned*)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:63: undefined reference to `FT_Get_Glyph''
*mfengine-MFText.o(.text+0x352):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:69: undefined reference to `FT_Glyph_To_Bitmap''
*mfengine-MFText.o(.text+0x475):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:98: undefined reference to `glBindTexture''
*mfengine-MFText.o(.text+0x491):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:99: undefined reference to `glTexParameteri''
*mfengine-MFText.o(.text+0x4ad):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:100: undefined reference to `glTexParameteri''
*mfengine-MFText.o(.text+0x4f6):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:105: undefined reference to `glTexImage2D''
*mfengine-MFText.o(.text+0x51e):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:111: undefined reference to `glNewList''
*mfengine-MFText.o(.text+0x53f):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:112: undefined reference to `glBindTexture''
*mfengine-MFText.o(.text+0x55f):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:117: undefined reference to `glTranslatef''
*mfengine-MFText.o(.text+0x564):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:122: undefined reference to `glPushMatrix''
*mfengine-MFText.o(.text+0x593):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:123: undefined reference to `glTranslatef''
*mfengine-MFText.o(.text+0x5ba):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:140: undefined reference to `glBegin''
*mfengine-MFText.o(.text+0x5ca):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:141: undefined reference to `glTexCoord2d''
*mfengine-MFText.o(.text+0x5e0):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:141: undefined reference to `glVertex2f''
*mfengine-MFText.o(.text+0x5f1):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:142: undefined reference to `glTexCoord2d''
*mfengine-MFText.o(.text+0x607):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:142: undefined reference to `glVertex2f''
*mfengine-MFText.o(.text+0x619):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:143: undefined reference to `glTexCoord2d''
*mfengine-MFText.o(.text+0x630):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:143: undefined reference to `glVertex2f''
*mfengine-MFText.o(.text+0x641):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:144: undefined reference to `glTexCoord2d''
*mfengine-MFText.o(.text+0x658):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:144: undefined reference to `glVertex2f''
*mfengine-MFText.o(.text+0x65d):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:145: undefined reference to `glEnd''
*mfengine-MFText.o(.text+0x662):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:146: undefined reference to `glPopMatrix''
*mfengine-MFText.o(.text+0x690):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:147: undefined reference to `glTranslatef''
*mfengine-MFText.o(.text+0x695):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:154: undefined reference to `glEndList''
*mfengine-MFText.o(.text+0x6b4): In function `MFText::_FontData:ushScreenCoordinateMatrix()'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:161: undefined reference to `glPushAttrib''
*mfengine-MFText.o(.text+0x6c7):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:163: undefined reference to `glGetIntegerv''
*mfengine-MFText.o(.text+0x6d3):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:164: undefined reference to `glMatrixMode''
*mfengine-MFText.o(.text+0x6d8):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:165: undefined reference to `glPushMatrix''
*mfengine-MFText.o(.text+0x6dd):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:166: undefined reference to `glLoadIdentity''
*mfengine-MFText.o(.text+0x6fd):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:167: undefined reference to `gluOrtho2D''
*mfengine-MFText.o(.text+0x702):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:168: undefined reference to `glPopAttrib''
*mfengine-MFText.o(.text+0x716): In function `MFText::_FontData:opProjectionMatrix()'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:173: undefined reference to `glPushAttrib''
*mfengine-MFText.o(.text+0x722):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:174: undefined reference to `glMatrixMode''
*mfengine-MFText.o(.text+0x727):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:175: undefined reference to `glPopMatrix''
*mfengine-MFText.o(.text+0x72c):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:176: undefined reference to `glPopAttrib''
*mfengine-MFText.o(.text+0x753): In function `MFText::_FontData::Clean()'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:182: undefined reference to `glDeleteLists''
*mfengine-MFText.o(.text+0x772):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:185: undefined reference to `glDeleteTextures''
*mfengine-MFText.o(.text+0x93a): In function `MFText::LoadFont(char const*, unsigned, char const*)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:217: undefined reference to `FT_Init_FreeType''
*mfengine-MFText.o(.text+0x982):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:229: undefined reference to `FT_New_Face''
*mfengine-MFText.o(.text+0x9d8):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:235: undefined reference to `FT_Set_Char_Size''
*mfengine-MFText.o(.text+0x9e4):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:237: undefined reference to `glGenLists''
*mfengine-MFText.o(.text+0x9fa):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:238: undefined reference to `glGenTextures''
*mfengine-MFText.o(.text+0xa5f):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:249: undefined reference to `FT_Done_Face''
*mfengine-MFText.o(.text+0xa6a):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:252: undefined reference to `FT_Done_FreeType''
*mfengine-MFText.o(.text+0xe08): In function `MFText:rint(char const*, float, float, char const*, ...)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:325: undefined reference to `glPushAttrib''
*mfengine-MFText.o(.text+0xe14):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:326: undefined reference to `glMatrixMode''
*mfengine-MFText.o(.text+0xe20):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:327: undefined reference to `glDisable''
*mfengine-MFText.o(.text+0xe2c):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:328: undefined reference to `glEnable''
*mfengine-MFText.o(.text+0xe38):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:329: undefined reference to `glDisable''
*mfengine-MFText.o(.text+0xe44):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:330: undefined reference to `glEnable''
*mfengine-MFText.o(.text+0xe58):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:331: undefined reference to `glBlendFunc''
*mfengine-MFText.o(.text+0xe63):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:333: undefined reference to `glListBase''
*mfengine-MFText.o(.text+0xe79):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:336: undefined reference to `glGetFloatv''
*mfengine-MFText.o(.text+0xe9a):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:348: undefined reference to `glPushMatrix''
*mfengine-MFText.o(.text+0xe9f):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:349: undefined reference to `glLoadIdentity''
*mfengine-MFText.o(.text+0xed0):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:350: undefined reference to `glTranslatef''
*mfengine-MFText.o(.text+0xede):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:351: undefined reference to `glMultMatrixf''
*mfengine-MFText.o(.text+0xf32):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:359: undefined reference to `glCallLists''
*mfengine-MFText.o(.text+0xf37):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:366: undefined reference to `glPopMatrix''
*mfengine-MFText.o(.text+0xf46):/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:369: undefined reference to `glPopAttrib''
*mfengine-MFText.o(.text+0x1015): In function `MFText:rint(char const*, float, float, float, float, float, char const*, ...)'':
*/home/mcnugget/src/MF-Engine/mfengine/src/MFText.cpp:388: undefined reference to `glColor3f''
*collect2: ld returned 1 exit status
*make[2]: Für das Ziel »all-am« ist nichts zu tun.
*make[2]: *** [mfengine] Fehler 1
*make[2]: Das Target »all« wurde wegen Fehlern nicht aktualisiert.
*make[1]: *** [all-recursive] Fehler 1
*make: *** [all] Fehler 2
**** Exited with status: 2 ***




Thankx for your great help!

Share this post


Link to post
Share on other sites
you have to add: -lGL

you MAY also need a special include path to find that library, try it without first.

Share this post


Link to post
Share on other sites
Check out SDL_image which can load all kinds of image files including png.

http://www.libsdl.org/projects/SDL_image/

Edit: Under Linux the GL package is called Mesa. The include files and lib files are still called *GL* but you'll have to search for Mesa to download it if you haven't got it already.

[edited by - robinei on March 6, 2004 10:35:45 PM]

Share this post


Link to post
Share on other sites
This is a part of my /usr/lib/ directory:



McNugget:/usr/lib# ls -la libGL*
lrwxrwxrwx 1 root root 20 2004-02-07 22:19 libGL.a -> ../X11R6/lib/libGL.a
lrwxrwxrwx 1 root root 21 2004-02-25 20:18 libGLcore.so.1 -> libGLcore.so.1.0.5336
-rw-r--r-- 1 root root 4882612 2004-02-22 01:01 libGLcore.so.1.0.5336
-rw-r--r-- 1 root root 660 2004-02-22 01:01 libGL.la
lrwxrwxrwx 1 root root 12 2004-02-07 22:19 libGL.so -> libGL.so.1.2
lrwxrwxrwx 1 root root 17 2004-02-25 20:18 libGL.so.1 -> libGL.so.1.0.5336
-rw-r--r-- 1 root root 364224 2004-02-22 01:01 libGL.so.1.0.5336
lrwxrwxrwx 1 root root 21 2004-02-07 22:19 libGLU.a -> ../X11R6/lib/libGLU.a
lrwxrwxrwx 1 root root 13 2004-02-07 22:19 libGLU.so -> libGLU.so.1.3
lrwxrwxrwx 1 root root 13 2004-02-07 22:19 libGLU.so.1 -> libGLU.so.1.3
lrwxrwxrwx 1 root root 26 2004-02-07 22:19 libGLU.so.1.3 -> ../X11R6/lib/libGLU.so.1.3
McNugget:/usr/lib# ls -la libfree*
-rw-r--r-- 1 root root 526204 2004-01-24 01:02 libfreetype.a
-rw-r--r-- 1 root root 809 2004-01-24 01:02 libfreetype.la
lrwxrwxrwx 1 root root 20 2004-01-25 23:55 libfreetype.so -> libfreetype.so.6.3.5
lrwxrwxrwx 1 root root 20 2004-01-25 23:55 libfreetype.so.6 -> libfreetype.so.6.3.5
-rw-r--r-- 1 root root 447212 2004-01-24 01:02 libfreetype.so.6.3.5
McNugget:/usr/lib# ls -la libSD*
lrwxrwxrwx 1 root root 19 2004-02-25 20:18 libSDL-1.2.so.0 -> libSDL-1.2.so.0.7.0
-rw-r--r-- 1 root root 409872 2004-02-23 04:40 libSDL-1.2.so.0.7.0
-rw-r--r-- 1 root root 585626 2004-02-23 04:40 libSDL.a
-rw-r--r-- 1 root root 835 2004-02-23 04:40 libSDL.la
-rw-r--r-- 1 root root 622 2004-02-23 04:40 libSDLmain.a
lrwxrwxrwx 1 root root 19 2004-03-06 19:15 libSDL.so -> libSDL-1.2.so.0.7.0


Here is the compiler message:


*cd "/home/mcnugget/src/MF-Engine/mfengine/optimized/src" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k mfengine
*cd /home/mcnugget/src/MF-Engine/mfengine && /bin/sh /home/mcnugget/src/MF-Engine/mfengine/missing --run automake-1.7 --gnu src/Makefile
*cd .. && /bin/sh ./config.status src/Makefile depfiles
*config.status: creating src/Makefile
*config.status: executing depfiles commands
*/bin/sh ../libtool --mode=link g++ -O2 -g0 -o mfengine mfengine-ciSDL.o mfengine-enginetest.o mfengine-globals.o mfengine-MFColor.o mfengine-MFEngine.o mfengine-MFInput.o mfengine-MFMatrix.o mfengine-MFPoint2D.o mfengine-MFPoint3D.o mfengine-MFQuaternion.o mfengine-MFRotation.o mfengine-MFText.o mfengine-MFTimer.o mfengine-MFVector2D.o mfengine-MFVector3D.o -lGL -lGLU -lfreetype -lSDL -lpthread
*g++ -O2 -g0 -o mfengine mfengine-ciSDL.o mfengine-enginetest.o mfengine-globals.o mfengine-MFColor.o mfengine-MFEngine.o mfengine-MFInput.o mfengine-MFMatrix.o mfengine-MFPoint2D.o mfengine-MFPoint3D.o mfengine-MFQuaternion.o mfengine-MFRotation.o mfengine-MFText.o mfengine-MFTimer.o mfengine-MFVector2D.o mfengine-MFVector3D.o /usr/lib/libGL.so -L/usr/X11R6/lib -lGLU /usr/lib/libfreetype.so -lz /usr/lib/libSDL.so -lm -ldl -lX11 -lXext -lpthread
*g++: /usr/lib/libGL.so: No such file or directory
*make: *** [mfengine] Fehler 1
**** Exited with status: 2 ***



I don't understand why the following message appears!!
"g++: /usr/lib/libGL.so: No such file or directory"

Is it because g++ has no permission to access the file? Can't be!

[edited by - DarkKiller on March 7, 2004 7:10:50 AM]

Share this post


Link to post
Share on other sites
Ok, here we go! I found the problem!

libGL.so.1.2 does not exist! I linked it to libGL.so.1

It compiles correct now! The enginge starts, I can see the window and the main loop runs!

But now, I have some problems with this message when I try to get the freetypeengine to work.

All I do is to copy the font-directory into the folder where the binary lies.

Now the font file can be found but the engine closes right after the window appears and the following line appears:

Fatal signal: Segmentation Fault (SDL Parachute Deployed)

Share this post


Link to post
Share on other sites
This is a problem with my DrawScene() function...

So its no lib problem or something like that!


Thank you very much for your support!

Share this post


Link to post
Share on other sites
Compile with -g and run gdb on the executable

Share this post


Link to post
Share on other sites
Ok, i used the debugger to get this information:


gdb /home/mcnugget/src/MF-Engine/mfengine/optimized/src/mfengine -fullname -nx -quiet
(gdb) set edit off
(gdb) (gdb)
(gdb) set confirm off
(gdb) set print static-members off
(gdb) tty /dev/pts/1
(gdb) set width 0
(gdb) set height 0
(gdb) set stop-on 1
(gdb) handle SIG32 pass nostop noprint
(gdb) handle SIG43 pass nostop noprint
(gdb) set print asm-demangle on
(gdb) cd /home/mcnugget/src/MF-Engine/mfengine/optimized/src
(gdb) run
[New Thread 16384 (LWP 16773)]
Stopped due to shared library event
(gdb) continue
[Switching to Thread 16384 (LWP 16773)]
Stopped due to shared library event
(gdb) continue
Stopped due to shared library event
(gdb) continue
Stopped due to shared library event
(gdb) continue
Stopped due to shared library event
(gdb) continue
Stopped due to shared library event
(gdb) continue
Stopped due to shared library event
(gdb) continue
[New Thread 32769 (LWP 16775)]
[New Thread 16386 (LWP 16776)]

Program received signal SIGSEGV, Segmentation fault.
0x0804f6eb in MFText::Print(char const*, float, float, char const*, ...) ()
(gdb) info thread
3 Thread 16386 (LWP 16776) 0x4050ae21 in gettimeofday () from /lib/libc.so.6
2 Thread 32769 (LWP 16775) 0x4054781a in poll () from /lib/libc.so.6
* 1 Thread 16384 (LWP 16773) 0x0804f6eb in MFText::Print(char const*, float, float, char const*, ...) ()
(gdb) backtrace
#0 0x0804f6eb in MFText::Print(char const*, float, float, char const*, ...) ()
#1 0x0804a396 in DrawScene() ()
#2 0x0804a4f1 in main ()
(gdb) print GLuint font = fonts->list_base;
(gdb) print float h = fonts->h / .63f;
No symbol "GLuint" in current context.
A parse error in expression, near `h = fonts->h / .63f;'.
(gdb) frame 0
#0 0x0804f6eb in MFText::Print(char const*, float, float, char const*, ...) ()


The beginning of the function looks like this:

   
printf("\ndb 1\n");
bool found = false;
for (fonts.Reset(); fonts.current; fonts++) {
if (strcasecmp(fonts->name, fontName) == 0) {
found = true;
}
}
printf("\ndb 2\n");
if (!found)
return FONT_NOT_FOUND;

//We want a coordinate system where things corespond to window pixels.

fonts->PushScreenCoordinateMatrix();
printf("\ndb 3\n");
GLuint font = fonts->list_base;
float h = fonts->h / .63f;


The last two lines must cause the fault with Linux. On Windows it runs perfectly!

Maybe you can help me with this one

With best regards,
DarkKiller

[edited by - DarkKiller on March 7, 2004 9:24:04 AM]

Share this post


Link to post
Share on other sites

  • Advertisement