Version 12701, compile errors Win/VC++ 2003

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).

Version 12701, compile errors Win/VC++ 2003

Postby shenle » Thu Mar 11, 2010 7:14 pm

Last checkout from 3/11/10, rev. 12701 gives me the following errors on compiling with VC++ .NET 2003:

C:\dls\vegastrike\svn\vegastrike\src\gfx\vsimage.cpp(325): error C3861: 'png_set_expand_gray_1_2_4_to_8': identifier not found, even with argument-dependent lookup
C:\dls\vegastrike\svn\vegastrike\src\gfx\vid_file.cpp(22): error C2059: syntax error : '<<'
C:\dls\vegastrike\svn\vegastrike\src\gfx\vid_file.cpp(139): error C2146: syntax error : missing ';' before identifier 'frameBufferStride'
C:\dls\vegastrike\svn\vegastrike\src\gfx\vid_file.cpp(139): error C2501: 'VidFileImpl::xoffset_t' : missing storage-class or type specifiers
C:\dls\vegastrike\svn\vegastrike\src\gfx\vid_file.cpp(139): error C2501: 'VidFileImpl::frameBufferStride' : missing storage-class or type specifiers
C:\dls\vegastrike\svn\vegastrike\src\gfx\vid_file.cpp(354): error C2039: 'frameBufferStride' : is not a member of 'VidFileImpl'
C:\dls\vegastrike\svn\vegastrike\src\gldrv\gl_light_state.cpp(70): error C2065: 'M_PI' : undeclared identifier
C:\dls\vegastrike\svn\vegastrike\src\gldrv\gl_light_state.cpp(71): fatal error C1903: unable to recover from previous error(s); stopping compilation
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Fri Mar 12, 2010 7:47 am

Also, when I try to compile r12705 (changed from 12701 to this while I was compiling) with VC++ express 2008 I get:

general.cpp
c1xx : fatal error C1083: Cannot open source file: '..\vegastrike\src\gui\general.cpp': No such file or directory
..\vegastrike\src\gfx\vsimage.cpp(325) : error C3861: 'png_set_expand_gray_1_2_4_to_8': identifier not found
..\vegastrike\src\gldrv\gl_light_state.cpp(70) : error C2065: 'M_PI' : undeclared identifier
..\vegastrike\src\gldrv\gl_light_state.cpp(77) : error C2065: 'M_PI' : undeclared identifier

