Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compile a dll from my app so I could then load it and use it? or execution of uncompiled C files?
QtWS25 Last Chance

Compile a dll from my app so I could then load it and use it? or execution of uncompiled C files?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 671 Views
  • 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.
  • mbruelM Offline
    mbruelM Offline
    mbruel
    wrote on last edited by
    #1

    Hi,
    The users of my App can define some C files (artificial neural networks) that I'd need to be able to use in the app.
    It is on purpose that those files are external to the application itself because users (physicists) should be able to modify them as text files and / or create new ones.
    In the previous version of the App (in Java), they were parsing the C files to then initialize objects that will do what the C files directly do.
    As I'm now in C++/QT, I would like to directly use the C file, it is kind of boring to have to maintain a parser if the user C file change a little bit their format.
    So, is there a way to embed the compiler in my App? (this should be cross-platform, so take the good one depending on the system)
    Or is there a way maybe to execute uncompiled files using some libraries? some kind of injection. I know it is possible in other languages.

    aha_1980A jsulmJ 2 Replies Last reply
    0
    • mbruelM mbruel

      Hi,
      The users of my App can define some C files (artificial neural networks) that I'd need to be able to use in the app.
      It is on purpose that those files are external to the application itself because users (physicists) should be able to modify them as text files and / or create new ones.
      In the previous version of the App (in Java), they were parsing the C files to then initialize objects that will do what the C files directly do.
      As I'm now in C++/QT, I would like to directly use the C file, it is kind of boring to have to maintain a parser if the user C file change a little bit their format.
      So, is there a way to embed the compiler in my App? (this should be cross-platform, so take the good one depending on the system)
      Or is there a way maybe to execute uncompiled files using some libraries? some kind of injection. I know it is possible in other languages.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mbruel

      The only C/C++ interpreter I'm aware of is cling.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      3
      • mbruelM mbruel

        Hi,
        The users of my App can define some C files (artificial neural networks) that I'd need to be able to use in the app.
        It is on purpose that those files are external to the application itself because users (physicists) should be able to modify them as text files and / or create new ones.
        In the previous version of the App (in Java), they were parsing the C files to then initialize objects that will do what the C files directly do.
        As I'm now in C++/QT, I would like to directly use the C file, it is kind of boring to have to maintain a parser if the user C file change a little bit their format.
        So, is there a way to embed the compiler in my App? (this should be cross-platform, so take the good one depending on the system)
        Or is there a way maybe to execute uncompiled files using some libraries? some kind of injection. I know it is possible in other languages.

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

        @mbruel C language is not a typical language for scripting :-)
        Why not use something dedicated to this task? Like Python or Lua?

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

        mbruelM 1 Reply Last reply
        4
        • jsulmJ jsulm

          @mbruel C language is not a typical language for scripting :-)
          Why not use something dedicated to this task? Like Python or Lua?

          mbruelM Offline
          mbruelM Offline
          mbruel
          wrote on last edited by
          #4

          @jsulm
          Yeah I know, I will have this discussion with my client.
          I suppose that they just get some C implemented functions used by another soft that they want to inject in the one I'm working in. So they may not want to modify the format and keep them as C files.
          I'm going also to see if they couldn't just compile the C files in a dll that I would use but I guess it is a constraint they may wish to avoid as their machine may not have a compiler and that some users should be free to change those file for some test purposes.

          jsulmJ 1 Reply Last reply
          0
          • mbruelM mbruel

            @jsulm
            Yeah I know, I will have this discussion with my client.
            I suppose that they just get some C implemented functions used by another soft that they want to inject in the one I'm working in. So they may not want to modify the format and keep them as C files.
            I'm going also to see if they couldn't just compile the C files in a dll that I would use but I guess it is a constraint they may wish to avoid as their machine may not have a compiler and that some users should be free to change those file for some test purposes.

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

            @mbruel said in Compile a dll from my app so I could then load it and use it? or execution of uncompiled C files?:

            machine may not have a compiler

            Then how would they know that their C code actually compiles? :-)

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

            mbruelM 1 Reply Last reply
            0
            • jsulmJ jsulm

              @mbruel said in Compile a dll from my app so I could then load it and use it? or execution of uncompiled C files?:

              machine may not have a compiler

              Then how would they know that their C code actually compiles? :-)

              mbruelM Offline
              mbruelM Offline
              mbruel
              wrote on last edited by mbruel
              #6

              @jsulm
              well they don't. But it is basic functions and I suppose they would just update some coefficients so they shouldn't corrupt the compilation.
              If it was the case, I should just notify them that there is a problem with that file and just ignore it.

              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