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. [SOLVED] Compiling library by gcc and g++
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Compiling library by gcc and g++

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 777 Views 1 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.
  • W Offline
    W Offline
    WoldemarShiPa
    wrote on 17 Apr 2014, 14:29 last edited by
    #1

    Hello. I created simple qt5 project containing main.c only and using library lib.a. It compiles by gcc successfully. But if i will rename file to main.cpp and will try to compile it by g++, I will get linker "undefined reference" error. No library source code provided. Is there any way to compile projects by g++? Thanks

    1 Reply Last reply
    0
    • W Offline
      W Offline
      WoldemarShiPa
      wrote on 18 Apr 2014, 07:04 last edited by
      #2

      Adding "extern "C"" before function's declarations in header solves the problem

      1 Reply Last reply
      0

      1/2

      17 Apr 2014, 14:29

      • 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