Full build log attached below, zipped (the board should really allow html files to be attached, but it doesn't).
This was built using the vegastrike2008 project.

As a side note, the binary from win32/bin doesn't run on Windows7 64-bit, even in compatibility mode. It starts, but soon crashes with a VC++ runtime error.
Attachments
BuildLog.zip
(8.73 KiB) Downloaded 158 times
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby klauss » Fri Mar 12, 2010 8:43 am

We'll have to update libpng for the windws project.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Fri Mar 12, 2010 4:18 pm

I got over the missing M_PI problem by adding back a #define that was there in ver. 0.4.3 but went missing after a while. In gl_light_state.cpp I put the following:
Code: Select all
#ifndef M_PI
 #define M_PI 3.14159265358979323846264338328
 #endif
and it seems to work.

general.cpp and general.h in src/gui: the files are missing completely. OK to remove them from the project?

Also it seems that png_set_expand_gray_1_2_4_to_8 is only present in libpng 1.2.9 and newer, whereas the version that comes with the VC7 project is 1.2.0 and the one from the VC8 project 1.2.8
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Fri Mar 12, 2010 6:39 pm

I have also replaced the libpng in the vc7 project with libpng-1.4.1, and got over the png_set_expand_gray_1_2_4_to_8 error.

However it still complains of missing gui/general.cpp. When I remove that from the project, I get several hundreds of unresolved external symbols at the linking stage. Attached see the output.
Attachments
output.txt
(234.96 KiB) Downloaded 172 times
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby klauss » Fri Mar 12, 2010 9:26 pm

Uh... that's not general.h/cpp, it's one of the unit*.cpp guys that's missing. The newest additions, I think it's unit_server.cpp, faction_xml_server.cpp, images_server.cpp, pilot_server.cpp, gfx/mesh_bin_server.cpp for vegaserver and images.cpp for vegastrike.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Fri Mar 12, 2010 11:02 pm

Hmm. All these source files are there, but I don't see any corresponding object files in the output directory. Also no mention of them being built in the compiler messages.

I added the files you mentioned to the project, and it still gives errors (actually even more than before). Attached the new output.
Attachments
output2.txt
(50.43 KiB) Downloaded 164 times
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby klauss » Fri Mar 12, 2010 11:16 pm

It looks like you added both the _server and the plain versions.

Only one of them should be there - the "vegaserver" target takes the _server versions, and the "vegastrike" target takes the plain version.

Chuck will know a lot more details though.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sat Mar 13, 2010 12:18 pm

Okay, I removed all the server files, only left images.cpp in. Still 180 errors at linking (target "vegastrike")
Attachments
output3.txt
(47.13 KiB) Downloaded 173 times
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby chuck_starchaser » Sat Mar 13, 2010 7:25 pm

Klauss described it exactly the way it is. There are xxx_server.cpp variants for vegaserver. When that happens, vegaserver uses xxx_server.cpp, and vegastrike uses xxx.cpp. Simple as that.

My guess as to your problems is that you probably have one file too many in the vegastrike target. With one cpp file too many, the linker doesn't tell you it doesn't need that file, like it should; instead it tells you it's missing a gazillion definitions that the useless file wants to see.
What you should do is go carefully through the Makefile.am or CMakeLists.txt, and make sure your project files are a perfect match.
Or, perhaps there's a way to have cmake produce an NMake file for VC++. That would be Safemode's area of expertise.

GameUnit<class Unit>::Draw(void), which vcc says it's missing, is defined in unit.cpp.
GameUnit<class Asteroids>::Draw(void), which vcc says it's missing, is also defined in unit.cpp.
etceteras.
Yeah, looks like unit.cpp is missing from your build list.

Ah, wait!
It would indeed be missing. Unit used to be a header-only library; but now it compiles to its own object file.
Just add unit.cpp.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sat Mar 13, 2010 10:41 pm

Yes! It works now. Actually, unit.cpp was already on the build list, but for some reason it wouldn't compile during a normal build. When I viewed the file's properties, it had the flag "exclude from build" set to "yes". I changed it to "no" and now vegastrike builds complete normally. This was BTW the default vegastrike.sln downloaded through svn, that had the wrong flag set.

Here is the compiled binary, should anyone want to try it. It's made from svn rev. 12705:
http://www.megaupload.com/?d=I6U1O4AI
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby chuck_starchaser » Sat Mar 13, 2010 11:12 pm

Congratulations! I can't test it; don't have windows... maybe I could try it on Wine.
You're the first person in two years to manage to compile a windows binary.
Would it be much to ask if you could document the process? Though it may be the fact it's VC 2003; I think the big problems are with later VCC releases.
Also, the current revision is 12718, right this moment; and many bugs have been fixed since 12705; you might want to svn up and recompile.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sat Mar 13, 2010 11:30 pm

Yes I did that. Here's the binary from rev. 12718.

http://www.megaupload.com/?d=EJMNOD87

You're the first person in two years to manage to compile a windows binary.
Really? The win32 branch has a binary dated 5/09. :)
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby klauss » Sun Mar 14, 2010 12:06 am

If you can prepare a patch with the required changes to VS, if any, for it to build in win32 I'd be glad to review & commit it.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sun Mar 14, 2010 12:32 am

I'll see what I can do. The problem is, it's getting late, and starting tomorrow I won't have access to this computer for a week. I'll have one with VS 2008 express installed, so when/if I can make that one work, I'll document it and make a patch if I can. That will be for vega-vc8 I guess (whereas the above was for vega-vc7).
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sun Mar 14, 2010 7:51 am

Like I said now I only have access to my laptop running Windows7 64-bit, with VS express 2008. I have updated the vega-vc8 project (vegastrike2008.sln) to build in this configuration. The changes I made are:
1. added a definition for M_PI in src/gldrv/gl_light_state.cpp
2. updated libpng to 1.4.1 in vega-vc8/include and vega-vc8/lib
3. fixed flags on src/cmd/unit.cpp so it compiles
4. removed src/gui/general.cpp and .h from project
5. added src/cmd/images.cpp to the project

With the above changes, a binary is generated. However I can't test if it runs or not. None of the binaries I have (including the ones that I compiled yesterday) runs on this machine. I think it's because it has a 64-bit OS. For example, the binary I generated opens up in a window that only shows a solid red background, and hangs there.

If someone could test this binary for me, it would be much appreciated. I am traveling now and only have this laptop with me. I may have access to other computers along the way, but they won't have vegastrike installed. :(

Here is the compiled binary:
http://www.megaupload.com/?d=V87AUIMY

And here is a bundle with all the changes I made:
http://www.megaupload.com/?d=E80RSPKQ
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sun Mar 14, 2010 8:06 am

Scratch that. I retested the binaries I generated yesterday and they work on Win7 64-bit, whereas the new one doesn't. There still is something wrong with the project that I can't quite put my finger on.

I'll see if I can completely redo the project starting with the vega-vc7 one which I know works.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby chuck_starchaser » Sun Mar 14, 2010 9:36 am

