VS-current svn, compile error with VS Express 2012

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

VS-current svn, compile error with VS Express 2012

Postby shenle » Sun Apr 20, 2014 9:42 pm

Code: Select all
Error   1556   error C2664: 'aligned_allocator<T>::aligned_allocator(const aligned_allocator<T> &) throw()' : cannot convert parameter 1 from 'std::_Wrap_alloc<_Alloc>' to 'const aligned_allocator<T> &'   C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vector   1102   1   vegastrike


Context in std::vector<_Ty, _Alloc>
Code: Select all
_Alloc get_allocator() const _NOEXCEPT
      {   // return allocator object for values
      return (this->_Getal());
      }
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: VS-current svn, compile error with VS Express 2012

Postby ezee » Thu Apr 24, 2014 12:12 pm

Hi, who is hidding in the dark corner .
need some :idea: ?
:lol:

I wasn't able to compile the actual trunk for VisualStudio , but i've found that the
svn/tags/0.5.1 rc1 is working fine .

Are you a windows dev ( you plan to code for vegastrike with visual studio ) ?
:?:
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: VS-current svn, compile error with VS Express 2012

Postby jackS » Fri May 02, 2014 7:42 am

I know it's not the same versions, but there's a similar sounding bug listed at the Boost website that may indicate some sort of fundamental incompatibilities between recent versions of Boost and VC++

Known Bugs with Visual Studio 2013/Visual C++ 12
Visual Studio 2013 was released quite late in the release process, so there exist several unresolved issues. These include:

