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. Cannot initialize a parameter of type 'const char *' with an rvalue of type 'int' in Auto Test project
Forum Update on Monday, May 27th 2025

Cannot initialize a parameter of type 'const char *' with an rvalue of type 'int' in Auto Test project

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.9k 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.
  • D Offline
    D Offline
    Deyan
    wrote on 1 Aug 2022, 09:49 last edited by Deyan 8 Aug 2022, 04:44
    #1

    I am trying to create Auto Test Project, but I have got this error: "Cannot initialize a parameter of type 'const char *' with an rvalue of type 'int' " from QTEST_MAIN macro. Can you help me?

    J 1 Reply Last reply 1 Aug 2022, 10:38
    0
    • D Deyan
      1 Aug 2022, 09:49

      I am trying to create Auto Test Project, but I have got this error: "Cannot initialize a parameter of type 'const char *' with an rvalue of type 'int' " from QTEST_MAIN macro. Can you help me?

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 1 Aug 2022, 10:38 last edited by
      #2

      @Deyan from my experience with QtTest, you're supposed to do this one of two ways

      (The presumably preferred one)

      1. Compile your project as a static library and include/link against that in your test projects

      ("quick" and dirty)

      1. Add the specific files you want to test - containing your classes/functions - to your test project, full or relative path. This is needed for the compiler to create obj files and link correctly

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1

      1/2

      1 Aug 2022, 09:49

      • Login

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