Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



A problem using cplex with visual c++ 2008

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 31-05-2011
Member
 
Join Date: May 2011
Posts: 1
A problem using cplex with visual c++ 2008
  

Hi everyone!

thanks for your time reading this, I'm a total noob in cplex, actually I start a manual, but I can't even start the "hello world"...

I'm using visual c++ 2008 express with CPLEX studio preview 12.2

the code is:
#include <ilcplex/ilocplex.h>
ILOSTLBEGIN
int main(int, char**) {
IloEnv env;
try {
env.out() << "Hola Mundo" << endl;
}
catch (IloException& ex) {
cerr << "Error: " << ex << endl;
}
catch (...) {
cerr << "Error" << endl;
}
env.end();
return 0;
}

The build log is:
Build Log


Build started: Project: ilogproyecto, Configuration: Release|Win32

Command Lines


Creating temporary file "c:\Users\OWNER\Documents\Visual Studio 2008\Projects\ilogproyecto\ilogproyecto\Release\RSP00000253363568.rsp" with contents
[
/OUT:"C:\Users\OWNER\Documents\Visual Studio 2008\Projects\ilogproyecto\Release\ilogproyecto.exe" /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"Release\ilogproyecto.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\OWNER\Documents\Visual Studio 2008\Projects\ilogproyecto\Release\ilogproyecto.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86 C:\ILOG\CPLEX_Studio_Preview122\cplex\lib\x64_windows_vs2008\stat_mda\cplex122.lib C:\ILOG\CPLEX_Studio_Preview122\cplex\lib\x64_windows_vs2008\stat_mda\ilocplex.lib C:\ILOG\CPLEX_Studio_Preview122\concert\lib\x64_windows_vs2008\stat_mda\concert.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

".\Release\archivoc++.obj"
]
Creating command line "link.exe @"c:\Users\OWNER\Documents\Visual Studio 2008\Projects\ilogproyecto\ilogproyecto\Release\RSP00000253363568.rsp" /NOLOGO /ERRORREPORTROMPT"

Output Window


Linking...
archivoc++.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnvI::~IloEnvI(void)" (??1IloEnvI@@QAE@XZ)
archivoc++.obj : error LNK2001: unresolved external symbol "public: __thiscall IloEnv::IloEnv(void)" (??0IloEnv@@QAE@XZ)
C:\Users\OWNER\Documents\Visual Studio 2008\Projects\ilogproyecto\Release\ilogproyecto.exe : fatal error LNK1120: 2 unresolved externals

Results


Build log was saved at "file://c:\Users\OWNER\Documents\Visual Studio 2008\Projects\ilogproyecto\ilogproyecto\Release\BuildLog.htm"
ilogproyecto - 3 error(s), 0 warning(s)



THANKS PEOPLE

Reply With Quote
  #2  
Old 31-05-2011
Member
 
Join Date: Jan 2006
Posts: 605
Re: A problem using cplex with visual c++ 2008

I think that you must use Cplex.out() in the par:
if (cplex.solve()) {
cplex.out()<< " Optimal Value = " << cplex.getObjValue() << endl;
}
and.. you mast call IloCplex cplex(mod);
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "A problem using cplex with visual c++ 2008"
Thread Thread Starter Forum Replies Last Post
help on visual basic 2008 gladys_ny Software Development 1 18-03-2011 04:25 AM
Visual Studio 2010: features and changes compared to Visual Studio 2008 BinDs14 Guides & Tutorials 2 16-02-2011 02:49 PM
Difference between Visual studio 2005 and Visual studio 2008 RohanS Software Development 3 12-06-2009 10:48 AM
C++ with Visual C++ 2008 avvia Software Development 3 27-02-2009 02:21 PM
What is Visual Studio 2008 Jackie Software Development 1 23-12-2008 05:31 PM


All times are GMT +5.5. The time now is 10:50 AM.