Serialization can't compile because of a missing include.
Using has_member_function_callable_with from Boost.Container's allocator_traits causes a compile error (#9332).
In libraries such as Unordered and MultiIndex, calling overloaded functions with initializer lists can result in a compile error, with Visual C++ claiming that the overloads are ambiguous. This is a Visual C++ bug and it isn't clear if there's a good workaround. This won't affect code that doesn't use initializer lists, or uses an initializer list that doesn't require an implicit conversion (i.e. an initializer list of the container's exact value type).
Thread: ex_scoped_thread compile fails (#9333).
User avatar
jackS
Minister of Information
Minister of Information
 
Posts: 1895
Topics: 56
Joined: Fri Jan 31, 2003 2:40 pm
Location: The center of Centre county

Re: VS-current svn, compile error with VS Express 2012

Postby shenle » Fri Nov 21, 2014 7:03 pm

Okay, revisiting this after a half-year; have switched development toolchain to VS express 2013.

Current errors (of the latest svn checkout as of today):

Code: Select all
Error   168   error C2375: 'fmin' : redefinition; different linkage   \vegastrike\src\ship_commands.cpp   12   1   vegastrike
Error   169   error C2375: 'fmax' : redefinition; different linkage   \vegastrike\src\ship_commands.cpp   16   1   vegastrike
Error   170   error C2264: 'fmin' : error in function definition or declaration; function not called   \vegastrike\src\ship_commands.cpp   134   1   vegastrike
Error   222   error C2039: 'min' : is not a member of 'std'     \vegastrike\src\audio\Stream.cpp   15   1   vegastrike
Error   223   error C2873: 'min' : symbol cannot be used in a using-declaration   \vegastrike\src\audio\Stream.cpp   15   1   vegastrike
Error   224   error C3861: 'min': identifier not found   \vegastrike\src\audio\Stream.cpp   64   1   vegastrike
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: VS-current svn, compile error with VS Express 2012

Postby drifter » Sat Nov 22, 2014 6:06 am

Vega Strike includes windows.h in a number of places, which pollutes the code with all kinds of crap.

Add NOMINMAX to preprocessor definitions (should be somewhere in project properties, compiler ...), should be there by default in any project using windows headers imho.
drifter
Explorer
Explorer
 
Posts: 10
Topics: 1
Joined: Sat Oct 18, 2014 5:58 pm

Re: VS-current svn, compile error with VS Express 2012

Postby shenle » Wed Jan 07, 2015 10:43 pm

Took me a while to get back to this, real life's a b*tch.

Adding NOMINMAX to preprocessor defs didn't do anything, I get the exact same errors.
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: VS-current svn, compile error with VS Express 2012

Postby drifter » Thu Jan 08, 2015 12:05 pm

In they files that fail add to the includes on top:

#include <algorithm> // min/max
drifter
Explorer
Explorer
 
Posts: 10
Topics: 1
Joined: Sat Oct 18, 2014 5:58 pm

Re: VS-current svn, compile error with VS Express 2012

Postby drifter » Thu Jan 08, 2015 12:12 pm

In general I also think it might be a good idea to replace all custom fmin/intmin/mymin and max variants with std::min/max
drifter
Explorer
Explorer
 
Posts: 10
Topics: 1
Joined: Sat Oct 18, 2014 5:58 pm

Re: VS-current svn, compile error with VS Express 2012

Postby loki1950 » Thu Jan 08, 2015 2:45 pm

drifter wrote:In general I also think it might be a good idea to replace all custom fmin/intmin/mymin and max variants with std::min/max


Good idea as that would help to generalize the code for the various platforms we support and ultimately reduce the custom #define macro's we need for them,that was one of the reasons we moved to cmake (it's cross-platform support)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 18/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and DELL E6400 4GB ram/100 GB HD Mint 17.3 6
User avatar
loki1950
The Shepherd
 
Posts: 5708
Topics: 51
Joined: Fri May 13, 2005 1:37 pm
Location: Ottawa

Re: VS-current svn, compile error with VS Express 2012

Postby shenle » Sun Jan 11, 2015 7:24 am

Okay here's a new round of testing. I started from scratch: new installation of Windows 7, installation of VS express 2013 and svn, and that's all. This is to remove any old headers and crap that may have been lurking on the old machine.

First round of compilation ends with this:
Code: Select all
Error   161   error C2375: 'fmin' : redefinition; different linkage   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   12   1   vegastrike
Error   162   error C2375: 'fmax' : redefinition; different linkage   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   16   1   vegastrike
Error   163   error C2264: 'fmin' : error in function definition or declaration; function not called   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   134   1   vegastrike
Error   222   error C2039: 'min' : is not a member of 'std'   C:\games\vegastrike\svn\vegastrike\src\audio\Stream.cpp   15   1   vegastrike
Error   223   error C2873: 'min' : symbol cannot be used in a using-declaration   C:\games\vegastrike\svn\vegastrike\src\audio\Stream.cpp   15   1   vegastrike
Error   224   error C3861: 'min': identifier not found   C:\games\vegastrike\svn\vegastrike\src\audio\Stream.cpp   64   1   vegastrike
Error   1675   error C2664: 'aligned_allocator<Vector,16>::aligned_allocator(const aligned_allocator<Vector,16> &) throw()' : cannot convert argument 1 from 'std::_Wrap_alloc<std::allocator<T>>' to 'const aligned_allocator<Vector,16> &'   C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector   1163   1   vegastrike


Second round with NOMINMAX defined and the above #include applied:
Code: Select all
Error   168   error C2375: 'fmin' : redefinition; different linkage   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   13   1   vegastrike
Error   169   error C2375: 'fmax' : redefinition; different linkage   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   17   1   vegastrike
Error   170   error C2264: 'fmin' : error in function definition or declaration; function not called   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   135   1   vegastrike
Error   1670   error C2664: 'aligned_allocator<Vector,16>::aligned_allocator(const aligned_allocator<Vector,16> &) throw()' : cannot convert argument 1 from 'std::_Wrap_alloc<std::allocator<T>>' to 'const aligned_allocator<Vector,16> &'   C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector   1163   1   vegastrike


So that seems to have fixed the errors in Stream.cpp, but not in ship_commands.cpp (the line number differences are due to the extra #include line)
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: VS-current svn, compile error with VS Express 2012

Postby drifter » Sun Jan 11, 2015 9:09 am

For the fmin/fmax issue. My guess is that the compiler doesn't like the "static inline" part. Try removing inline or static qualifier.
Or replace fmin/fmax with std::min, std::max (or min, max as vs uses std namespace), don't forget the algorithm header.

According to google search vs2012/13 is very picky about custom allocators... you have to define rebind explicitely it seems.

In src/gfx/aligned.h just below (line 41)

template<typename A> explicit aligned_allocator(const A &other)...

add

template <class U>
struct rebind
{
typedef aligned_allocator<U> other;
};
drifter
Explorer
Explorer
 
Posts: 10
Topics: 1
Joined: Sat Oct 18, 2014 5:58 pm

Re: VS-current svn, compile error with VS Express 2012

Postby drifter » Sun Jan 11, 2015 9:45 am

Forget about rebind for now, won't compile, needs more changes.
drifter
Explorer
Explorer
 
Posts: 10
Topics: 1
Joined: Sat Oct 18, 2014 5:58 pm

Re: VS-current svn, compile error with VS Express 2012

Postby drifter » Sun Jan 11, 2015 3:38 pm

I ve attached a working aligned.h fixes patch.

I am not 100% sure this will be enough to make msvc happy, but it is a start.
Attachments
aligned.patch
(1.75 KiB) Downloaded 94 times
drifter
Explorer
Explorer
 
Posts: 10
Topics: 1
Joined: Sat Oct 18, 2014 5:58 pm

Re: VS-current svn, compile error with VS Express 2012

Postby shenle » Mon Jun 08, 2015 9:36 pm

So the patch fixes the last error. Still left these:

Code: Select all
Error   8   error C2375: 'fmin' : redefinition; different linkage   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   12   1   vegastrike
Error   9   error C2375: 'fmax' : redefinition; different linkage   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   16   1   vegastrike
Error   10   error C2264: 'fmin' : error in function definition or declaration; function not called   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   134   1   vegastrike



Removing the static qualifier gives me this

Code: Select all
Error   8   error C2084: function 'float fmin(float,float) throw()' already has a body   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   12   1   vegastrike
Error   9   error C2084: function 'float fmax(float,float) throw()' already has a body   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   16   1   vegastrike
Error   10   error C2264: 'fmin' : error in function definition or declaration; function not called   C:\games\vegastrike\svn\vegastrike\src\ship_commands.cpp   134   1   vegastrike



Removing the inline qualifier gives again the first set of errors.


Changing in ship_commands.cpp fmin -> min and fmax _> max allows the compilation to finish. The compiled program however crashes during the splash screen. Stdout and stderr don't have anything useful in particular.

Stderr:
Code: Select all
USING HOMEDIR : C:\Users\s\Documents/.vegastrike As the home directory
GOT SUBDIR ARG =
Found data in C:\games\vegastrike\svn\win32\bin/../data
Using C:\games\vegastrike\svn\win32\data as data directory
CONFIGFILE - No config found in home : C:\Users\s\Documents/.vegastrike/vegastrike.config
CONFIGFILE - No home config file found, using datadir config file : C:\games\vegastrike\svn\win32\data/vegastrike.config
MISSION_NAME is empty using : main_menu.mission
running import sys
print(sys.path)
sys.path = ["",r"C:\games\vegastrike\svn\win32\data\modules\builtin",r"C:\games\vegastrike\svn\win32\data\modules\quests",r"C:\games\vegastrike\svn\win32\data\modules\missions",r"C:\games\vegastrike\svn\win32\data\modules\ai",r"C:\games\vegastrike\svn\win32\data\modules",r"C:\games\vegastrike\svn\win32\data\bases"] + sys.path
testing VS randomrunning import sys
print(sys.path)
  Initializing renderer...
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 2000
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 38
Loading a starsystem
Loading Star System Special/Empty
FOUND MODIFICATION = player FOR PLAYER #0


Stdout:
Code: Select all
 In path C:\games\vegastrike\svn\win32\bin
Windows version 6 1
Vega Strike 
See http://www.gnu.org/copyleft/gpl.html for license details.

Using .vegastrike as the home directory


On Linux the binary compiled from the same code runs without any problems.
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: VS-current svn, compile error with VS Express 2012

Postby ezee » Tue Jun 09, 2015 4:35 am

Hi .
There is an option in the config file to allow more debug level .
It's under general , wait ....
<section name="general">
<var name="times_to_show_help_screen" value="-1"/>
<var name="dockingtime" value="20"/>
<var name="remember_savegame" value="false"/>
<var name="load_last_savegame" value="false"/>
<var name="write_savegame_on_exit" value="false"/>
<var name="debug_config" value="false"/>
<var name="debug_fs" value="3"/> <!-- set to 3 for most comprehensive debugging-->
<var name="default_mission" value="main_menu.mission"/>
<var name="galaxy" value="milky_way.xml"/>
<var name="yaw" value="0"/>


I use that actually to debug the video support
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: VS-current svn, compile error with VS Express 2012

Postby shenle » Tue Jun 09, 2015 6:46 pm

Well by turning on debugging level 3 I get the attached stderr. It appears that the game is trying to load a bunch of files from the data directory, which aren't there. Even more, it is searching in paths which mix unix- and windows-style path separators, and I wonder if that's not a part of the problem. FWIW the precompiled vegastrike.exe from the svn repository does not have trouble finding its data files and runs correctly.
Attachments
stderr.txt
(76.5 KiB) Downloaded 85 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: VS-current svn, compile error with VS Express 2012

Postby shenle » Tue Jun 09, 2015 6:49 pm

Well I was wrong, the binary from the svn also spews out a bunch of file not found errors.... but as opposed to the one compiled by me it runs properly and doesn't freeze. See attached stderr for the binary from svn.
Attachments
stderr.txt
(99.92 KiB) Downloaded 80 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: VS-current svn, compile error with VS Express 2012

Postby ezee » Tue Jun 09, 2015 7:27 pm

I don't know what is your project with VS , but as you are a windows user i can help you .
But never more with another thing than the 0.5.1 rc1 from tag
I spent hours to try to build Vegastrike , and the only version working out of the box for windows && VC9 is :
https://sourceforge.net/p/vegastrikevo/ ... _0_5_1_r1/

It's my fork , you can find the original in the VS svn too .
But i would be happy to have a tester for Vegastrike evolved repositery .
:wink:

Anyway , you just need to checkout Data,vegastrike,vega-vc9 and win32 (or win64).
I have winXP sp3 and so i use win32 .
If you have vista or 7 and more use win64

You must copy the dll from win32/bin inside Data to run the game .
EDIT : In fact i mean grab all the files in win32 and paste idem in Data .
If you have MSVC2010 or > , launch the vc9 solution , 2010-2012 will make an updated project for you .
Good luck .
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE



Return to Compiling Problems [paste config.log]

Who is online

Users browsing this forum: No registered users and 2 guests

cron