Search code examples
eclipse-cdtomnet++

Automatically build OMNeT++ project from command line


I have an OMNeT++ project that builds just fine when I press the "Build" button in IDE:

enter image description here

However, the build fails if I try the same make MODE=release all from a bash terminal: enter image description here

I've been trying to figure out why this happens for a long time, but still have no clue. I'm doing experiments that change a variable inside a source file 1000 times, so I cannot manually change the file and click on the button every time. Is there a way to do this automatically?

In case you need to know, my build configurations on the IDE look like this: enter image description here enter image description here enter image description here

Thanks.


Solution

  • The problem was my PATH was searching for compilers in an previous installation of OMNeT++:

    gabriel@localhost:~$ echo $PATH
    /home/gabriel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/opt/omnetpp-5.7/bin
    

    while I the IDE looked for compilers at /opt/omnetpp-6.0/bin: enter image description here

    Setting PATH to the correct version solved the problem.