Lnk1104 не удается открыть файл libc lib
ошибку выводит когда включаю в проект Lua
много гуглил и везде говорят в игнор поставить
но от этого ошибок только больше :
1>lua52.lib(lauxlib.obj) : error LNK2019: ссылка на неразрешенный внешний символ _errno в функции _luaL_fileresult
1>lua52.lib(liolib.obj) : error LNK2001: неразрешенный внешний символ "_errno"
1>lua52.lib(lauxlib.obj) : error LNK2019: ссылка на неразрешенный внешний символ __iob в функции _luaL_loadfilex
1>lua52.lib(ldblib.obj) : error LNK2001: неразрешенный внешний символ "__iob"
1>lua52.lib(liolib.obj) : error LNK2001: неразрешенный внешний символ "__iob"
1>lua52.lib(lbaselib.obj) : error LNK2001: неразрешенный внешний символ "__iob"
1>lua52.lib(lmathlib.obj) : error LNK2019: ссылка на неразрешенный внешний символ __HUGE в функции _luaopen_math
1>lua52.lib(lstrlib.obj) : error LNK2019: ссылка на неразрешенный внешний символ __pctype в функции _match_class
1>lua52.lib(lbaselib.obj) : error LNK2001: неразрешенный внешний символ "__pctype"
1>lua52.lib(lstrlib.obj) : error LNK2019: ссылка на неразрешенный внешний символ ___mb_cur_max в функции _match_class
1>lua52.lib(lbaselib.obj) : error LNK2001: неразрешенный внешний символ "___mb_cur_max"
использую Microsoft Visual Studio 2010 Express
помогите кто знает.
Заранее Спасибо.
Fatal error LNK1104: не удается открыть файл "ucrt.lib"
Вылетает ошибка LINK : fatal error LNK1104: не удается открыть файл "ucrt.lib" при компиляции.
Ошибка компоновки fatal error LNK1104: не удается открыть файл "kernel32.lib"
Скажыте пожалуста что делать, оооочень нужно. у меня выдает ошыбку: 1>LINK : fatal error.
Error LNK1104: не удается открыть файл "kernel32.lib"
В VS 2013 выходит такая ошибка Ошибка 1 error LNK1104: не удается открыть файл.
Visual studio ошибка 2 error lnk1104: не удается открыть файл 'kernel32.lib'
Я удалил visual studio express, и установил visual studio profissional. И при сборке простой.
Эта ошибка возникает, когда компоновщику не удается открыть файл для чтения или записи. Ниже перечислены две наиболее распространенные причины этой проблемы.
Программа уже запущена или загружена в отладчике, и
пути к библиотеке неверны или не заключены в двойные кавычки.
Существует множество других возможных причин этой ошибки. Чтобы сократить их, сначала проверьте Тип файла. Затем используйте следующие разделы для выявления и исправления конкретной проблемы.
Can't open your app or its .pdb file
Libraries in projects from online or other sources
If you build a project copied from another computer, the library installation locations may be different. For command-line builds, verify the LIB environment variable and library paths are set correctly for the build. In Visual Studio, you can see and edit the current library paths set in the Property pages for your project. In the VC++ Directories page, choose the drop-down control for the Library Directories property, then choose Edit. The Evaluated value section of the Library Directories dialog lists the current paths searched for library files. Update these paths to point to your local libraries.
Не удается открыть файл "К:\програм.ОБЖ"
Чтобы устранить эту проблему для сборок из командной строки, проверьте параметры параметра /libpath . Также проверьте пути, указанные в переменной среды LIB, и пути, указанные в командной строке. Обязательно используйте двойные кавычки для всех путей, содержащих пробелы.
Чтобы устранить эту проблему в интегрированной среде разработки, при необходимости добавьте двойные кавычки для следующих свойств проекта:
свойство каталоги библиотеки на странице свойств конфигурации > VC++ каталоги
Свойство " Дополнительные каталоги библиотек " на странице свойств " Общие" компоновщика > свойств > конфигурации
Свойство Дополнительные зависимости на странице свойств входных данных компоновщика > свойств > конфигурации .
Problems in the TMP environment variable
If the filename is named LNKnnn, it's a filename generated by the linker for a temporary file. The directory specified in the TMP environment variable may not exist. Or, more than one directory may be specified for the TMP environment variable. Only one directory path should be specified for the TMP environment variable.
Недостаточно места на диске
Эта ошибка может возникать, если на диске недостаточно места. Компоновщик использует временные файлы в нескольких ситуациях. Даже если на диске достаточно места, большие ссылки могут выпустить или фрагментировать свободное место на диске. Рассмотрите возможность использования параметра /OPT (оптимизация) . выполнение транзитного исключения COMDAT считывает все объектные файлы несколько раз.
Библиотеки для розничной торговли, отладки или конкретной платформы
Эта ошибка может возникнуть при первой сборке для новой целевой платформы или конфигурации, например в розничной торговле или ARM64. в интегрированной среде разработки проверьте, установлены ли набор инструментов платформы и Windows SDK версии , указанной на странице свойств общие . также убедитесь, что необходимые библиотеки доступны в каталогах библиотек , указанных на странице свойств каталоги VC++. Проверьте свойства каждой конфигурации, например Debug, Retail, x86 или ARM64. Если одна сборка работает, но другая нет, Сравните параметры обоих параметров. Установите все отсутствующие необходимые инструменты и библиотеки.
Can't open file 'C:\Program.obj'
If you see the filename C:\Program.obj in the error message, wrap your library paths in double quotes. This error happens when an unwrapped path that begins with C:\Program Files gets passed to the linker. Unwrapped paths may also cause similar errors. Typically, they show an unexpected .obj file in the root of your drive.
To fix this issue for command-line builds, check the /LIBPATH option parameters. Also check the paths specified in the LIB environment variable, and the paths specified on the command line. Make sure to use double-quotes around any paths that include spaces.
To fix this issue in the IDE, add double-quotes as necessary to the following properties for your project:
The Library Directories property on the Configuration Properties > VC++ Directories property page,
The Additional Library Directories property in the Configuration Properties > Linker > General property page,
The Additional Dependencies property in the Configuration Properties > Linker > Input property page.
Insufficient disk space
The error can occur when you don't have enough disk space. The linker uses temporary files in several cases. Even if you have sufficient disk space, a large link can deplete or fragment the available disk space. Consider using the /OPT (Optimizations) option; doing transitive COMDAT elimination reads all the object files multiple times.
Can't open a file built by your project
You may see this error if filename doesn't exist yet when the linker tries to access it. It can happen when one project depends on another in the solution, but the projects build in the wrong order. To fix this issue, make sure your project references are set in the project that uses the file. Then the missing file gets built before it's required. For more information, see Adding references in Visual Studio C++ projects and Managing references in a project.
Не удается открыть файл, созданный проектом
Эта ошибка может возникать, если файл filename еще не существует, когда компоновщик пытается получить к нему доступ. Это может произойти, когда один проект зависит от другого в решении, но проекты создаются в неправильном порядке. Чтобы устранить эту проблему, убедитесь, что ссылки проекта заданы в проекте, который использует этот файл. После этого отсутствующий файл будет создан до того, как он потребуется. дополнительные сведения см. в статьях добавление ссылок в проекты Visual Studio C++ и управление ссылками в проекте.
Retail, Debug, or platform-specific libraries
The error may occur when you first build for a new target platform or configuration, such as Retail, or ARM64. In the IDE, verify the Platform toolset and Windows SDK Version specified in the General property page are installed. Also verify the required libraries are available in the Library Directories specified in the VC++ Directories Property Page. Check the properties for each configuration, such as Debug, Retail, x86, or ARM64. If one build works but another doesn't, compare the settings for both. Install any missing required tools and libraries.
Слишком длинные пути
Эта ошибка может появиться, когда путь к файлу расширяется до 260 символов. При необходимости измените структуру каталогов или Сократите имена папок и файлов, чтобы сократить пути.
Не удается открыть приложение или его PDB-файл
Неправильные разрешения для файла
Эта ошибка может возникать, если у вас недостаточно разрешений для доступа к файлу filename. Это может произойти, если для доступа к файлам библиотеки в защищенных системных каталогах используется обычная учетная запись пользователя. Или, если вы используете файлы, скопированные с других пользователей, у которых все еще есть исходный набор разрешений. Чтобы устранить эту проблему, переместите файл в каталог проекта с возможностью записи. Если перемещенный файл имеет недоступные разрешения, выполните команду takeown.exe в окне командной строки администратора, чтобы стать владельцем файла.
Can't open a third-party library file
There are several common causes for this issue:
The path to your library file may be incorrect, or not wrapped in double-quotes. Or, you may not have specified it to the linker.
You may have installed a 32-bit version of the library but you're building for 64 bits, or the other way around.
The library may have dependencies on other libraries that aren't installed.
To fix a path issue for command-line builds, verify the LIB environment variable is set. Make sure it includes paths for all the libraries you use, and for every configuration you build. In the IDE, the library paths get set by the VC++ Directories > Library Directories property. Make sure all the directories that contain the libraries you need are listed here, for every configuration you build.
You might need to supply a library directory that overrides a standard library directory. On the command line, use the /LIBPATH option. In the IDE, use the Additional Library Directories property in the Configuration Properties > Linker > General property page for your project.
Make sure you install every version of the library you need for the configurations you build. Consider using the vcpkg package management utility to automate the installation and setup for many common libraries. When you can, it's best to build your own copies of third-party libraries. Then you're sure to have all the libraries' local dependencies, built for the same configurations as your project.
Windows библиотеки, например kernel32. lib
Если файл, который не удается открыть, является одним из стандартных файлов библиотеки, предоставляемых корпорацией Майкрософт, например kernel32. lib, может возникнуть ошибка конфигурации проекта или ошибка установки. убедитесь, что Windows SDK установлен. если для проекта требуются другие библиотеки майкрософт, такие как MFC, убедитесь, что компоненты MFC также установлены установщиком Visual Studio. Вы можете снова запустить установщик, чтобы добавить дополнительные компоненты в любое время. Дополнительные сведения см. в Изменение Visual Studio. Используйте вкладку отдельные компоненты в установщике, чтобы выбрать конкретные библиотеки и пакеты SDK.
Другие распространенные проблемы
The vccorlib.lib library
There are no Spectre-mitigated libraries for Universal Windows (UWP) apps or components. If the error message includes vccorlib.lib, you may have enabled /Qspectre in a UWP project. Disable the /Qspectre compiler option to fix this issue. In Visual Studio, change the Spectre Mitigation property. It's found in the C/C++ > Code Generation page of the project Property Pages dialog.
Updated Windows SDK libraries
This error can occur when the Visual Studio path to the Windows SDK is out of date. It may happen if you install a newer Windows SDK independently of the Visual Studio installer. To fix it in the IDE, update the paths specified in the VC++ Directories property page. Set the version in the path to match the new SDK. If you use the Developer Command Prompt, update the batch file that initializes the environment variables with the new SDK paths. This problem can be avoided by using the Visual Studio installer to install updated SDKs.
Библиотека vccorlib. lib
Windows libraries, such as kernel32.lib
If the file that can't be opened is one of the standard library files provided by Microsoft, such as kernel32.lib, you may have a project configuration error or an installation error. Verify the Windows SDK has been installed. If your project requires other Microsoft libraries, such as MFC, make sure the MFC components were also installed by the Visual Studio installer. You can run the installer again to add optional components at any time. For more information, see Modify Visual Studio. Use the Individual components tab in the installer to choose specific libraries and SDKs.
Не удается открыть файл библиотеки Майкрософт
Слишком большие файлы
Эта ошибка может возникать из-за слишком большого размера файла. Библиотеки или объектные файлы, размер которых превышает гигабайт, может вызвать проблемы для 32-разрядного компоновщика. Возможным исправлением этой проблемы является использование 64-разрядного набора инструментов. Дополнительные сведения о том, как использовать 64-разрядный набор средств в командной строке, см. в разделе как включить 64-разрядный Visual C++ набор инструментов в командной строке. сведения о том, как использовать 64-разрядный набор инструментов в интегрированной среде разработки, см. в разделе использование MSBuild с 64-разрядным компилятором и инструментами. также см. статью Stack Overflow post: как сделать Visual Studio использовать собственную цепочки инструментов amd64.
Проблемы в переменной среды TMP
Если имя файла LNKnnn, то это имя файла, созданного компоновщиком для временного файла. Каталог, указанный в переменной среды TMP, может не существовать. Кроме того, для переменной среды TMP может быть задано несколько каталогов. Для переменной среды TMP должен быть указан только один путь к каталогу.
Other common issues
Paths that are too long
You may see this error when the path for filename expands to more than 260 characters. If needed, rearrange your directory structure or shorten your folder and file names to shorten the paths.
Path or filename issues
Справка, моей проблемы нет в списке!
your program is already running or is loaded in the debugger, and
your library paths are incorrect, or aren't wrapped in double-quotes.
There are many other possible causes for this error. To narrow them down, first check what kind of file filename is. Then, use the following sections to help identify and fix the specific issue.
Дополнительные зависимости, указанные в интегрированной среде разработки
При указании отдельных библиотек в свойстве Дополнительные зависимости используйте пробелы для разделения имен библиотек. Не используйте запятые или точки с запятой. При использовании пункта меню Правка для открытия диалогового окна Дополнительные зависимости используйте символы новой строки для разделения имен, а не запятых, точек с запятой или пробелов. Также используйте символы новой строки при указании путей к библиотекам в папках библиотек и дополнительных каталогах библиотек .
Библиотеки в проектах из сетевых или других источников
При построении проекта, скопированного с другого компьютера, расположения установки библиотеки могут отличаться. Для сборок из командной строки убедитесь, что для сборки правильно заданы пути к переменной среды LIB и библиотеке. в Visual Studio можно просмотреть и изменить текущие пути к библиотекам, заданные на страницах свойств проекта. на странице VC++ каталоги выберите элемент управления "раскрывающийся список" для свойства каталоги библиотек , а затем нажмите кнопку изменить. В разделе вычисленное значение диалогового окна каталоги библиотек перечислены текущие пути поиска файлов библиотек. Обновите эти пути, чтобы они указывали на локальные библиотеки.
Your app is locked by an antivirus scan
Antivirus programs often temporarily block access to newly created files, especially .exe and .dll executable files. To fix this issue, try excluding your project build directories from the antivirus scanner.
Параллельная синхронизация сборок
если вы используете параллельный вариант сборки, Visual Studio мог заблокировать файл в другом потоке. Чтобы устранить эту проблему, убедитесь, что один и тот же объект кода или библиотека не встроены в несколько проектов. Используйте зависимости сборки или ссылки проекта, чтобы выбрать в проекте созданные двоичные файлы.
8 Answers 8
Resurrecting this thread in late 2018 since none of the other solutions helped my case :)
For me this error started appearing out of nowhere after i installed Windows Driver Kit for a completely unrelated project.
If you don't need "Spectre Mitigation" (you most likely do not) and seeing this error it's highly probable that you just have to set Project Properties (property pages) -> Configuration Properties -> C/C++ -> Code Generation -> Spectre Mitigation to Disabled.
Magically it was set to Enabled by the installer of Visual Studio tools for WDK in all projects even tho they got nothing to do with WDK nor the Platform toolset was selected for any driver related stuff. Microsoft at its finest.
@CEOatApartico i did not.. it was more like trial and error. I think i have spent days with this back then trying things out and suddenly i noticed something that i have not seen there before. so i tried to disable it :)
@nOne glad it worked for you. I think my answer is to a newer problem than that the OP had :) either way it's good to see it helps people.
I suspect the command prompt you are using to run the compiler does not have all the required environment variables defined.
To make sure the command line environment is correctly configured make sure you have run the vsvars32.bat batch file.
This does not fix the problem. On my system, cl doesn't work unless I run vsvars32.bat first. I still get the error though.
Just to add my experience here, since it may help someone, and it applies to newer VS editions (2017 in my case).
I was getting a similar error during compiling when I moved my project to a new machine. I finally figured out that one of the projects in my dependencies had spectre mitigation turned on, and the libs with that support are not included by default:
Yes, this is what fixed it for mine, as well. The /QSpectre flag is enabled by default now, but it doesn't install the Spectre-mitigated libraries by default. Strange choice of defaults, but running the installer and checking this option fixed the issue for me.
This worked for me when I got …
Your project name == “Project Name” for this example.
Go to the 'Solution Explorer' window for your Project.
RIGHT Click on the Project "Project Name", not the Solution "Project Name".
This will open a long menu.
At the bottom is "Properties" Click on it.
This will open the “Project Name” Property Pages window.
IF the name of the window (upper left) says.
“Solution 'Project Name' Property Pages
Close this window, you right clicked on the Solution, not the Project, you need to right click on the project name.
On the “Project Name” Property Pages
Left hand panel expand Configuration Properties
Then click on General
Now the right panel should show the 'General' Configuration Properties' for your current Project.
Look down the list to 'Platform Toolset'
If the version of VS you are using is not the one listed you needed to change it.
To change the version of VS just put you mouse pointer at the end of the current VS version name that is displayed and click.
A box with a down arrow will show at the right hand side of that row, click on it.
This will open a window with a list of VS versions.
Pick the version of VS you are NOW using.
That window should close, and your selection should have replaced the old project VS version that was used to build your project when I was first built.
Then at bottom of “Project Name” Property Pages click Apply, then OK.
Now try to build Project.
I hope this helps, it works for me when working on projects that were built with earlier versions of VS.
Т.е. эта libc.lib видимо реально нужна для работы GMP. И что делать? Сколько ни гуглил - все советуют игнорить. Эта библиотека вообще существует в природе? Кто-нибудь по-другому избавлялся от этой проблемы?
Androide
Напиши свою библиотеку для работы с длинными числами)
Вобщем заигнорил эту libc.lib, а в настройках проекта в с/с++ -> code generation -> runtime library вместо MD поставил MT и все заработало. Не знаю почему, но заработало. Видимо какие-то кривые динамические библиотеки встали на место прежних.
Androide
>Вобщем заигнорил эту libc.lib, а в настройках проекта в с/с++ -> code
>generation -> runtime library вместо MD поставил MT и все заработало. Не знаю
>почему, но заработало. Видимо какие-то кривые динамические библиотеки встали на
>место прежних.
У меня такаяже проблема и добавлении в проэкт библиотеки libjpeg.lib
но игнорирование libc.lib привоит к
runtime library вместо MD поставить MT не помогает
Подскажите как решить проблемму
Если коротко, нужно версия libjpeg, которая скомпилирована с другим типом CRT (C runtime library).
Libc - это библиотека стандатных функций языка Си - malloc(), free(), printf() и тд.
Существует в различных вариантах (отличаются названиями):
libc.lib libcd.lib
libcmt.lib libcmtd.lib
msvcrt.lib msvcrtd.lib
Версии с суффиксом d - это версии для отладки. Libc - однопоточная статическая библиотека, libcmt - многопоточная статическая библиотека, msvcrt - многопоточная динамическая библиотека. Многопоточная от однопоточной отличается тем, что поддерживается более одного потока исполнения (треда). Для этого в объектах, которые могут совместно использоваться из разных потоков (тредов) предусмотрена синхронизация доступа.
В новых версиях visual studio однопоточной libc больше нет. Мотивируется это тем, что вместо однопоточной библиотеки можно использовать и многопоточную, без заметного замедления. При этом однопоточных программ фактически нет - различные библиотеки (в том числе, стандартные системные) неявно создают внутри себя worker thread-ы. Дополнительный поток может создать и сама система - например для обработки Ctrl-C в консольном приложении.
Различные типы CRT не взаимозаменяемы.
Это связано с тем, что экспортируется немного различные наборы функций и служебных символов.
Например, в статическом однопоточном CRT (libc) stdin, stdout, stderr определены так:
В других версиях библиотеки это сделано по-другому, поэтому символ __iob в них не определен.
В одном проекте можно иметь единственный тип CRT, в противном случае линковщик будет ругаться на множественные определения символов.
Поэтому надо выбрать какой-то один тип CRT, и убедиться что все остальные библиотеки в проекте линкуются с нужным типом CRT, и при необходимости достать версию библиотеки, которая скомпилирована с правильным CRT.
Тоже самое было например в glee, да и много каких стареньких либах. Решал перекомпилированием на нормальной свежей студии, но это исходники благо были, а без исходников фз как это решается.
Приложение выполняется или загружается в отладчике
Если filename — имя исполняемого файла или связанный с ним PDB-файл, см. раздел Если приложение уже запущено. Затем проверьте, загружен ли он в отладчик. Чтобы устранить эту проблему, перед повторным созданием программы закройте программу и выгрузите ее из отладчика. Если приложение открыто в другой программе, например в редакторе ресурсов, закройте его. Если программа не отвечает, может потребоваться завершить процесс с помощью диспетчера задач. Также может потребоваться закрыть и перезапустить Visual Studio.
Проблемы с путями или именами файлов
Versioned vcruntime libraries
If the error message has a versioned Microsoft library such as msvcr120.lib, the platform toolset for that compiler version may not be installed. To fix this issue, you have two options: Upgrade the project to use the current platform toolset, or install the older toolset and build the project unchanged. For more information, see Upgrading Projects from Earlier Versions of Visual C++ and Use native multi-targeting in Visual Studio to build old projects.
Additional dependencies specified in the IDE
When you specify individual libraries in the Additional Dependencies property directly, use spaces to separate the library names. Don't use commas or semicolons. If you use the Edit menu item to open the Additional Dependencies dialog box, use newlines to separate the names, not commas, semicolons, or spaces. Also use newlines when you specify library paths in the Library Directories and Additional Library Directories dialog boxes.
Can't open a Microsoft library file
Библиотеки vcruntime с отслеживанием версий
Parallel build synchronization
If you're using a parallel build option, Visual Studio may have locked the file on another thread. To fix this issue, verify the same code object or library isn't built in multiple projects. Use build dependencies or project references to pick up built binaries in your project.
Не удается открыть сторонний файл библиотеки
Существует несколько распространенных причин этой проблемы.
Путь к файлу библиотеки может быть неверным или не заключен в двойные кавычки. Или, возможно, вы не указали его для компоновщика.
Возможно, вы установили 32-разрядную версию библиотеки, но при этом собираетесь на 64 бит или наоборот.
Библиотека может зависеть от других библиотек, которые не установлены.
Может потребоваться предоставить каталог библиотеки, переопределяющий каталог стандартной библиотеки. В командной строке используйте параметр /libpath . В интегрированной среде разработки используйте свойство Дополнительные каталоги библиотек на странице свойств " Общие" компоновщика > свойств > конфигурации для проекта.
Убедитесь, что установлены все версии библиотеки, необходимые для создаваемых конфигураций. воспользуйтесь программой управления пакетами vcpkg , чтобы автоматизировать установку и настройку для многих распространенных библиотек. По возможности лучше создавать собственные копии сторонних библиотек. Затем вы убедитесь, что все локальные зависимости библиотек созданы для тех же конфигураций, что и ваш проект.
обновленные библиотеки Windows SDK
Приложение заблокировано антивирусным сканированием
Антивирусные программы часто временно блокируют доступ к вновь созданным файлам, особенно .exe и .dll исполняемые файлы. Чтобы устранить эту проблему, попробуйте исключить каталоги сборки проекта из антивирусного сканера.
Help, my issue isn't listed here!
When none of the issues listed here apply, you can use the feedback tools in Visual Studio for help. In the IDE, go to the menu bar and choose Help > Send Feedback > Report a Problem. Or, submit a suggestion by using Help > Send Feedback > Send a Suggestion. You can also use the Microsoft Docs Q&A site for questions, and the Visual Studio C++ Developer Community website. Use these sites to search for answers to questions and ask for help. For more information, see How to report a problem with the Visual C++ toolset or documentation.
If you've discovered a new way to fix this issue that we should add to this article, let us know. You can send us feedback by using the button below for this page. Use it to create a new issue in our C++ documentation GitHub repo. Thanks!
Please help, I have spent all day trying to make my c++ app compile.
My project contains one source file: Foo.cpp. Here is its code:
as you can see I was trying to use JNI, but I don't think that has anything to do with the problem. Here is what I tried on the command line:
In my environment I have set:
INCLUDE: C:_\include;C:\frankenstein\includes;C:\Program Files\Java\jdk1.6.0_24\include;C:\Program Files\Java\jdk1.6.0_24\include\win32;C:_\include\win32;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
LIBPATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
I checked in the lib directory, it contains a "libcmt.lib" file. Don't know if it is case sensitive, but I know that I never changed anything in the visual studio files or directories.
Would somebody please tell me how I can make this work?
BTW, this file exists on my drive: C:_\include\com_Foo.h, the dependency on libcmt must come indirectly from the jni.h include.
I think this might stem from not creating the code in visual studio, but trying to use its compiler anyways. I created the application in Code::Blocks, and when I could not make the MinGW32 g++ compiler work, I tried using the visual studio compiler. Perhaps it assumes a certain project configuration. Is it possible that the visual studio compiler only works when the project was built in visual studio?
This is perhaps quite an old thread, but since I ran into it now, I thought it might be useful. @mrsheen's answer below worked for me, but I had to run the program from the developer cmd rather than the normal (where the error persisted). Just an FYI for someone who might still be looking for this out there.
Files that are too large
This error can occur because the file is too large. Libraries or object files more than a gigabyte in size may cause problems for the 32-bit linker. A possible fix for this issue is to use the 64-bit toolset. For more information on how to use the 64-bit toolset at the command line, see How to: Enable a 64-Bit Visual C++ Toolset on the Command Line. For information on how to use the 64-bit toolset in the IDE, see Using MSBuild with the 64-bit Compiler and Tools. Also see this Stack Overflow post: How to make Visual Studio use the native amd64 toolchain.
Your app is running, or it's loaded in the debugger
When filename is your executable's name, or an associated .pdb file, see if your application is already running. Then check whether it's loaded in a debugger. To fix this issue, stop the program and unload it from the debugger before building it again. If the app is open in another program, such as a resource editor, close it. If your program is unresponsive, you may need to use Task Manager to end the process. You might also need to close and restart Visual Studio.
Incorrect file permissions
This error can occur if you have insufficient file permissions to access filename. It may happen if you use an ordinary user account to access library files in protected system directories. Or, if you use files copied from other users that still have their original permissions set. To fix this issue, move the file to a writeable project directory. If the moved file has inaccessible permissions, run the takeown.exe command in an Administrator command window to take ownership of the file.
Читайте также: