• undefined reference to `cout' vxworks 6.9 workbench 3.3

    From jmollo@gmail.com@21:1/5 to All on Wed Jul 10 00:11:15 2019
    Hey Folks,

    I just ran into this error and I am stumped. This error did not exist a week ago and suddenly it now happens with no changes at all.

    I've simplified an example that recreates it.
    1) Create RTP project under workbench 3.3.
    2) Use PENTIUM4GNU_RTP
    3) Add single file bootstrap.cpp with the following code:
    #include <iostream>

    int main ( int argc, char * argv[] )
    {
    std::cout << "hello world.\n";
    return 0;
    }
    Upon compilation, I get the following output:
    Build Started in Project 'teststdlib': 2019-07-09 23:57:17
    Generation of makefiles started.
    Generation of makefiles finished (Elapsed Time: 00:00).
    Platform: Wind River VxWorks 6.9
    Command: make --no-print-directory BUILD_SPEC=PENTIUM4gnu_RTP DEBUG_MODE=1 TRACE=1 clean all JOBS=6
    Working Directory: C:/WindRiver/workspace/teststdlib/PENTIUM4gnu_RTP
    rm -rf C:/WindRiver/workspace/teststdlib/.coveragescope/db
    make: removing targets and objects of C:/WindRiver/workspace/teststdlib/PENTIUM4gnu_RTP
    if [ -d "teststdlib" ]; then cd "teststdlib"; rm -rf Debug; fi
    if [ ! -d "`dirname "teststdlib/Debug/Objects/teststdlib/bootstrap.o"`" ]; then mkdir -p "`dirname "teststdlib/Debug/Objects/teststdlib/bootstrap.o"`"; fi;echo "building teststdlib/Debug/Objects/teststdlib/bootstrap.o"; c++pentium -g -mtune=pentium4 -
    march=pentium4 -ansi -mrtp -fno-strict-aliasing -D_C99 -D_HAS_C9X -Wall -MD -MP -D_VX_CPU=_VX_PENTIUM4 -D_VX_TOOL_FAMILY=gnu -D_VX_TOOL=gnu -IC:/WindRiver/vxworks-6.9/target/usr/h -IC:/WindRiver/vxworks-6.9/target/usr/h/wrn/coreip -o "
    teststdlib/Debug/Objects/teststdlib/bootstrap.o" -c "C:/WindRiver/workspace/teststdlib/bootstrap.cpp"
    building teststdlib/Debug/Objects/teststdlib/bootstrap.o
    if [ ! -d "`dirname "teststdlib/Debug/teststdlib.vxe"`" ]; then mkdir -p "`dirname "teststdlib/Debug/teststdlib.vxe"`"; fi;echo "building teststdlib/Debug/teststdlib.vxe"; c++pentium -mtune=pentium4 -march=pentium4 -mrtp -fno-strict-aliasing -D_C99 -D_
    HAS_C9X -std=c99 -fasm -Wall -MD -MP -mrtp -o "teststdlib/Debug/teststdlib.vxe" teststdlib/Debug/Objects/teststdlib/bootstrap.o -lstdc++ -LC:/WindRiver/vxworks-6.9/target/lib/usr/lib/pentium/PENTIUM4/common -Wl,--start-group -Wl,--end-group &&
    if [ "0" = "1" ]; then mv -f "teststdlib/Debug/teststdlib.vxe" "teststdlib/Debug/teststdlib.vxe.unstripped" && strippentium -g -o "teststdlib/Debug/teststdlib.vxe" "teststdlib/Debug/teststdlib.vxe.unstripped";fi && if [ "0" = "1" ]; then plink "
    teststdlib/Debug/teststdlib.vxe";fi
    building teststdlib/Debug/teststdlib.vxe teststdlib/Debug/Objects/teststdlib/bootstrap.o: In function `main': C:/WindRiver/workspace/teststdlib/bootstrap.cpp:5: undefined reference to `cout'
    collect2: ld returned 1 exit status
    make.exe[1]: *** [teststdlib/Debug/teststdlib.vxe] Error 1 C:\WindRiver\utilities-1.0\x86-win32\bin\make.exe: *** [main_all] Error 2
    Build Failed in Project 'teststdlib' (Process Exit Value was 2): 2019-07-09 23:57:28 (Elapsed Time: 00:10)


    This issued just started happening on a much larger baseline and not even sure where to begin.

    I've tried multiple changes to linker and compiler options with no effect.

    Any help would be appreciated.

    Regards,

    JB

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jmollo@gmail.com@21:1/5 to All on Wed Jul 10 03:04:07 2019
    I've figured out that removing the -mrtp option for the linker removes this issue. Albeit, that would then seem like I could no longer run things as an RTP.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jmollo@gmail.com@21:1/5 to jmo...@gmail.com on Wed Jul 10 16:20:03 2019
    On Wednesday, July 10, 2019 at 3:04:08 AM UTC-7, jmo...@gmail.com wrote:
    I've figured out that removing the -mrtp option for the linker removes this issue. Albeit, that would then seem like I could no longer run things as an RTP.

    Yeah, definately need the flag as it will not longer run. Any help on this issue would be appreciated. At this point, I am thinking that the development environment has been corrupted in some manner.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)