Good work, shenie; keep it up.
The problem we've had for the past couple of years, is that VC8+, even when it compiles, it produces a crashy executable; and nobody's yet figured out the problem. It could be MS sabotaging opengl, for all I know :D
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sun Mar 14, 2010 11:03 am

Grrr. This VS express is crap. It acts completely randomly sometimes. It finds a certain header when compiling a file, then it doesn't for the next file. Messed up. :(
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby shenle » Sun Mar 14, 2010 11:50 am

I am bogged down at:
Code: Select all
1>------ Build started: Project: vegastrike, Configuration: Release Win32 ------
1>Compiling...
1>ffmpeg_init.cpp
1>..\vegastrike\src\ffmpeg_init.cpp(74) : error C2146: syntax error : missing ';' before identifier '_url_seek'
1>..\vegastrike\src\ffmpeg_init.cpp(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\vegastrike\src\ffmpeg_init.cpp(74) : error C2061: syntax error : identifier 'xoffset_t'
1>..\vegastrike\src\ffmpeg_init.cpp(75) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>..\vegastrike\src\ffmpeg_init.cpp(76) : error C2065: 'whence' : undeclared identifier
1>..\vegastrike\src\ffmpeg_init.cpp(77) : error C2065: 'pos' : undeclared identifier
1>..\vegastrike\src\ffmpeg_init.cpp(89) : error C2440: 'initializing' : cannot convert from 'int (__cdecl *)(URLContext *)' to 'offset_t (__cdecl *)(URLContext *,offset_t,int)'
1>        None of the functions with this name in scope match the target type
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 9.00.30729
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>BSCMAKE: error BK1506 : cannot open file '.\vegastrike_Win32_Release\general.sbr': No such file or directory
1>Build log was saved at "file://d:\dls\vegastrike\svn\vega-vc7\vegastrike_Win32_Release\BuildLog.htm"
1>vegastrike - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
 
Posts: 380
Topics: 30
Joined: Wed Jan 30, 2008 8:25 pm
Location: hiding in a dark corner

Re: Version 12701, compile errors Win/VC++ 2003

Postby chuck_starchaser » Sun Mar 14, 2010 3:48 pm

I don't have ffmpeg installed in Ubuntu, and the engine compiles for me. I think ffmpeg is a planned requirement, rather than a real and present one. But Klauss should know more about this.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Version 12701, compile errors Win/VC++ 2003

Postby chuck_starchaser » Sun Mar 14, 2010 3:57 pm

Oh, wait:
Code: Select all
extern "C" offset_t _url_seek( URLContext *h, offset_t pos, int whence )
{
    if (whence != AVSEEK_SIZE) {
        ( (VSFile*) (h->priv_data) )->GoTo( long(pos) );
        return ( (VSFile*) (h->priv_data) )->GetPosition();
    } else {
        return ( (VSFile*) (h->priv_data) )->Size();
    }
}

It seems it's not liking offset_t. It's a typedef...
Code: Select all
#ifdef _WIN32
#define offset_t xoffset_t
#endif

#ifndef offset_t
    #if (LIBAVCODEC_VERSION_MAJOR >= 52) || (LIBAVCODEC_VERSION_INT >= ( ( 51<<16)+(49<<8)+0 ) ) || defined (__amd64__) \
    || defined (_M_AMD64) || defined (__x86_64) || defined (__x86_64__)
typedef int64_t offset_t;
    #else
typedef int     offset_t;
    #endif
#endif

No, wait; for non-WIN32 it's a typedef; for WIN32 it's a macro... :roll:
Why can't we just use ptrdiff_t?
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Version 12701, compile errors Win/VC++ 2003

Postby klauss » Sun Mar 14, 2010 4:14 pm

url_seek is an interface of ffmpeg, it's part of ffmpeg's url plugin interface, it has to return whatever ffmpeg wants it to return. It can't use ptrdiff_t, then.

I bet the ffmpeg headers in vega-vc7 and vega-vc8 are outdated, just as libpng was.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Version 12701, compile errors Win/VC++ 2003

Postby chuck_starchaser » Sun Mar 14, 2010 5:52 pm

Gottcha.
BTW, I added M_PI to gldrv/gl_light_state.cpp; it will get committed with my next vs_cubemap_gen update, next hour or so.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Version 12701, compile errors Win/VC++ 2003

Postby klauss » Sun Mar 14, 2010 6:05 pm

You should commit rightaway, unless you have other modifications in the same file.

I commit separate things separately if it's not a hassle, and if you don't have other modifications in a file then it's not a big deal.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina


Next

Return to Compiling Problems [paste config.log]

Who is online

Users browsing this forum: No registered users and 1 guest

cron