Menu

Why syntax error?

2025-07-09
2025-07-10
  • Taavi Remmelg

    Taavi Remmelg - 2025-07-09

    Hello,
    how to fix this error? Syntax seems correct, code compiles ok with Borland compiler.

    cpptest/ALLIKAS.c:33:1: error: Unmatched '{'. Configuration: 'HARBOUR_STRICT_ANSI_C;HB_MSC_STARTUP;HB_OS_WIN_64;HB_PRAGMA_STARTUP;HB_STATIC_STARTUP;_MSC_VER;LCC;POCC;XCC;RPCNDR_H_VERSION'. [syntaxError]

    Taavi

     
  • CHR

    CHR - 2025-07-09

    I get this instead:

    ALLIKAS.c:54:1: error: There is an unknown macro here somewhere. Configuration is required. If HB_INIT_SYMBOLS_EX_END is a macro then please configure it. [unknownMacro]
    HB_INIT_SYMBOLS_EX_END( hb_vm_SymbolInit_ALLIKAS, __PRG_SOURCE__,  0x000a )
    ^
    

    Maybe looking at the preprocessed output (-E) can help with identifying the issue.

     
  • Taavi Remmelg

    Taavi Remmelg - 2025-07-10

    Did You test with GUI or command line?

     
  • Taavi Remmelg

    Taavi Remmelg - 2025-07-10

    I get the same error with command line without any switch.

    GUI project setup file content below. Anything what can cause syntax error here?

    <project version="1">
    <builddir>Taavitestfail-cppcheck-build-dir</builddir>
    <analyze-all-vs-configs>false</analyze-all-vs-configs>
    <check-headers>true</check-headers>
    <check-unused-templates>true</check-unused-templates>
    <inline-suppression>true</inline-suppression>
    <max-ctu-depth>2</max-ctu-depth>
    <max-template-recursion>100</max-template-recursion>
    <includedir>
    </includedir></project>






    <paths>


    <check-level-normal>
    <project-name>Taavitestfail</project-name>
    <options>
    <option>--std=c89</option>
    <option>--suppress=missingIncludeSystem</option>
    <option>-DHB_OS_WIN_64</option>
    <option>-DHARBOUR_STRICT_ANSI_C</option>
    <option>-DFIVEWIN</option>
    </options>

    </check-level-normal>
    </paths>
     
  • Taavi Remmelg

    Taavi Remmelg - 2025-07-10
    Ok, seems there is a problem with compiling switches when processing header files for xharbour preprocessor environment. Will investigate further.
    
     
  • Daniel Marjamäki

    your project file is messed up, this is wrong:

    <paths>
    <check-level-normal>
    <project-name>Taavitestfail</project-name>
    <options>
    <option>--std=c89</option>
    <option>--suppress=missingIncludeSystem</option>
    <option>-DHB_OS_WIN_64</option>
    <option>-DHARBOUR_STRICT_ANSI_C</option>
    <option>-DFIVEWIN</option>
    </options>
    </check-level-normal>
    </paths>
    

    paths is supposed to contain the paths only, no options.

     
  • Taavi Remmelg

    Taavi Remmelg - 2025-07-10

    Latest project file

    <project version="1">
    <builddir>Taavitestfail-cppcheck-build-dir</builddir>
    <analyze-all-vs-configs>false</analyze-all-vs-configs>
    <check-headers>true</check-headers>
    <check-unused-templates>true</check-unused-templates>
    <inline-suppression>true</inline-suppression>
    <max-ctu-depth>2</max-ctu-depth>
    <max-template-recursion>100</max-template-recursion>
    <includedir>
    </includedir></project>






    <paths>


    <check-level-normal>
    <project-name>Taavitestfail</project-name>
    <defines>
    <define name="HARBOUR_STRICT_ANSI_C">
    <define name="HB_OS_WIN_32">
    <define name="HB_PRAGMA_STARTUP">
    <define name="HB_STATIC_STARTUP">
    </define></define></define></define></defines>

    and run command

    "c:\Program files\cppcheck\cppcheck.exe" --project=Taavitestfail.cppcheck --std=c89

    chatgpt suggests that something is wrong with HB_INIT_SYMBOLS_BEGIN expansion but have'nt figured out what is missing.

    https://chatgpt.com/c/686116b1-d958-8010-9f4e-e57a7513fe0c

    </check-level-normal>
    </paths>
     
  • Taavi Remmelg

    Taavi Remmelg - 2025-07-10

    Something is wrong with pasting code. I will attach my project file as attachment

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.