Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  compilation errors

    Posted Fri July 10, 2009 02:00 PM

    Originally posted by: SystemAdmin


    [ammoun84 said:]

    hello,
    i'm working with cpp and using the ilog cplex..
    i compiled my cpp code,and i didn't find error, but some errors related to Cplex appears and i can't understand them ..can someone help me please to know how to solve them..

    [color=red]Compiling...
    dual.cpp
    Linking...
    dual.obj : error LNK2001: unresolved external symbol "public: static void __cdecl IloEnvObjectI::operator delete(void *,class IloEnv const &)" (??3IloEnvObjectI@@SAXPAXABVIloEnv@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: double __thiscall IloAlgorithm::getValue(class IloNumVar)const " (?getValue@IloAlgorithm@@QBENVIloNumVar@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: double __thiscall IloAlgorithm::getObjValue(void)const " (?getObjValue@IloAlgorithm@@QBENXZ)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloCplex::IloCplex(class IloModel)" (??0IloCplex@@QAE@VIloModel@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloConstraint __cdecl operator<=(class IloNumExprArg,class IloNumExprArg)" (??N@YA?AVIloConstraint@@VIloNumExprArg@@0@Z)<br />dual.obj : error LNK2001: unresolved external symbol "public: class IloExpr & __thiscall IloExpr::operator+=(double)" (??YIloExpr@@QAEAAV0@N@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: class IloExpr & __thiscall IloExpr::operator+=(class IloNumExprArg)" (??YIloExpr@@QAEAAV0@VIloNumExprArg@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloNumExprArg __cdecl operator*(double,class IloNumExprArg)" (??D@YA?AVIloNumExprArg@@NV0@@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloNumExprArg __cdecl operator-(class IloNumExprArg,double)" (??G@YA?AVIloNumExprArg@@V0@N@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloRange __cdecl operator<=(class IloNumExprArg,double)" (??N@YA?AVIloRange@@VIloNumExprArg@@N@Z)<br />dual.obj : error LNK2001: unresolved external symbol "class IloNumLinExprTerm __cdecl operator*(long,class IloNumVar)" (??D@YA?AVIloNumLinExprTerm@@JVIloNumVar@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloRange __cdecl operator==(class IloNumExprArg,double)" (??8@YA?AVIloRange@@VIloNumExprArg@@N@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloConstraint __cdecl operator>=(class IloNumExprArg,class IloNumExprArg)" (??P@YA?AVIloConstraint@@VIloNumExprArg@@0@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloConstraint __cdecl operator==(class IloNumExprArg,class IloNumExprArg)" (??8@YA?AVIloConstraint@@VIloNumExprArg@@0@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: class IloExpr & __thiscall IloExpr::operator+=(class IloNumVar)" (??YIloExpr@@QAEAAV0@VIloNumVar@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: class IloExtractable __thiscall IloModel::add(class IloExtractable)const " (?add@IloModel@@QBE?AVIloExtractable@@V2@@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloNumExprArg __cdecl operator+(class IloNumExprArg,class IloNumExprArg)" (??H@YA?AVIloNumExprArg@@V0@0@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: class IloExpr & __thiscall IloExpr::operator+=(class IloNumLinExprTerm)" (??YIloExpr@@QAEAAV0@VIloNumLinExprTerm@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "class IloNumLinExprTerm __cdecl operator*(class IloNumVar,long)" (??D@YA?AVIloNumLinExprTerm@@VIloNumVar@@J@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloExpr::IloExpr(class IloEnv,double)" (??0IloExpr@@QAE@VIloEnv@@N@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloNumVarArray::IloNumVarArray(class IloEnv,long,double,double,enum IloNumVar::Type)" (??0IloNumVarArray@@QAE@VIloEnv@@JNNW4Type@IloNumVar@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloModel::IloModel(class IloEnv,char const *)" (??0IloModel@@QAE@VIloEnv@@PBD@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloArrayI::IloArrayI(class IloEnvI *,long,long)" (??0IloArrayI@@QAE@PAVIloEnvI@@JJ@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnv::IloEnv(void)" (??0IloEnv@@QAE@XZ)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnvI::~IloEnvI(void)" (??1IloEnvI@@QAE@XZ)
    dual.obj : error LNK2001: unresolved external symbol "public: struct IloFixedSizeAllocatorI::Cell * __thiscall IloFixedSizeAllocatorI::allocateBlock(class IloMemory *)" (?allocateBlock@IloFixedSizeAllocatorI@@QAEPAUCell@1@PAVIloMemory@@@Z)
    dual.obj : error LNK2001: unresolved external symbol "private: long __thiscall IloMemory::getIndex(long)const " (?getIndex@IloMemory@@ABEJJ@Z)
    dual.obj : error LNK2001: unresolved external symbol "private: void __thiscall IloArrayI::grow(long)" (?grow@IloArrayI@@AAEXJ@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: void __thiscall IloArrayI::clear(void)" (?clear@IloArrayI@@QAEXXZ)
    dual.obj : error LNK2001: unresolved external symbol "public: __thiscall IloObjectiveI::IloObjectiveI(class IloEnvI *,class IloNumExprI *,enum IloObjective::Sense,char const *)" (??0IloObjectiveI@@QAE@PAVIloEnvI@@PAVIloNumExprI@@W4Sense@IloObjective
    @@PBD@Z)
    dual.obj : error LNK2001: unresolved external symbol "public: void __thiscall IloCplexI::exportModel(char const *)" (?exportModel@IloCplexI@@QAEXPBD@Z)
    Debug/dual.exe : fatal error LNK1120: 31 unresolved externals
    Error executing link.exe.

    dual.exe - 32 error(s), 0 warning(s)
    The following environment variables were not found
    $(SOFTDIR)
    $(ILOG)
    $(CPLEX)[/color]
    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: compilation errors

    Posted Tue October 13, 2009 09:54 PM

    Originally posted by: SystemAdmin


    [Abrahamlinkon said:]

    When compiling your program using Jurtle, the compiler may find one or more mistakes in your program.  When this happens,

      1. the compilation halts
      2. the Errors tab is displayed with the appropriate error messages written out
      3. the compiled output (the .class file) is not created. 


    After reading the error messages, you can double-click on an error and Jurtle will switch back to the Edit tab with the offending line highlighted.

    The compiler may find two types of errors: syntax errors and semantic errors

    Syntax Errors

    If you make a typing mistake while entering or editing your program, the compiler may print out a syntax error.  This happens when something you typed doesn't conform to the rules of the Java language.  For example, the language specifies that each statement in Java must be terminated by a semicolon.  If in Lesson 2 we forgot the semicolon on the statement that prints "Hello World!", we might see the following error message when compiling:

    HelloWorld.java:13: ';' expected
            Console.println("Hello world")
                                          ^
    1 error

    This error states that the problem was found on line 13 and that a ';' was expected but not found.

    Another common syntax error is misspelling the name of a variable or method.  For example, if you wrote printline rather than  println in the above code, you would see the following upon compiling:

    HelloWorld.java:13: cannot resolve symbol
    symbol  : method printline  (java.lang.String)
    location: class com.otherwise.jurtle.Console
            Console.printline("Hello world");
                  ^
    1 error

    An error message saying it couldn't resolve a symbol usually means that you misspelled or misremembered a variable name, method name, or a keyword.

    Semantic Errors

    Even though your program may be syntactically correct, the compiler may discover a semantic error (i.e., an error in usage).  One example would be if your program tried to use a variable that has never had an initial value set.  For example, if you had the following code snippet:

    public void runTurtle()
    {
        int j;
        Console.println(j);
    }

    The compiler would complain:

    Test.java:12: variable j might not have been initialized
            Console.println(j);
                            ^
    1 error

    Cascading Errors

    Cascading errors are not a distinct category of errors like syntax and semantic errors.  Nevertheless, this is a situation worthy of some discussion.  Sometimes one error in your program will result in an ambiguity that the compiler cannot resolve.  This may result in several other error messages on the same line or later lines that may not represent true errors in the code.

    For example, in the ASimpleSquare example file there is a for loop.  If the keyword for is accidentally mistyped as in:

            fo ( int i = 0; i < 4; i++ )<br />        {
                forward( 60 );
                right( 90 );
            }

    The compiler will generate something like:

    ASimpleSquare.java:24: '.class' expected
            fo ( int i = 0; i < 4; i++ )<br />                ^
    ASimpleSquare.java:24: ')' expected
            fo ( int i = 0; i < 4; i++ )<br />                      ^
    ASimpleSquare.java:24: not a statement
            fo ( int i = 0; i < 4; i++ )<br />                          ^
    ASimpleSquare.java:24: ';' expected
            fo ( int i = 0; i < 4; i++ )<br />                                  ^
    ASimpleSquare.java:24: unexpected type
    required: value
    found  : class
            fo ( int i = 0; i < 4; i++ )<br />            ^
    ASimpleSquare.java:24: cannot resolve symbol
    symbol  : variable i
    location: class ASimpleSquare
            fo ( int i = 0; i < 4; i++ )<br />                              ^
    6 errors

    Notice that the compiler did not even print an error saying the for keyword was in error.  In this case there was an ambiguity as to what the programmer was trying to do and it resulted in the 6 error messages.  When this happens it is best to start with the first error message and figure out what generated it.  In the above example, the first error message is somewhat nonsensical so you need to look earlier in the code to manually spot the problem.

    When compiling  a class for the first time it is common to get a number of compilation errors.  Some of these will be legitimate and some are simply cascading errors.  It is always best to start with the first error message and correct that problem.  If subsequent error messages do not make sense, recompile to see if fixing the first error eliminated later ones.

    "[url=http://kerjakeras.com/mengembalikan-jati-diri-bangsa/]Mengembalikan Jati Diri Bangsa [/url]
    [url=http://kerjakeras.com/kenali-dan-kunjungi-objek-wisata-di-pandeglang/] Kenali Dan Kunjungi Objek Wisata Di Pandeglang [/url]
    "

    #ConstraintProgramming-General
    #DecisionOptimization