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 4.4k 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.
  • 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
                            • E Offline
                              E Offline
                              elbnacht
                              wrote on last edited by
                              #22

                              I thought the makefile is simple (without any arguments):

                              # makefile for a wdt_dio kernel module
                              #
                              CC := emcc
                              
                              obj-m += wdt_dio.o
                              
                              KDIR := /lib/modules/$(shell uname -r)/build
                              CDIR := $(shell pwd)
                              
                              all:
                              	$(MAKE) -C $(KDIR) SUBDIRS=$(CDIR) modules
                              clean:
                              
                              1 Reply Last reply
                              0
                              • lorn.potterL Offline
                                lorn.potterL Offline
                                lorn.potter
                                wrote on last edited by
                                #23

                                Emscripten/wasm does not have access to the kernel, so trying to build kernel modules for wasm will not work. It lives in the web browser sandbox alongside javascript.

                                Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                                Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                                1 Reply Last reply
                                2

                                • Login

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