compiling problems with Fedoa 11 (revision 12556)

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: compiling problems with Fedoa 11 (revision 12556)

Post by JsnMtth »

Whats the difference between one two and three "*" ?
Whats up with "(*)" ?

I'm reading my C++ book at maximum speed. I think I encountered a single * star being a pointer. I know there is a difference between it being before and after the declaration. I haven't encountered what the the others are. Hopefully by the time I complete the book I'll be able to debug more?

Anybody know what dirent is ? Is it a custom type like a struct or union?
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: compiling problems with Fedoa 11 (revision 12556)

Post by JsnMtth »

Also of note is the error reports that argument 4 is having the problem

Code: Select all

int ret = scandir (savedir.c_str(),&dirlist,nodirs,(scancompare)&datesort);
The last argument (scancompare)&datesort
What are they, what do the parenthesis do?
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: compiling problems with Fedoa 11 (revision 12556)

Post by JsnMtth »

never mind I have it

Lines 3148-3152

Code: Select all

#if defined(_WIN32) && !defined(__CYGWIN__)
typedef int (*scancompare) ( const struct dirent **v1, const struct dirent **v2 );
#else
typedef int (*scancompare) ( const void *v1, const void *v2 );
#endif
It sets the definition for (*scancompare)... dirent on _WIN32 and __CYGWIN__ and void on everything else.

By changing the definition for everything else to the definition of of WIN32 and CYGWIN I'm successfuly compiling.

What needs to be done next is fix this right. If my build works properly, I'll check to see if this is a change in the version history of scandir. If so then a m4 macro will need to be created to explicitly for what kind of scandir to use (if such a macro hasn't been created), then we can set a _SCANCOMPARE_TYPE_ preprocessor flag rather than checking host type.
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: compiling problems with Fedoa 11 (revision 12556)

Post by JsnMtth »

The build worked :)
JsnMtth
Bounty Hunter
Bounty Hunter
Posts: 174
Joined: Wed May 27, 2009 6:38 am
Location: Fresno, California - United States of America
Contact:

Re: compiling problems with Fedoa 11 (revision 12556)

Post by JsnMtth »

Code: Select all

diff --git a/vegastrike/src/cmd/basecomputer.cpp b/vegastrike/src/cmd/basecomputer.cpp
index eb97e3f..dffe63b 100644
--- a/vegastrike/src/cmd/basecomputer.cpp
+++ b/vegastrike/src/cmd/basecomputer.cpp
@@ -3145,7 +3145,7 @@ static int datesort ( const void *v1, const void *v2 ) {
        return s1.st_mtime - s2.st_mtime;
 }
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(__CYGWIN__) || defined(__USE_DIRENT_SCANDIR__)
 typedef int (*scancompare) ( const struct dirent **v1, const struct dirent **v2 );
 #else
 typedef int (*scancompare) ( const void *v1, const void *v2 );
I created a new preprocessor constant __USE_DIRENT_SCANDIR__ by setting it with the -D flag with the compiler it will change the code. Unfortunately CXXFLAGS doesn't seem to carry the argument to the compiler command. I cut and past the g++ command and modified it manually. Ideally an M4 macro would actually do a test to see which scandir() to use then set the preprocessor constant for us.

EDIT: It turns out that I needed to run ./configure again after setting the CXXFLAGS value :oops:
athomic1
Bounty Hunter
Bounty Hunter
Posts: 137
Joined: Wed Apr 08, 2009 6:07 am

Re: compiling problems with Fedoa 11 (revision 12556)

Post by athomic1 »

Genghis Prawn wrote:using revision 12562:

I corrected the lines shown in the patch for revision 12556. I now get this message

In file included from src/gui/glut_support.cpp:27:
./src/gldrv/gl_globals.h:235: error: ‘PFNGLCOMPRESSEDTEXIMAGE2DPROC’ does not name a type
make[1]: *** [src/gui/glut_support.o] Error 1
make[1]: Leaving directory `/home/norman/Vegastrike/vegastrike'
make: *** [all] Error 2
Did anyone figure this one out? I'm getting the same error now, using rev 12568.
Post Reply