Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:46:56+00:00 2026-06-12T09:46:56+00:00

I am trying to use an external library in my Qt Creator project. I

  • 0

I am trying to use an external library in my Qt Creator project. I am building it with Visual C++ on Windows.

I added this to my qmake file:

# Include libspotify
INCLUDEPATH += C:\\libspotify\\include
LIBS     += -LC:\\libspotify\\lib -llibspotify

Then I went to use some typedef’d structs from the library:

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <libspotify/api.h>

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

    sp_session_config spConfig;
    sp_session spSession;
};

#endif // MAINWINDOW_H

Now in the IDE editor, the syntax highlight marks sp_session_config and sp_session in purple indicating the editor can find those typedefs fine (if it doesn’t find a definition it leaves the text black).

But when I build I get this:

mainwindow.h:32: error: C2079: 'MainWindow::spSession' uses undefined struct 'sp_session'

Now I know the compiler is finding the api.h file, because if I change it to a bogus filename it spits out a file not found error.

What am I doing wrong?

EDIT:
The header file defines the struct like this:

extern "C" {
typedef struct sp_session sp_session; ///< Representation of a session
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:46:57+00:00Added an answer on June 12, 2026 at 9:46 am

    You have a declaration for a typedef to struct sp_session but struct sp_session is an incomplete type. In order for the QMainWindow class to have a sp_session member, the type must be complete (ie., you need a declaration that also defines what members struct sp_session has).

    If that’s not possible, you might be able to restructure things so that class QMainWindow has an sp_struct* or sp_struct& as a member instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build CGAL for windows to use in my project under Visual
The question says it all, I am trying to use an external library in
I'm trying to use an external REST Library for my application, and I'm hoping
I'm trying to use an external library (wingraph) in a simple program. I have
I am trying to wrap an external library in more idiomatic Clojure. This includes
I'm trying to use an external library DevExpress.XtraTreeList.v8.1.dll in my vsto office addin built
I'm trying to use a static library created by me in Visual C++ 2005
I am trying to use an external library called iniparser in my C program.
I'm trying to use the WMI example from msdn: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384724%28v=vs.85%29.aspx I've copied the last
I am trying to use some external Framework in my iPhone app. I did

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.