FreeOrion

Forums for the FreeOrion project
It is currently Wed Jun 19, 2013 4:55 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [BUG] Build errors in Parse.cpp (SVN 4830)
PostPosted: Tue Apr 17, 2012 1:44 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 807
Location: Sol III
When I tried to build an OSX binary for r4830 I ran into 2 compile errors:
Code:
/Users/.../SoftwareProjekte/FO/current/Xcode/../parse/Parse.cpp:452: error: invalid initialization of non-const reference of type 'boost::filesystem3::path&' from a temporary of type 'boost::filesystem3::path'
This error occurs inside the function parse_file_common in this code section:
Code:
...
            // add newline at end to avoid errors when one is left out, but is expected by parsers
            file_contents += "\n";

            file_substitution(file_contents, path.parent_path());
            macro_substitution(file_contents);

            first = parse::text_iterator(file_contents.begin());
            parse::text_iterator last(file_contents.end());
...
The other compile error seems to be related to the one above:
Code:
/Users/.../SoftwareProjekte/FO/current/Xcode/../parse/Parse.cpp:386: error: in passing argument 2 of 'void parse::file_substitution(std::string&, boost::filesystem3::path&)'
occuring in this code section:
Code:
...
    void file_substitution(std::string& text, boost::filesystem::path& file_search_path) {
        if (!boost::filesystem::is_directory(file_search_path)) {
            Logger().errorStream() << "File parsing include substitution given search path that is not a director: " << file_search_path.string();
            return;
        }
        try {
...

I'll try to troubleshoot this issue myself, but as usual I'm feeling out of my depth here, so that will take considerable effort on my part. As I'm short on time ATM, this most probably will take quite a while, and I won't be able to provide a OSX binary until this issue is solved. So if anyone can give me some pointers, I'd appreciate that very much :) (and eleazar probably as well, as he'll get a current binary sooner... ;)).


Top
 Profile  
 
 Post subject: Re: [BUG] Build errors in Parse.cpp (SVN 4830)
PostPosted: Tue Apr 17, 2012 1:50 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
Try changing line 386 to:
Code:
    void file_substitution(std::string& text, const boost::filesystem::path& file_search_path) {
The change is adding const to the second parameter type, since it's complaining about initializing a non-const type.


Top
 Profile  
 
 Post subject: Re: [BUG] Build errors in Parse.cpp (SVN 4830)
PostPosted: Tue Apr 17, 2012 2:47 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 807
Location: Sol III
Geoff the Medio wrote:
Try changing line 386 to:
Code:
    void file_substitution(std::string& text, const boost::filesystem::path& file_search_path) {
The change is adding const to the second parameter type, since it's complaining about initializing a non-const type.
Done. This lets me build FO successfully, the resulting binary however crashes during universe generation. Logs attached.

I'll try to narrow down where the crash occurs.


Attachments:
freeoriond.log [60.45 KiB]
Downloaded 8 times
freeorion.log [15.87 KiB]
Downloaded 4 times
Top
 Profile  
 
 Post subject: Re: [BUG] Build errors in Parse.cpp (SVN 4830)
PostPosted: Tue Apr 17, 2012 9:24 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
I'm not getting any crashes in the latest SVN on Windows.


Top
 Profile  
 
 Post subject: Re: [BUG] Build errors in Parse.cpp (SVN 4830)
PostPosted: Wed Apr 18, 2012 9:20 am 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 807
Location: Sol III
Geoff the Medio wrote:
I'm not getting any crashes in the latest SVN on Windows.
Yeah, that's because it's a failing assertion, and I didn't build my binaries with NDEBUG defined. As it turned out, this issue is unrelated to the build error in Parse.cpp, so I made a separate thread for this other issue, see here.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: YandexBot and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group