AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system


#Operatingsystems
#Opensource
#AIX
#AIX Open Source
 View Only
  • 1.  g++: Undefined symbol: ._ZNSt18condition_variable10notify_allEv

    Posted Mon March 18, 2024 10:25 PM

    I tried build ugrep https://github.com/Genivia/ugrep  by g++ but I ended up with an error for missing symbols. https://github.com/Genivia/ugrep/issues/374

    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt18condition_variable10notify_allEv
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt18condition_variableD1Ev
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt18condition_variableC1Ev
    ld: 0711-317 ERROR: Undefined symbol: _ZTINSt6thread6_StateE
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt6thread6_StateD2Ev
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt18condition_variable10notify_oneEv
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt6thread4joinEv
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt6thread20hardware_concurrencyEv
    ld: 0711-317 ERROR: Undefined symbol: ._ZNSt11this_thread11__sleep_forENSt6chrono8durationIxSt5ratioILx1ELx1EEEENS1_IxS2_ILx1ELx1000000000EEEE
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    collect2: error: ld returned 8 exit status


    Can anyone here advise me if there is any way to fix this?



    ------------------------------
    Antonin Rozehnal
    ------------------------------


  • 2.  RE: g++: Undefined symbol: ._ZNSt18condition_variable10notify_allEv

    Posted Tue March 19, 2024 02:59 AM

    Hi Antonin,

    These are pthread symbols that are not being found. 

    Can you try with export CXX="g++ -pthread" or export LDFLAGS="-L/opt/freeware/lib/pthread/ppc64" and then try?? 

    Also, I am curious to know if you want this package from Toolbox.



    ------------------------------
    Aditya Kamath
    ------------------------------



  • 3.  RE: g++: Undefined symbol: ._ZNSt18condition_variable10notify_allEv

    Posted Tue March 19, 2024 04:04 AM
    Hi Aditya,
    I didn't need to install anything else from Toolbox. I already had this installed::
     ls -l /opt/freeware/lib/pthread/ppc64
    total 0
    drwxr-xr-x    3 root     system          256 21 kvě 2023  go
    lrwxrwxrwx    1 root     system           61 21 kvě 2023  libatomic.a -> ../../gcc/powerpc-ibm-aix7.2.0.0/10/pthread/ppc64/libatomic.a
    lrwxrwxrwx    1 root     system           60 21 kvě 2023  libgcc_s.a -> ../../gcc/powerpc-ibm-aix7.2.0.0/10/pthread/ppc64/libgcc_s.a
    lrwxrwxrwx    1 root     system           59 21 kvě 2023  libgomp.a -> ../../gcc/powerpc-ibm-aix7.2.0.0/10/pthread/ppc64/libgomp.a
    lrwxrwxrwx    1 root     system           61 21 kvě 2023  libstdc++.a -> ../../gcc/powerpc-ibm-aix7.2.0.0/10/pthread/ppc64/libstdc++.a
     
     I just added -> export CXX="g++ -pthread"
    Thank you so much for your help.  :-)


    ------------------------------
    Antonin Rozehnal
    ------------------------------



  • 4.  RE: g++: Undefined symbol: ._ZNSt18condition_variable10notify_allEv

    Posted Thu March 21, 2024 06:47 AM

    Build with dynamic libraries works fine, but I would like to ask if it is possible to link all the necessary libraries statically?
    When I added the '-static', a lot of the Undefined symbol was listed

    <pre>

    # g++ -std=gnu++11  -pthread  -Wall -Wextra -Wunused -O2 -static  -o ugrep ugrep-ugrep.o ugrep-cnf.o ugrep-glob.o ugrep-output.o ugrep-query.o ugrep-screen.o ugrep-stats.o ugrep-vkey.o ugrep-zopen.o  ../lib/libreflex.a
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    ld: 0711-317 ERROR: Undefined symbol: __loadx
    ld: 0711-317 ERROR: Undefined symbol: _errno
    ld: 0711-317 ERROR: Undefined symbol: _system_configuration
    ld: 0711-317 ERROR: Undefined symbol: read_sysconfig
    ld: 0711-317 ERROR: Undefined symbol: errno
    ld: 0711-317 ERROR: Undefined symbol: _pks_state
    ld: 0711-317 ERROR: Undefined symbol: __ksetjmp
    ld: 0711-317 ERROR: Undefined symbol: sigprocmask
    ld: 0711-317 ERROR: Undefined symbol: .ukeyset_activate
    ld: 0711-317 ERROR: Undefined symbol: sigcleanup
    ld: 0711-317 ERROR: Undefined symbol: environ
    ld: 0711-317 ERROR: Undefined symbol: .___memmove
    ld: 0711-317 ERROR: Undefined symbol: sbrk
    ld: 0711-317 ERROR: Undefined symbol: .___strlen
    ld: 0711-317 ERROR: Undefined symbol: getuidx
    ld: 0711-317 ERROR: Undefined symbol: getgidx
    ld: 0711-317 ERROR: Undefined symbol: .___memset
    ld: 0711-317 ERROR: Undefined symbol: __unload
    ld: 0711-317 ERROR: Undefined symbol: incinterval

    ...

    </pre>



    ------------------------------
    Antonin Rozehnal
    ------------------------------



  • 5.  RE: g++: Undefined symbol: ._ZNSt18condition_variable10notify_allEv

    Posted Wed March 27, 2024 05:39 AM

    "-static" flag will apply to libc level ( means it will avoid to link to libc as well). What is the goal here ? 



    ------------------------------
    Ayappan P
    ------------------------------