Menu

#2015 Error when building on MS Visual Studio 2010

closed-fixed
5
2013-05-25
2012-04-25
No

The build on MS Visual Studio 2010 ends with an error:

SDCCnaddr.cc
port.lib(ralloc2.obj) : error LNK2005: "public: __thiscall cfg_node::cfg_node(void)" (??0cfg_node@@QAE@XZ) already defined in SDCCnaddr.obj
..\bin_vc\sdcc.exe : fatal error LNK1169: one or more multiply defined symbols found

It seems that cfg_node::cfg_node(void) is instantiated in both SDCCnaddr.obj and ralloc2.obj located in z80 port.lib.

There probably is MSVC command line which disables checking of multiple defined functions in libraries, but this would probably only hide the problem instead of fixing it.

SDCC revision: #7641

Borut

Discussion

  • Maarten Brock

    Maarten Brock - 2012-05-05

    Well, there are some more weird things about cfg_node.

    - It is declared twice and differently in SDCCnaddr.hpp and SDCCralloc.hpp but uses no namespace to differentiate.
    - The constructor is implemented in an include file but is not marked inline.
    - The variable default_constructor_of_cfg_node_called is defined in a header file.

    I renamed cfg_node to cfg_naddr_node in SDCCnaddr.hpp and disabled the debug code in SDCCralloc.hpp to fix this in SDCC #7667.

     
  • Maarten Brock

    Maarten Brock - 2012-05-05
    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     

Log in to post a comment.