This page provides information on problems that might occur when trying to run / compile MIDACO.

For general questions, see the FAQ page.



MIDACO returns some IFLAG Error Message ?

See here for a detailed list of IFLAG-Messages.

Can't open MIDACO_SOLUTION.TXT file during runtime ?

Windows user may experience the problem that the text output files MIDACO_SCREEN.TXT, MIDACO_SOLUTION.TXT or MIDACO_HISTORY.TXT are blocked from access (by Windows file management) during MIDACO runtime. A simple workaround is to create a copy of those files and open the copy instead.

Problem with displaying 'MIDACO_SCREEN.TXT' and 'MIDACO_SOLUTION.TXT'

In some cases (e.g. Matlab-Windows), the files 'MIDACO_SCREEN.TXT' and 'MIDACO_SOLUTION.TXT' are not displayed correctly with a simple editor (e.g. Notepad). Open the txt-files with another editor (e.g. Notepad++ or the Matlab Editor) to avoid this problem.


General Error:  Segmentation fault (core dumped)


This problem can likely be fixed by increasing the stack size. In Linux this can be done by the command:


ulimit -s unlimited


This problem may occur, if the array size of RW or PF is too large or if the the problem dimension is very large (in esp. large-scale problems). This problem may also occur when executing MIDACO in parallel (e.g. openMP and MPI).


Matlab Error:   No C/C++ compiler found for MEX 

In some cases (in esp. Windows 64bit), Matlab does not provide a default C/C++ MEX compiler. In such case, the compiler must be installed manually by the user. One possible solution is to use the following free C/C++ compiler (64bit) distributed by Microsoft:

Microsoft Visual C++ 2010 Redistributable Package (x64)

Download and install above package. Then reboot your computer and start a fresh Matlab session. The type "mex -setup" in the command window. If above installation of the C/C++ compiler was successful, Matlab will automatically recognize the compiler and give the user some compiler option menu to choose from. Note that any supported mex compiler that is supported by Matlab can be used with MIDACO. Further reading: Matlab Search: mex compiler

Matlab Error:   ??? Undefined function or method 'midaco'...

To avoid this error, download "midaco.m" and include it in the Matlab path.

Matlab Error:   ??? Undefined function or method 'midacox'...

This error means, that Matlab did not found the MIDACO mex file. To avoid this error, download the C/C++ source code file "midacox.c" and generate the mex file from it (include the file in the Matlab path and type "mex midacox.c" and press Enter). Then make sure, that the generated mex file (e.g. "midacox.dll", "midacox.mexw32" or "midacox.mexglx") is included in the Matlab path.

C/C++ Error:   undefined reference to 'sqrt' 

This error (along with 'undefined reference to 'pow' and 'undefined reference to 'floor') occurs when compiling with gcc and the math library was not linked to the objectives. To solve this problem, add the flag "-lm" at the very end of the linkage command. For example: gcc -o example.o midaco.o -lm 

C/C++ Error:   'x' was not declared in this scope 

This error (along with 'expected ',' or ';' before 'doublereal' and 'expected unqualified-id before '{' token') occurs when trying to compile 'midaco.c' with g++. The 'midaco.c' file does not compile with g++. However, all MIDACO example files can be compiled with g++ (see this Makefile). Compiling 'midaco.c' with gcc (or another c-compiler) fixes this issue. 

Note that this error may also occurs, when compiling 'midaco.c' in MS Visual Studio with pre-compiled headers.

C/C++ Error:   LNK2019 (MS Visual Studio)

In case the following error appears when building a MS Visual Studio solution:

LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup


it can be easily fixed by changing VS: Properties -> Linker -> System -> SubSystem from Windows to Console


(/SUBSYSTEM:WINDOWS)   >>>---change---to--->>>    (/SUBSYSTEM:CONSOLE)


C/C++ Error:   fopen (MS Visual Studio)

Some MS Visual Studio versions treat the  fopen  command as error and expect  fopen_s instead. A small modification in the  midaco.c   source code is then required to compile MIDACO in MS Visual Studio. In the   midaco.c   file,   change the   fopen   command to   fopen_s  by commenting out line 5002 and enabling line 5003 instead. The result should look like following:


Makefile Error:   *** No targets specified and no makefile found 

When downloading the 'Makefile', most web-browsers automatically add the extension ".txt" to the Makefile. Renaming "Makefile.txt" to "Makefile" on your system should solve this problem.

Python Error:   OSError: Permission denied

When running Python under Cygwin, the pre-compiled MIDACO library "" might produce this error. Manually creating the MIDACO library from its source "midacopy.c" fixes this issue. Please contact us for instruction on how to manually create the library file.

Python Error:   ValueError: Can only assign sequence of same size

This error occurs, when the problem dimension declaration of the number of objectives does not agree with the return argument dimension of array containing the objectives in the problem_function subroutine. To fix this error, ensure that the number of objectives (and constraints) is set correctly in both: the main file and the problem function subroutine. (Note that for unconstrained problems, the "g" array is a dummy argument of size one)


Octave Error:   'matlabpool' undefined

MIDACO uses the 'parfor' approach for parallelization under Matlab. This feature is unfortunately currently not (yet) available in Octave.


Fortran Error:   Compiling with Silverfrost FTN95 

When compiling MIDACO with Silverfrost FTN95 some minor modifications regarding the printing must be done  to the "midaco.f" file. This is commenting or deleting the "FLUSH( IOUT )" command at the very bottom of the "midaco.f" file and changing all screen printing units from 0 to 5.

For example, change:




Fortran Error:   Unknown IFLAG values

Fortran can be nasty. If multi-objective problems are solved and the pre-allocated array size of F() is too small, you might receive unknown IFLAG values or other strange reports. To fix those issues, ensure that all pre-allocated arrays are sufficiently large.


If you experience any problem, that is not listed here, please contact us.