Qt/mingw32 неопределенные ссылочные ошибки … не могущий связать .lib

В большинстве случаев они - по существу то же, но вторая версия сохраняет память, потому что существует только один экземпляр функции вместо отдельной функции для каждого объекта.

причина А использовать первую форму состоит в том, чтобы получить доступ к "членам парламента, не занимающим официального поста". Например:

var A = function () {
    var private_var = ...;

    this.x = function () {
        return private_var;
    };

    this.setX = function (new_x) {
        private_var = new_x;
    };
};

из-за правил обзора JavaScript, private_var доступен функции, присвоенной this.x, но не вне объекта.

11
задан troyane 25 November 2012 в 11:31
поделиться

3 ответа

Не существует такой вещи, как "достаточно быстрая" сборка. Сторонники TDD ( Test-Driven Development ) будут огорчены, если их сборка займет больше нескольких секунд, потому что это значительно замедлит изменение их стиля разработки.

Я работал над проектами с часами компиляции, которые мы сократили вдвое (или даже лучше), правильно работая с предварительно скомпилированными заголовками, поэтому выгода может быть довольно большой, особенно для проектов, которые какое-то время пренебрегали временем сборки. .

Однако предпочтительным решением остается то, что время компиляции никогда не выходит из-под контроля за счет контроля физических зависимостей кода.

5
ответ дан 3 December 2019 в 10:26
поделиться

The MinGW FAQ discusses this problem and offers a solution:

  1. Create a definition file using reimp (for lib files) or pexports (for dll files).
  2. Remove the underscore prefixes from the stdcall functions.
  3. Use dlltool to convert the MSVC library into a MinGW library with the new definition.

That didn’t work. We finally removed the ordinals from the function names, which caused it to compile. But the program wouldn’t run because it couldn’t find the linked functions in the DLL. Finally, after consulting the MSDN documentation for definition files, we changed the build instructions:

  1. Create a definition file using reimp.
  2. For each stdcall function (formatted as _name@ordinal) add a line name = _name@ordinal, allowing MinGW to map its stdcall naming convention to that of MSVC.
  3. Use dlltool to convert the MSVC library into a MinGW library with the new definition.

It worked! To compile the project you must simply:

  1. Download and install the Qt/Windows package, which includes MinGW.
  2. Download reimp and drop it into the MinGW/bin folder.
  3. Download the development packages for the third-party libraries and point an environment variable to that location.
  4. Build the project with the usual qmake/make commands.

Taken from: http://blog.outofhanwell.com/2006/05/01/linking-msvc-libraries-with-mingw-projects/

4
ответ дан 3 December 2019 в 10:26
поделиться

I assume that you have used the MessageBuffer library in another application with problems. The error looks like it either cannot find the library or the MessageBuffer class is not being exported.

Have you tried putting -l on front of the library in the pro file?

win32:LIBS += -lE:/SharedLibrary/lib/MessageBufferd.lib

See my other answer. I added the other answer because I didn't want to make this answer any more messy than it already was.

Tried so far:

  • Not a typo, d is appended to the library
  • Using the lib extension is correct as seen in the output
0
ответ дан 3 December 2019 в 10:26
поделиться
Другие вопросы по тегам:

Похожие вопросы: