Build Error from Visual Studio Code. **ERROR: The -f command line option is incompatible with the options -x, -m, -z, and source files.**

Hello everyone, I am new to the Garmin developer world. I would like to start with watch faces, but unfortunately, I am struggling with the Monkey C extension.

Whenever I take the simple example from the project start and try to compile or build the project file to start the watch simulation, I get the following error:
**ERROR: The -f command line option is incompatible with the options -x, -m, -z, and source files.**

I have already spent many hours with ChatGPT trying to fix this error, but without success. Can anyone help me with a working solution?
Did I miss something?

Here is my process:
1. Installed Visual Studio Code.
2. Installed the Connect IQ Monkey C extension.
3. Installed and integrated the SDK.
4. Created a project without any custom code.
5. Tried to build and simulate the simple example = error.

Thank you for your help.

  • I'm quite sure I've been there lately aswell.

    Can you provide the full output of the terminal?
    Looks like this:

    java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /home/$USER/.Garmin/ConnectIQ/Sdks/connectiq-sdk-lin-7.4.3-2024-12-11-90ec25e45/bin/monkeybrains.jar ....

    Are you on Windows/mac/Linux?

  • Im on Windows11.

    The full output is:

    C:\Program Files\Java\jre1.8.0_441\bin\java.exe -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar c:\Users\winUser\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-8.0.0_Beta-2025-01-07-276916717\bin\monkeybrains.jar -o bin\helloWorld.prg -f c:\Users\winUser\.vscode\WorkspaceVSC\helloWorld\monkey.jungle -y c:\Users\winUser\.vscode\developer_key -d fenix7pronowifi_sim -w C:\Users\winUser\AppData\Roaming\Garmin\ConnectIQ\

    i get this data when i copy the error at “problems:

    [{
    "resource": "/The -f command line option is incompatible with the options -x, -m, -z, and source files. Use command line option",
    "owner": "monkeyc",
    "severity": 8,
    "message": "-f",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 1,
    "endColumn": 9007199254740111
    }]

  • "C:\Users\winUser\AppData\Roaming\Garmin\ConnectIQ\"

    This part of the command line looks like the culprit. Have you added any custom compiler option via the VS Code Monkey Extension settings?

    Can you:

    - Open the command palette: CTRL-SHIFT-P

    - Open "Preference: Open User Settings"

    - Search for "Monkey C"

    - Take a screenshot of the settings

    Also, you are using the 8.0.0 Beta (which is unsurprising, since the SDK manager will download the latest SDK and ask you if you want to use it). However, in general you should be using the latest production SDK (7.4.3), because the beta is only for testing and won't allow you to export an app to be uploaded to the CIQ store. (This particular beta is also known to have bugs.)

  • Hi
    I have not added or changed anything, it is standard in my system after setup.
    I get the same error message when I use previous sdk. I have now changed to the final sdk.

    C:\Program Files\Java\jre1.8.0_441\bin\java.exe -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar c:\Users\winUser\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-7.4.3-2024-12-11-90ec25e45\bin\monkeybrains.jar -o bin\hello_world.prg -f c:\Users\winUser\.vscode\WorkspaceVSC\hello_world\monkey.jungle -y c:\Users\winUser\.vscode\developer_key -d fenix7pro_sim -w C:\Users\winUser\AppData\Roaming\Garmin\ConnectIQ\

    ---------------------------------------

    Here the settings:

  • I have not added or changed anything, it is standard in my system after setup.

    Regardless, the compiler option that is causing the issue is right in the top setting of the first screenshot, labelled Monkey C: Compiler Options:

    C:\Users\winUser\AppData\Roaming\Garmin\ConnectIQ\

    If you clear the Compiler Options setting, your build should start to work.

    It might be a bug if that setting was somehow automatically filled in for you after you installed everything. If that’s the case, you might want to report that in the Connect IQ Bug Reports forum.

    It does look like you changed *some* options (possibly due to following Garmin’s instructions). For example, it looks like you at least changed the following options:

    - developer key path (ofc this option has to be set for the build to work at all)

    - java path

  • As I said, these are the settings from the initial setup and yes i followed a guide :).

    I have the same behavior on my second Pc with Win10.
    Thanks to everyone for the quick help. Now it works and I can get started.

  • I have the same behavior on my second Pc with Win10.

    Def sounds like a bug and might be worth reporting. This kind of thing seems like it could be easily missed since it only affects new devs / new installs.

  • yes i followed a guide :)

    Sorry for the dumb question, but to be clear, the guide doesn’t suggest changing “Monkey C: Compiler Options”, does it?

    Is the guide from Garmin? Do you have a link to it?

    I only ask bc I uninstalled the Monkey C extension, deleted any existing settings manually (from “User Preferences (JSON)”), reinstalled the extension, and Monkey C: Compiler Options was not populated. I also used “Verify Installation”, and the compiler options still weren’t populated.

    I also don’t see anywhere in the official Garmin docs asking the dev to set the Java path (my installation works fine without the java path set in Monkey C options), which is why I think the guide you used may not be from Garmin. (I could be wrong tho).

    So I’m just wondering if the guide you used has an incorrect step which caused this problem?

    If not, then there’s a bug, and if you can reliably reproduce it, I think it would be worth reporting.