i new c programming. i'm running cplex library in c++ code using visual studio 2010. i'm getting access violations when performing actions.
the violation reported in function void __cdecl _unlock defined in crt file mlock.c. specific row leavecriticalsection( _locktable[locknum].lock );.
the error message unhandled exception @ 0x0f63443b: 0xc0000005: access violation writing location 0xeb43c7c4. interpretation is memory related problem not sure. also, not know how trace memory block 0xeb43c7c4 in code.
below call stack:
cplex124.dll!0fdd443b() [frames below may incorrect and/or missing, no symbols loaded cplex124.dll] cplex124.dll!0fdd3bbb() cplex124.dll!0fcd0610() cplex124.dll!0fccfbfd() cplex124.dll!0feb70fd() cplex124.dll!0fede883() > name.exe!_unlock(int locknum) line 375 c name.exe!_unlock_file2(int i, void * s) line 356 + 0x9 bytes c name.exe!printf(const char * format, ...) line 68 + 0x10 bytes c name.exe!main(int argc, char * * argv) line 620 + 0xe bytes c++ name.exe!__tmaincrtstartup() line 278 + 0x12 bytes c kernel32.dll!7693ed6c() ntdll.dll!7701377b() ntdll.dll!7701374e()
the source _unlock comes in mlock.c file as:
void __cdecl _unlock ( int locknum ) { /* * leave critical section. */ leavecriticalsection( _locktable[locknum].lock ); } #ifdef _m_ix86 #pragma optimize("y",on) #endif /* _m_ix86 */
and source printf in file printf.c as:
int __cdecl printf ( const char *format, ... ) /* * stdout 'print', 'f'ormatted */ { va_list arglist; int buffing; int retval; _validate_return( (format != null), einval, -1); va_start(arglist, format); _lock_str2(1, stdout); __try { buffing = _stbuf(stdout); retval = _output_l(stdout,format,null,arglist); _ftbuf(buffing, stdout); } __finally { _unlock_str2(1, stdout); } return(retval); }
if remove links concert files in project property, same error message in file tidtable.c, in _crtimp pfls_getvalue_function __cdecl __set_flsgetvalue() on line: pfls_getvalue_function flsgetvalue = fls_getvalue;
i appreciate advice.
thanks.
cplex commercial solver library. release several different versions of dll mention line various build types.
also, libraries of type give bit of flexibility in preprocessor definitions can define. see cplex documentation details. mismatched defines can cause errors this, can using runtime not support multi threading library does.
i suggest looking @ glpk, gnu linear programming kit open source alternative if cplex proves problematic.
Comments
Post a Comment