【问题标题】:vxWorks c++ Demangling ErrorvxWorks c++ 拆解错误
【发布时间】:2018-03-07 15:50:33
【问题描述】:

我正在尝试编译一个简单的 c++ 可下载对象模块以在 vxWorks 6.8 上运行。我正在遵循here 的指示。我遇到了一个错误,希望有人能对这个问题有所了解。提前谢谢

    #include <vxworks.h>
    #include <stdio.h>

    int helloworld()
    {
        printf("Hello World!!!");
        return 0;
    }

我按照上述链接中的说明运行以下构建命令

1。编译

C:/WindRiver/gnu/4.1.2-vxworks-6.8/x86-win32/bin/ccpentium.exe -o tester.o -march=pentium -fno-builtin -DINCLUDE_CPLUS -DINCLUDE_CPLUS_LANG -DINCLUDE_CPLUS_DEMANGLER -DINCLUDE_CPLUS_IOSTREAMS -DTOOL =gnu -DCPU=PENTIUM -D_VSB_CONFIG_FILE=\"C:/WindRiver/vxworks-6.8/target/lib/h/config/vsbConfig.h\" -I. -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/make/rules.library -I$(WIND_BASE)/target/h/wrn/coreip -c tester.cpp

2。运行咀嚼

C:\WindRiver\utilities-1.0\x86-win32\bin\nmpentium.exe tester.o | wtxtcl C:\WindRiver\vxworks-6.8\host\resource\hutils\tcl\munch.tcl -c pentium > ctdt.c

3。编译munch生成的ctdt.c文件

C:/WindRiver/gnu/4.1.2-vxworks-6.8/x86-win32/bin/ccpentium.exe -march=pentium -fdollars-in-identifiers -O2 -fno-builtin -I"C:\WindRiver \vxworks-6.8\target\h" -DINCLUDE_CPLUS -DINCLUDE_CPLUS_LANG -DINCLUDE_CPLUS_DEMANGLER -DINCLUDE_CPLUS_IOSTREAMS -DCPU=PENTIUM -DTOOL_FAMILY=gnu -DTOOL=gnu -c ctdt.c

错误

但是,每当编译 ctdt.c 时,我都会收到以下错误:

ctdt.c: In function '_STI__15_ctors':  
ctdt.c:20: error: stray '\10' in program  
ctdt.c:20: error: flexible array member in otherwise empty struct

引发错误的代码 ctdt.c 行如下所示。请注意,我必须将其作为图像包含在内,因为代码中有一个奇怪的字符,我不知道如何在此处显示

code throwing error

我认为这个错误与 printf 语句中的 " 有关。注释掉 printf 语句一切都会编译文件

【问题讨论】:

  • 请将您的解决方案发布为答案并接受。这会将问题标记为已解决。

标签: vxworks


【解决方案1】:

我解决了这个问题。上面的munch步骤不正确,应该是:C:\WindRiver\utilities-1.0\x86-win32\bin\nmpentium.exe tester.o | tclsh C:\WindRiver\vxworks-6.8\host\resource\hutils\tcl\munch.tcl -c pentium > ctdt.c

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多