[Lemon-user] Question on compiling application that uses LEMON

Alpár Jüttner alpar at cs.elte.hu
Wed Aug 1 12:00:19 CEST 2012


Hi,

> I get a link error and would be most grateful for a tip to fix it
> I use Visual Studio C++ 2010.  I believe all directories are specified
> correctly to point to the correct folders containing LEMON libraries.
> LEMON compiled without error.
>  
> Issue has to do with the INVALID symbol in lemon:
>  
> 1>CompareGpuToGraphCoverSpaceWorker.obj : error LNK2001: unresolved
> external symbol "struct lemon::Invalid const
> lemon::INVALID" (?INVALID at lemon@@3UInvalid at 1@B)

You need to _link_ the lemon library to your code during the
compilation. There are several alternative ways of doing it:

      * Use the CMAKE build system for your projects. It is highly
        recommended, for it is be very handy for larger project, and it
        is a platform independent solution platform solution. See
        http://lemon.cs.elte.hu/trac/lemon/wiki/HowToCompile for more
        details.
      * Build and install LEMON, then set the lemon library by hand to
        the compiler. The library is named lemon.lib on Windows.
      * INVALID is declared in lemon/base.cc. You can copy it to your
        project and compile it along with your own files. Note that this
        is quite cumbersome. The using CMAKE recommended above does
        exactly the same but in a much more sophisticated and
        comfortable way.
      * It is possible to use LEMON as a header only library, then you
        don't need to link it to lemon.lib. (At the cost that some parts
        will such as the LP/MIP interface of the EPS export will not
        work). For this you have to define LEMON_ONLY_TEMPLATES during
        the compilation. Sorry, but I don't know how to do it with VS.
        Using gcc it is done with the -DLEMON_ONLY_TEMPLATES compiler
        switch.

Regards,
Alpar

> 
> 1>C:\VSProjects\SPU\x64\Debug\SPU.exe : fatal error LNK1120: 1
> unresolved externals
> 
>  
> 
> Any recommendations?
> 
>  
> 
> Thanks for the help.
> 
>  
> 
> Best Regards,
> 
>  
> 
> George Shannon
> 
> PhD Candidate
> 
> 
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user





More information about the Lemon-user mailing list