Crystal Space
Welcome, Guest. Please login or register.
July 23, 2014, 09:09:27 pm

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8220 Members
Latest Member: Igymatta
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  More Compiling Worries - Codeblocks Query
« previous next »
Pages: [1] Print
Author Topic: More Compiling Worries - Codeblocks Query  (Read 1904 times)
Hannofcart
Newbie
*
Posts: 14


View Profile Email
« on: October 27, 2008, 08:47:26 am »

I have so far managed to compile Crystalspace (1.2) on Win XP using MinGW-MSYS. I am able to run walktest demo. Now, when I try compiling simple1 using the instructions as per the Codeblocks tutorial (which is out-of-date-I suspect, I had to make a few guesses of my own along the way regarding the search directories and linker settings) these are the errors that I get:
Code:
Compiling: C:\CS\apps\tutorial\simple1\simple1.cpp
In file included from C:/CS/include/csgeom/box.h:34,
                 from C:/CS/include/csgeom.h:25,
                 from C:/CS/include/crystalspace.h:27,
                 from C:\CS\apps\tutorial\simple1\simple1.h:22,
                 from C:\CS\apps\tutorial\simple1\simple1.cpp:19:
C:/CS/include/csgeom/math.h:140:2: #error Your platform has no isfinite()-alike function!
In file included from C:/CS/include/csgeom/box.h:34,
                 from C:/CS/include/csgeom.h:25,
                 from C:/CS/include/crystalspace.h:27,
                 from C:\CS\apps\tutorial\simple1\simple1.h:22,
                 from C:\CS\apps\tutorial\simple1\simple1.cpp:19:
C:/CS/include/csgeom/math.h: In function `bool csFinite(float)':
C:/CS/include/csgeom/math.h:142: warning: no return statement in function returning non-void
C:/CS/include/csgeom/math.h:155:2: #error Your platform has no isfinite()-alike function!
C:/CS/include/csgeom/math.h: In function `bool csFinite(double)':
C:/CS/include/csgeom/math.h:157: warning: no return statement in function returning non-void
C:/CS/include/csgeom/math.h:171:2: #error Your platform has no isnan()-alike function!
C:/CS/include/csgeom/math.h: In function `bool csNaN(float)':
C:/CS/include/csgeom/math.h:173: warning: no return statement in function returning non-void
C:/CS/include/csgeom/math.h:184:2: #error Your platform has no isnan()-alike function!
C:/CS/include/csgeom/math.h: In function `bool csNaN(double)':
C:/CS/include/csgeom/math.h:186: warning: no return statement in function returning non-void
Process terminated with status 1 (0 minutes, 4 seconds)
4 errors, 4 warnings
 

Could someone please steer me in the right direction here?
Logged
Hannofcart
Newbie
*
Posts: 14


View Profile Email
« Reply #1 on: October 27, 2008, 08:59:42 am »

I don't think these details are of significance in this case but following Jorrit's protocol

Version of CS:1.2.1
Version of winlibs package (if on windows): 1.2_002
Operating system : WinXP
Compiler: GCC(MinGW 3.4.5)
Video card: NVIDIA GeForce 7100 GS
Driver: 6.14.11.7519
Logged
res
Develazyoper
CS Developer
Full Member
*****
Posts: 206


View Profile Email
« Reply #2 on: October 27, 2008, 11:45:33 am »

This sounds a bit like the include for compiler configuration(csconfig.h) is wrong, or the wrong file is picked or so.

Could you please post the compiler flags etc. you used?

Also note: if you took the tutorial off the main crystalspace3d.org site - this site is a wiki, so you can edit/update things there Wink
Logged
Hannofcart
Newbie
*
Posts: 14


View Profile Email
« Reply #3 on: October 27, 2008, 02:15:32 pm »

Firstly...thank you, Res, for the speedy reply. In fact, you were spot on about csconfig header not being included correctly. It came about as a result of the 'guesses' that I told you I made which were in fact wrong (which is probably why you don't want a noob editing the wiki). By the way, I have not invoked any of the compiler flags.

This is what happened. I added to the search paths of the compiler the include directory of my CS source folder, which in fact has no csconfig.h file. As a result of which initially. the compiler was throwing up errors saying it could find no such file. Running a search I found that there is a csconfig.h in the folder csutil/win32 within the include folder (still within the original source dir). That left me with fewer errors, in particular, the errors related to math.h.

Now what I did to resolve the problem was to point the search paths to the msys/local/include/crystalspace-1.2 folder, which does in fact contain a csconfig.h header. Now everything works like a charm.

One thing though. As a mechanical engineer I have some experience in C++ programming but not the GCC environment and make tools. Now it seems to be that csconfig.h seems to be generated after compilation? It seems to have a list of preprocessor directives configured to my system's settings. I ask this just for the sake of clarity and would be grateful if you could clarify.

Thanks again for the quick fix.

« Last Edit: October 27, 2008, 02:28:54 pm by Hannofcart » Logged
res
Develazyoper
CS Developer
Full Member
*****
Posts: 206


View Profile Email
« Reply #4 on: October 27, 2008, 04:28:03 pm »

By the way, I have not invoked any of the compiler flags.
Still, might be a good idea to take a look.

I added to the search paths of the compiler the include directory of my CS source folder, which in fact has no csconfig.h file.
This is because csconfig.h is generated when CS is built (specifically, when running configure).

Running a search I found that there is a csconfig.h in the folder csutil/win32 within the include folder
 (still within the original source dir). That left me with fewer errors, in particular, the errors related to math.h.
Unfortunately, this file is for MSVC only, and does not work elsewhere.

Now what I did to resolve the problem was to point the search paths to the msys/local/include/crystalspace-1.2 folder, which does in fact contain a csconfig.h header. Now everything works like a charm.
Yes, the generated csconfig.h is copied to the general include folder upon installation.

Now it seems to be that csconfig.h seems to be generated after compilation?
See above, configure generates it. (Building on MSVC is different and does not involve running configure, thus the build flags have to be manually maintained for it.)
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.265 seconds with 15 queries.