bugCERTI - Bugs: bug #56370, compilation error std::make_unique


bug #56370: compilation error std::make_unique

Submitter:  janette cardoso <cardoso>
Submitted:  Wed 22 May 2019 04:22:33 PM UTC
Category:  CERTI Severity:  * 3 - Normal
Item Group:  Compilation error Status:  Confirmed
Privacy:  Public Assigned to:  jb_ch
Open/Closed:  Open Release:  * GIT-master
Reproducibility:  Every Time Fixed Release:  * GIT-master
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:
       No canned response available


Mon 22 Jul 2019 08:51:36 AM UTC, comment #4: 

comment #3:

> If it can help someone else:
> I installed gcc 8.2.0 in my VM centos 7. It took 2:50min but now I can compile certi.


Yes, indeed. As I have said previously the change I have made for compliance with Visual Studio 2017 was broking compliance with old compilers such as 4.8.5 you were using previously.

Using an up-to-date compiler (gcc from 5.0 or clang from 3.5) is indeed a workaround.

Keeping the compatibility with old compilers is an open-question still.

JbCh <jb_ch>
Project Administrator
Wed 17 Jul 2019 03:49:50 PM UTC, comment #3: 

If it can help someone else:
I installed gcc 8.2.0 in my VM centos 7. It took 2:50min but now I can compile certi.

janette cardoso <cardoso>
Project Member
Tue 09 Jul 2019 11:39:58 AM UTC, comment #2: 

After commit on July, 8, related to other ticket, I still have an error with centos 7. May be the solution is to use a newer gcc? Which one could be used?

[ 46%] Building CXX object RTIG/CMakeFiles/rtig.dir/Federation.cc.o
In file included from /home/jcardoso/pthla/certi-4.0.0/RTIG/Federation.hh:35:0,
                 from /home/jcardoso/pthla/certi-4.0.0/RTIG/Federation.cc:23:

/home/jcardoso/pthla/certi-4.0.0/RTIG/Federation.cc:288:111: warning: right operand of comma operator has no effect [-Wunused-value]
         std::make_pair(federate_handle, std::make_unique<Federate>(federate_name, federate_type, rti_version, federate_handle)));
make[2]: *** [RTIG/CMakeFiles/rtig.dir/Federation.cc.o] Error 1
make[1]: *** [RTIG/CMakeFiles/rtig.dir/all] Error 2
make: *** [all] Error 2

janette cardoso <cardoso>
Project Member
Wed 22 May 2019 07:13:56 PM UTC, comment #1: 

Obviously the last commit I have made is broking the compatibility with old compiler version such as 4.8.5.

It is related to the usage of make_unique<...> which is undefined in old std libraries (such as gcc 4.8.5).

I will have a look at it.

JbCh <jb_ch>
Project Administrator
Wed 22 May 2019 04:22:33 PM UTC, original submission:  

I'm compiling certi master, in a centOS 7, gcc 4.8.5.
It works fine for commit c2146229a but it does not work using commit 4dbc8a144c (Wed Apr 24 2019).

After 47% of compilation, I have the following error:
/home/jcardoso/softVM/pthlaVM/certi/RTIG/Federation.cc: In constructor ‘certi::rtig::Federation::Federation(const string&, certi::FederationHandle, certi::SocketServer&, certi::AuditFile&, std::vector<std::basic_string<char> >, const string&, certi::RtiVersion, int)’:
/home/jcardoso/softVM/pthlaVM/certi/RTIG/Federation.cc:141:17: error: ‘make_unique’ is not a member of ‘std’
     my_server = std::make_unique<SecurityServer>(socket_server, audit_server, my_handle);
/home/jcardoso/softVM/pthlaVM/certi/RTIG/Federation.cc:141:17: note: suggested alternative:
In file included from /home/jcardoso/softVM/pthlaVM/certi/RTIG/Federation.cc:63:0:
/home/jcardoso/softVM/pthlaVM/certi/include/make_unique.hh:13:20: note:   ‘make_unique’
 std::unique_ptr<T> make_unique(Args&&... args)
/home/jcardoso/softVM/pthlaVM/certi/RTIG/Federation.cc:141:48: error: expected primary-expression before ‘>’ token
     my_server = std::make_unique<SecurityServer>(socket_server, audit_server, my_handle);
make[2]: *** [RTIG/CMakeFiles/rtig.dir/Federation.cc.o] Error 1
make[1]: *** [RTIG/CMakeFiles/rtig.dir/all] Error 2
make: *** [all] Error 2

Do you have any help?

janette cardoso <cardoso>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jb_ch (Posted a comment)
  • -email is unavailable- added by cardoso (Submitted the item)




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-22 jb_ch CategoryNone CERTI
        Item GroupNone Compilation error
        StatusNone Confirmed
        Assigned toNone jb_ch
        ReproducibilityNone Every Time

    Back to the top

    Powered by Savane 3.9