Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. error: undefined symbol ... during make
Forum Updated to NodeBB v4.3 + New Features

error: undefined symbol ... during make

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
23 Posts 4 Posters 5.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    You've cut the crucial bit of information out - does it fail during compilation or linking stage? From this output my guess is that during linking. It can be caused by many things:

    • listed symbols are missing from library they come from
    • linked library is not included properly
    • symbols are declared in header but have no implementation (they are not present in library's .cpp file)

    (Z(:^

    1 Reply Last reply
    2
    • E Offline
      E Offline
      elbnacht
      wrote on last edited by
      #3

      I hope, this is the missing part :-)

      a37b78f2-24dd-479a-82b5-56b6649582dd-grafik.png

      This is the header of the .ccp:

      36b487b3-c949-4cdf-9bd9-8b1e2b417141-grafik.png

      and used here:

      5b3460a3-17c9-4cdd-916a-402bb33d936a-grafik.png

      Any more idea?

      jsulmJ 2 Replies Last reply
      0
      • E elbnacht

        I hope, this is the missing part :-)

        a37b78f2-24dd-479a-82b5-56b6649582dd-grafik.png

        This is the header of the .ccp:

        36b487b3-c949-4cdf-9bd9-8b1e2b417141-grafik.png

        and used here:

        5b3460a3-17c9-4cdd-916a-402bb33d936a-grafik.png

        Any more idea?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @elbnacht Just a tipp: post text instead of screen-shots. This way you allow to use the text to make changes to suggest you.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • E elbnacht

          I hope, this is the missing part :-)

          a37b78f2-24dd-479a-82b5-56b6649582dd-grafik.png

          This is the header of the .ccp:

          36b487b3-c949-4cdf-9bd9-8b1e2b417141-grafik.png

          and used here:

          5b3460a3-17c9-4cdd-916a-402bb33d936a-grafik.png

          Any more idea?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @elbnacht Can you please post your pro file?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • E Offline
            E Offline
            elbnacht
            wrote on last edited by
            #6

            sorry, but I still fight with VNC settings of debian using the clipboard ... therefor the quick (and dirty) image pasting

            76d15c4d-0e17-42e1-b423-59662133d2ba-grafik.png

            jsulmJ 1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #7

              wdt_dio.h should not be in HEADERS. If it comes from a library (which is only included and linked, not compiled), all you need to do is to add it's parent directory to INCLUDEPATH.

              (Z(:^

              1 Reply Last reply
              2
              • E elbnacht

                sorry, but I still fight with VNC settings of debian using the clipboard ... therefor the quick (and dirty) image pasting

                76d15c4d-0e17-42e1-b423-59662133d2ba-grafik.png

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @elbnacht wdt_dio is the lib which implements DIReadLine?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  elbnacht
                  wrote on last edited by
                  #9

                  @jsulm: Yes, wdt_dio has all the "missing symbols".

                  @sierdzio: Ok, I understand. I actually added this later just assuming it might be missing. What means "to add it's parent directory to INCLUDEPATH" ? You mean /usr/lib? Which INCLUDEPATH?

                  Just for information:
                  The project itself compiles / works well as just an Qt program. My goal now is it to have it available too as web application.

                  jsulmJ sierdzioS 3 Replies Last reply
                  0
                  • E elbnacht

                    @jsulm: Yes, wdt_dio has all the "missing symbols".

                    @sierdzio: Ok, I understand. I actually added this later just assuming it might be missing. What means "to add it's parent directory to INCLUDEPATH" ? You mean /usr/lib? Which INCLUDEPATH?

                    Just for information:
                    The project itself compiles / works well as just an Qt program. My goal now is it to have it available too as web application.

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @elbnacht said in error: undefined symbol ... during make:

                    /usr/lib?

                    /usr/include probably (the one where the header file is located)

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    2
                    • E elbnacht

                      @jsulm: Yes, wdt_dio has all the "missing symbols".

                      @sierdzio: Ok, I understand. I actually added this later just assuming it might be missing. What means "to add it's parent directory to INCLUDEPATH" ? You mean /usr/lib? Which INCLUDEPATH?

                      Just for information:
                      The project itself compiles / works well as just an Qt program. My goal now is it to have it available too as web application.

                      sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #11

                      @elbnacht said in error: undefined symbol ... during make:

                      @jsulm: Yes, wdt_dio has all the "missing symbols".

                      @sierdzio: Ok, I understand. I actually added this later just assuming it might be missing. What means "to add it's parent directory to INCLUDEPATH" ? You mean /usr/lib? Which INCLUDEPATH?

                      INCLUDEPATH variable in qmake. You should set it in your .pro file. It should point to the directory where the wdt_dio header is located.

                      Just for information:
                      The project itself compiles / works well as just an Qt program. My goal now is it to have it available too as web application.

                      Is wdt_dio compiled for WebAssembly, too? It won't link otherwise.

                      (Z(:^

                      1 Reply Last reply
                      2
                      • E elbnacht

                        @jsulm: Yes, wdt_dio has all the "missing symbols".

                        @sierdzio: Ok, I understand. I actually added this later just assuming it might be missing. What means "to add it's parent directory to INCLUDEPATH" ? You mean /usr/lib? Which INCLUDEPATH?

                        Just for information:
                        The project itself compiles / works well as just an Qt program. My goal now is it to have it available too as web application.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @elbnacht said in error: undefined symbol ... during make:

                        My goal now is it to have it available too as web application

                        That explains. I would say you have to compile that lib with em++ as well (if possible at all).

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • E Offline
                          E Offline
                          elbnacht
                          wrote on last edited by
                          #13

                          I didn't touch the wdt_dio ... thought the driver is running fine ...
                          I read yesterday a lot at the emscription web site but came of no result solving my problem.

                          What means exactly compiling it for WebAssembly? I have my dwt_dio driver .c and .h file.
                          What do I do using the em++ compiler? I thought, this will be done automatically when qmake creates the makefile and make doues the job.

                          jsulmJ 1 Reply Last reply
                          0
                          • E elbnacht

                            I didn't touch the wdt_dio ... thought the driver is running fine ...
                            I read yesterday a lot at the emscription web site but came of no result solving my problem.

                            What means exactly compiling it for WebAssembly? I have my dwt_dio driver .c and .h file.
                            What do I do using the em++ compiler? I thought, this will be done automatically when qmake creates the makefile and make doues the job.

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #14

                            @elbnacht said in error: undefined symbol ... during make:

                            I thought, this will be done automatically when qmake creates the makefile and make doues the job

                            No, why should it? The lib is already built.
                            What I mean is: you need to get source code of that lib and compile it using the same tool chain you're using to compile your projects.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1
                            • E Offline
                              E Offline
                              elbnacht
                              wrote on last edited by
                              #15

                              Sorry, but I'm lost now. Please corect me:

                              The wdt_dio driver (its a hardware driver) is compiled using gcc ...
                              The WebAssembly project is using emsdk qmake / make ... using em++.

                              Should I create a make file for the wdt_dio using em++ and compile ... it again?

                              jsulmJ 1 Reply Last reply
                              0
                              • E elbnacht

                                Sorry, but I'm lost now. Please corect me:

                                The wdt_dio driver (its a hardware driver) is compiled using gcc ...
                                The WebAssembly project is using emsdk qmake / make ... using em++.

                                Should I create a make file for the wdt_dio using em++ and compile ... it again?

                                jsulmJ Offline
                                jsulmJ Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on last edited by
                                #16

                                @elbnacht said in error: undefined symbol ... during make:

                                Should I create a make file for the wdt_dio using em++ and compile ... it again?

                                You need to download the source code and then build it with em++. It should not be necessary to write makefile by yourself, but use whatever is used by wdt_dio project (check its source code).

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • E Offline
                                  E Offline
                                  elbnacht
                                  wrote on last edited by
                                  #17

                                  Ok, found some more interesting websites about linking etc.

                                  I started with a simple emcc wdt_dio.c ... created the error 'linux/module.h' file not found, which is beside other included in the .c file.

                                  All linux sources are installed on my system ...
                                  Could not find any compiler flags avoiding it ...

                                  But also for my basic understanding:
                                  WebAssembly requires a different driver compiled with emcc/em++ for the emscription environment. Is that right?

                                  jsulmJ sierdzioS 2 Replies Last reply
                                  0
                                  • E elbnacht

                                    Ok, found some more interesting websites about linking etc.

                                    I started with a simple emcc wdt_dio.c ... created the error 'linux/module.h' file not found, which is beside other included in the .c file.

                                    All linux sources are installed on my system ...
                                    Could not find any compiler flags avoiding it ...

                                    But also for my basic understanding:
                                    WebAssembly requires a different driver compiled with emcc/em++ for the emscription environment. Is that right?

                                    jsulmJ Offline
                                    jsulmJ Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #18

                                    @elbnacht The libs you want to use with WebAssembly has to be compiled for WebAssembly. You can't use (as far as I know) libs compiled with GCC.
                                    "emcc wdt_dio.c ... created the error 'linux/module.h'" - tell emcc where the headers are.

                                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    1
                                    • E elbnacht

                                      Ok, found some more interesting websites about linking etc.

                                      I started with a simple emcc wdt_dio.c ... created the error 'linux/module.h' file not found, which is beside other included in the .c file.

                                      All linux sources are installed on my system ...
                                      Could not find any compiler flags avoiding it ...

                                      But also for my basic understanding:
                                      WebAssembly requires a different driver compiled with emcc/em++ for the emscription environment. Is that right?

                                      sierdzioS Offline
                                      sierdzioS Offline
                                      sierdzio
                                      Moderators
                                      wrote on last edited by
                                      #19

                                      @elbnacht said in error: undefined symbol ... during make:

                                      WebAssembly requires a different driver compiled with emcc/em++ for the emscription environment. Is that right?

                                      Very probably yes. And these can be missing at this point. WASM ecosystem is quite limited at this point.

                                      Think about WebAssembly as a different operating system: libraries are not compatible, your system headers/libs won't work, you are essentially cross-compiling. Similar to deploying for an embedded board, except here the system is not Linux but a sandboxed web browser environment.

                                      (Z(:^

                                      1 Reply Last reply
                                      2
                                      • E Offline
                                        E Offline
                                        elbnacht
                                        wrote on last edited by
                                        #20

                                        Many thanks for your explanation. This sounds much clearer for me.

                                        I made a simple Makefile (to find the .h files). Output creates some errors:

                                        ===================================
                                        infratec@debian:~/Qt-Projekte/driver$ make
                                        make -C /lib/modules/4.19.0-8-amd64/build SUBDIRS=/home/infratec/Qt-Projekte/driver modules
                                        make[1]: Verzeichnis "/usr/src/linux-headers-4.19.0-8-amd64" wird betreten
                                        CC [M] /home/infratec/Qt-Projekte/driver/wdt_dio.o
                                        clang: error: unknown argument: '-mno-fp-ret-in-387'
                                        clang: error: unknown argument: '-mpreferred-stack-boundary=3'
                                        clang: error: unknown argument: '-mskip-rax-setup'
                                        clang: error: unknown argument: '-mindirect-branch=thunk-extern'
                                        clang: error: unknown argument: '-mindirect-branch-register'
                                        clang: error: unknown argument: '-fno-var-tracking-assignments'
                                        clang: error: unknown argument: '-mrecord-mcount'
                                        clang: error: unknown argument: '-fconserve-stack'
                                        clang: error: unknown argument: '-fmacro-prefix-map=/usr/src/linux-headers-4.19.0-8-common/='
                                        clang: error: unknown argument: '-fcf-protection=none'
                                        clang: warning: optimization flag '-falign-jumps=1' is not supported [-Wignored-optimization-argument]
                                        clang: warning: optimization flag '-falign-loops=1' is not supported [-Wignored-optimization-argument]
                                        clang: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Wignored-optimization-argument]
                                        clang: warning: optimization flag '-fmerge-constants' is not supported [-Wignored-optimization-argument]
                                        shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
                                        make[4]: *** [/usr/src/linux-headers-4.19.0-8-common/scripts/Makefile.build:315: /home/infratec/Qt-Projekte/driver/wdt_dio.o] Fehler 1
                                        make[3]: *** [/usr/src/linux-headers-4.19.0-8-common/Makefile:1537: module/home/infratec/Qt-Projekte/driver] Fehler 2
                                        make[2]: *** [Makefile:146: sub-make] Fehler 2
                                        make[1]: *** [Makefile:8: all] Fehler 2
                                        make[1]: Verzeichnis „/usr/src/linux-headers-4.19.0-8-amd64“ wird verlassen
                                        make: *** [Makefile:17: all] Fehler 2

                                        ===============================

                                        Any idea on this?

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • E elbnacht

                                          Many thanks for your explanation. This sounds much clearer for me.

                                          I made a simple Makefile (to find the .h files). Output creates some errors:

                                          ===================================
                                          infratec@debian:~/Qt-Projekte/driver$ make
                                          make -C /lib/modules/4.19.0-8-amd64/build SUBDIRS=/home/infratec/Qt-Projekte/driver modules
                                          make[1]: Verzeichnis "/usr/src/linux-headers-4.19.0-8-amd64" wird betreten
                                          CC [M] /home/infratec/Qt-Projekte/driver/wdt_dio.o
                                          clang: error: unknown argument: '-mno-fp-ret-in-387'
                                          clang: error: unknown argument: '-mpreferred-stack-boundary=3'
                                          clang: error: unknown argument: '-mskip-rax-setup'
                                          clang: error: unknown argument: '-mindirect-branch=thunk-extern'
                                          clang: error: unknown argument: '-mindirect-branch-register'
                                          clang: error: unknown argument: '-fno-var-tracking-assignments'
                                          clang: error: unknown argument: '-mrecord-mcount'
                                          clang: error: unknown argument: '-fconserve-stack'
                                          clang: error: unknown argument: '-fmacro-prefix-map=/usr/src/linux-headers-4.19.0-8-common/='
                                          clang: error: unknown argument: '-fcf-protection=none'
                                          clang: warning: optimization flag '-falign-jumps=1' is not supported [-Wignored-optimization-argument]
                                          clang: warning: optimization flag '-falign-loops=1' is not supported [-Wignored-optimization-argument]
                                          clang: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Wignored-optimization-argument]
                                          clang: warning: optimization flag '-fmerge-constants' is not supported [-Wignored-optimization-argument]
                                          shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
                                          make[4]: *** [/usr/src/linux-headers-4.19.0-8-common/scripts/Makefile.build:315: /home/infratec/Qt-Projekte/driver/wdt_dio.o] Fehler 1
                                          make[3]: *** [/usr/src/linux-headers-4.19.0-8-common/Makefile:1537: module/home/infratec/Qt-Projekte/driver] Fehler 2
                                          make[2]: *** [Makefile:146: sub-make] Fehler 2
                                          make[1]: *** [Makefile:8: all] Fehler 2
                                          make[1]: Verzeichnis „/usr/src/linux-headers-4.19.0-8-amd64“ wird verlassen
                                          make: *** [Makefile:17: all] Fehler 2

                                          ===============================

                                          Any idea on this?

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #21

                                          @elbnacht Well, you're passing arguments to the compiler which it does not know

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved