How to build and include stxxl in a Qt project on Windows?
-
Yes that's a mistake, config.h.in is a template that will be processed by CMake to generate config.h that is likely somewhere in the build folder of stxxl
-
Ah that makes sense! I found the actual configfile and the errors are reduced down to two instances of:
D:\Coding\c++\stxxl-1.4.1\include\stxxl\bits\common\counting_ptr.h:417: Error: '_InterlockedIncrement' was not declared in this scope
_InterlockedIncrement(&m_reference_count);
^They appear in the file "counting_ptr.h" (I only pasted the relevant part):
public: //! Call whenever setting a pointer to the object void inc_reference() const { #if STXXL_MSVC _InterlockedIncrement(&m_reference_count); #else __sync_add_and_fetch(&m_reference_count, +1); #endif } //! Call whenever resetting (i.e. overwriting) a pointer to the object. //! IMPORTANT: In case of self-assignment, call AFTER inc_reference(). //! \return if the object has to be deleted (i.e. if it's reference count dropped to zero) bool dec_reference() const { #if STXXL_MSVC return (_InterlockedDecrement(&m_reference_count) == 0); #else return (__sync_add_and_fetch(&m_reference_count, -1) == 0); #endif }
-
That's when using your MinGW Qt build ?
-
Yes! Desktop QT 5.5.1 MinGW 32bit
-
You can't mix and match C++ libraries built with different compilers on Windows. Either build stxxl with MinGW or install Qt for the same Visual Studio version you used to build stxxl.
Note that it's not specific to MinGW vs Visual Studio nor Qt. Visual Studio compilers are not compatible one with the other so you have to build everything with the same compiler.
-
Aww... * sadface * gotta figure out how to build it with mingw then...
-
Is using MinGW mandatory ? If not and since you already have stxxl built with Visual Studio, why not use it ? You don't have to use the IDE at all.
-
You mean I can use Visual Studios compiler inside the QT creator?
Because I really don't want to use visual studios IDE if avoidable since IntelliSense is awfully slow! -
That's the whole goal of Qt Creator: use it on all supported platform. Qt Creator is an IDE and will use the compiler matching the Qt you installed (provided you installed said compiler)
-
Wicked! It worked * big smile * thank you very much!
Now what do I need to pay attention to when releasing the application? -
You're welcome !
To provide all dependencies.
windeployqt will help with setting up a folder structure to distribute your application.
You should create an installer so it will be easier to distribute your application.
-
Wonderful! At first it threw me a 0xc000007b error but after some cleaning up and recompiling and redeploying it worked like a charm! Thank you again very much! I would have been absolutely lost without your help :D
-
You're welcome !
Happy coding :)