Посмотрев ваш проект, сообщаю: вы компилируете файлы Unit.cpp
и Source.cpp
. И все бы ничего, на вы же ухитрились в Unit.cpp
внести строку
#include "Source.cpp"
так что все функции и иже с ними, имеющиеся в Source.cpp
, скомпилированы дважды! Уберите эту строку.
И как только вы сделаете это и добавите отсутствующие у вас реализации Employee::Print()
и Housewives::Print()
, все соберется. Заработает ли — это уже совсем второй вопрос, я не смотрел сам код, только сборку…
It’s always fun when Visual Studio (ie @drunkvs) can’t recite the alphabet backwards: The code below builds just fine when running through the compiler, but Visual Studio displays Intellisense errors in the Error Window and in the code with underlined squiggles:
The actual build of the code succeeds, but Intellisense is flagging several classes as missing even though they clearly exist and clearly compile properly.
IntelliSense is High!
So IntelliSense sometimes goes off the rails and if you see errors in your project that don’t make sense, first check to see if the errors are related to Intellisense.
Notice the drop down in the error list that lets you see Build + Intellisense which, in the case above produces 3 errors, but no errors if I just show Build Only:
Note the Intellisense error drop down is a new feature so you may not see it in older versions of Visual Studio. Not sure when it arrived but it was in one of the late VS 2015.x updates.
Clearing up Intellisense
There’s usually a simple solution when IntelliSense decides to sleep one off:
Delete the .vs
folder
The .vs
folder holds solution related temp data including the .suo
file that caches intellisense and some debug data. That folder also holds Web site configuration data for Web projects and a few other things. It’s safe to delete this folder — Visual Studio recreates it when it’s missing.
Older versions of Visual Studio (prior to VS 2015) didn’t have a separate folder and dumped that same information into files in the solution’s root folder.
In these older versions you can fix Intellisense issues by deleting the Solution’s .suo
file. Deleting the .vs
folder in newer version nukes the .suo
file which is responsible for cached IntelliSense and also some cached Debug data. When VS acts up and reports whacky errors that seem wrong, the burning down the .suo
file is a nice quick thing to try first.
To do this:
- Shut down VS
- Nuke the
.vs
folder or the.suo
file - Restart VS
The .suo
file contains cached IntelliSense data and once that file is off, no amount of recompilation or clearing the project is going to help. Nuke the .suo
file. or in VS 2015 or later the .vs
folder and get back to sanity.
Compiler Errors?
I haven’t run into this problem very frequently but when it does happen it’s usually quite vexing resulting (for me at least) in a flurry of deleting output folders.
I have a standard set of steps I tend to go through when I get compiler errors that are wrong. Well, usually it’s me who’s wrong, not the compiler but on occasion I get to be right and the compiler is really wrong.
If you have errors that show under the Build Only
dropdown, then the issue isn’t Intellisense.
This has gotten a lot better, but for a while invalid compiler errors were a big problem with the .NET SDK projects (.NET Core / .NET Standard) and in those cases the solution for me usually is (and still occasionally is):
- Delete the
obj
folder completely - Delete the
bin
folder completely
While Visual Studio’s Clean
project feature is supposed to address this, Clean will only clean up files the project knows about. If you’ve removed or renamed assemblies there may still be left over files in project output folders and deleting them cleans out the project completely.
This often fixes odd left over file issues that can cause strange compilation behavior. I never really considered Intellisense failure previously because Visual Studio didn’t differentiate compiler and IntelliSense Errors (or more accruately I didn’t notice the dropdown). I’d see errors in the Error list, yet my project would compile successfully, which was even more confusing.
Back to the Straight And Narrow
It’s nice that Visual Studio now explicitly shows these errors separately as Build and Intellisense errors, so you can take the sepearate actions to clean up this mess. In the past when the errors weren’t separated it was even more confusing with compiles succeeding, but the error list showing errors.
Now as to the cause of any of these errors? @drunkvs has some cleaning up to do after the barf fest of the previous night…
I am trying to open Visual Studio, but it is giving an error:
cannot run when set up is in progress
It was running fine before when I restarted my machine. I have already installed this version from past one year.
Nicolas Raoul
58.3k58 gold badges220 silver badges370 bronze badges
asked Dec 18, 2014 at 3:34
9
Try to check Task Manager and kill any process related to Visual Studio (any version).
Update:
as many people mentioned in the comments it could be better to wait a while until those processes end themselves
answered Jun 11, 2015 at 8:11
George BotrosGeorge Botros
4,0873 gold badges28 silver badges49 bronze badges
9
I had this problem with Visual Studio 2017. There were processes in Task Manager named VSIXAutoUpdate.exe
. I watched Task Manager and they were spawning and despawning. A few times, a Visual Studio 2017 process would spawn and despawn.
After VSIX Auto Updater stopped showing up in Task Manager, it had applied all of it’s background updates and I was able to launch Visual Studio.
I wouldn’t recommend killing these processes in the middle of them installing updates, like other answers to this question suggest. Just wait until they finish by watching Task Manager.
Bruno Bieri
9,62411 gold badges63 silver badges90 bronze badges
answered Feb 5, 2018 at 21:33
Dewey VozelDewey Vozel
2,2071 gold badge19 silver badges22 bronze badges
6
Not exactly an answer to the original question, but if you really need to run VS during setup, you can use the undocumented /AllowDuringSetup
command line switch (at your own risk).
answered Dec 1, 2015 at 14:34
Tereza TomcovaTereza Tomcova
4,8784 gold badges30 silver badges29 bronze badges
This happened to me when I attempted to fire up Visual Studio just after start up.
I couldn’t see any Visual Studio or installer processes running in Task Manager, but I waited 5 minutes or so, tried again, and it opened.
answered Jul 2, 2017 at 12:26
TaranTaran
12.4k3 gold badges43 silver badges47 bronze badges
4
Root Cause:
If, We shutdown the system with out closing the visual studio properly and next time we will open the system then some times we will get this issue due to setup will run at background.
Fix:
No need to do any thing just wait for 10 to 15 minutes and open the visual studio again. It will automatically fix the issue.
answered Oct 10, 2018 at 5:02
I encountered this error today after a cold boot (on a VM) and found a solution.
- Windows > Services
- Look for a service with a name like ‘Visual Studio Standard Collector Service’
- Right click on the item and start the service => Visual Studio should now be able to launch
To prevent this from happening the next time you reboot (at least until there is an update that re-introduces the bug) you can:
- Right click on the item and select Properties
- Set the Startup type to ‘Automatic’
- Select Apply
Found using: VS Community 2019, Version 16.1.3
answered Jun 24, 2019 at 3:31
cragcrag
3893 silver badges6 bronze badges
4
Solution: Do not just open up Task Manager and Kill all processes that VSXAutoUpdate.exe is updating, this will give you problems when you try to start Visual Studio as updates were not complete. Instead, Wait until the update completes that is when you start the Visual Studio. If you no longer need the Visual Studio Component that is updating more regularly, again it is advised to uninstall the component via Visual Studio Installer
answered Feb 29, 2020 at 13:29
Try restarting your computer. That worked for me.
answered Jun 23, 2015 at 12:28
1
Go to task manager and end the VS Auto Update task. It will work fine.
answered Apr 5, 2019 at 4:20
JaiJai
611 silver badge1 bronze badge
It happended to me, I restarted the system but made no difference. Went to Task Manager
and there was a task VSIXAutoUpdate.exe
running.
I could have just killed it, but I waited for like 10 minutes and tried again opening the Visual Studio
and it worked.
Now you know what to do!
answered Mar 24, 2020 at 22:46
Baqer NaqviBaqer Naqvi
5,8623 gold badges47 silver badges68 bronze badges
1
A pending Windows update was the cause. After the Windows update Visual Studio starts without any problems.
answered Apr 26, 2021 at 5:27
1
Go to Task Manager. Under processes look for vns. Click End Process.
answered Jun 24, 2015 at 9:45
I get this error message when an update has been pushed to Visual Studio, but failed for some reason.
To fix this, follow the steps below (Windows)
Settings > Apps > Visual Studio Installer > Click ‘Modify’
You should see an error message saying something like «Updates could not be applied» and you can click the button to retry.
In my latest instance, it was a small update to the .NET Desktop Development Workload that hadn’t downloaded or installed correctly.
answered Sep 26, 2018 at 12:09
Open Task manager and stop the Visual Studio Process.
Clear out %temp% folder, and re-started VS2019.
This worked for me.
answered Jan 24, 2020 at 5:14
Most likely Visual Studio is being updated as the error message insinuates and if you wait a few minutes for the update to finish you should be able to run Visual Studio again without problems.
If the problem persists or if you’re just curious, open up your task manager and see if there is anything related to (Microsoft) Visual Studio running but don’t just kill the process. Check instead if the process is using any resources — if it has a high I/O count, then it’s actually updating and you should let it do its thing. If CPU-usage and memory usage remain mostly constant and there is no disk activity for the process for several minutes, this could mean that the process is stuck. You might have to kill it, but proceed with caution. Hopefully if this is an update for Visual Studio, the process name should include a version number or some sort of indication of what kind of update is being applied that you can use to search for more information through a search engine or through Microsoft’s online resources.
answered Apr 13, 2016 at 20:51
MellowMellow
7016 silver badges14 bronze badges
1
If none of the aforementioned solutions help (which was the case for me), I’ve got another suggestion. Go to the control panel, and under «Programs and Features», click «Uninstall a Program».
You’ll get this big window with all of your installed applications in it. If you tried to install an SDK or something and the program stopped working after that, find all the Visual Studio-related programs with an installation date that is the same as the date you began encountering the issue. Right click them, and if a ‘Repair’ option is available, click that. If not, click ‘Uninstall’, and then, in the window that opens after that, click ‘Repair’.
So essentially, you’re repairing everything Visual Studio-related that was installed on the same day you began seeing issues. It worked for me after installing an Azure SDK and seeing this error.
answered May 27, 2016 at 18:17
2
- Give some time and try again.
- End all the tasks related to visual studio in task manager.
- If both of these solutions doesn’t work then restart the machine it’ll definitely work.
answered Apr 9, 2021 at 6:31
0
enter image description here
Open the Task manager, there is a service named VSStandardCollectorService150 service, right-click to start it.
This is worked for me for the same issue on VS2019.
answered Jun 9, 2021 at 3:33
I had the same problem. My problem was VSIXAutoUpdate. I had waited until the end of the processing. You can see VSIXAutoUpdate in Task Manager (Ctrl + Alt + Del).
VSIAutoupdate could be a malware sometimes so you must check details inside the properties in Task Manager (right click on VSIXAutoUpdate).
You can see the web page below:
https://www.file.net/process/vsixautoupdate.exe.html
answered May 18, 2018 at 6:33
What I found on Task Manager was that a VS Preview 2019 version was updating while I was trying to start my production version of VS2017. Never had the problem before. I waited, as many others suggest, about 3 minutes and the problem subsided with not consequential repercussions. Felt a LOT better that way rather than nuking a task through Task Manager.
answered Feb 6, 2019 at 14:53
I cleared out my %temp% folder, and re-started VS2017.
started working fine.
answered Dec 19, 2019 at 1:56
ramyaramya
2,2606 gold badges30 silver badges57 bronze badges
I was facing the same issue when opening Microsoft Visual Studio Enterprise 2019 Version 16.4.2
inside my VM.
Here is the solution and this is what I did and it worked for me:
Don’t kill any process related to Visual Studio in Task Manager as it may end in unexpected behavior and even make you to reinstall
Visual Studio sometimes. So Simply wait for 5 to 10 minutes. All the
process related to Visual Studio will end automatically.
Now open your visual studio it will work normally.
answered Jan 10, 2020 at 17:42
fingers10fingers10
6,4338 gold badges49 silver badges82 bronze badges
Clearing the %temp% folder worked for me for the same issue on VS2019.
answered Jan 16, 2020 at 3:41
Instead of killing VSIXAutoUpdate.exe, you should be able to prevent it from starting as it seems to be run by the task scheduler. Go to the Microsoft/VisualStudio folder in the scheduler and you will see one or more tasks called VSIX Auto Update (I guess there’s one for each VS version installed). Right click and disable… You’ll probably lose the ability for VS extensions to get automatically updated, though — hopefully nothing more than that.
answered Apr 30, 2020 at 8:16
bdrajerbdrajer
7357 silver badges13 bronze badges
I have opened visual studio installer, clicked Modify, and launched the Visual Studio . It solved the issue.
answered Oct 21, 2021 at 4:40
Press Win+R and type %temp%
then delete all files, and restart Visual studio.
Check «Do this for all items» and press Skip button if required.
answered Feb 4, 2022 at 5:09
Ali MumtazAli Mumtaz
1311 silver badge9 bronze badges
Only way I found to ‘EASE’ the suffering is to open win 10 task manager and right click VSIXAutoUpate.exe, in context menu select go to details, right click the VSIXAutoUpate.exe again and in context menu select set priority and select realtime…… as I said this is to Ease the suffering not to end it
answered May 18, 2018 at 7:07
1
I experienced the same issue today(VS 2015 update 3). Noticed that the service «VSStandardCollectorService140» was stopped. (I had a blue screen error when i logged of yesterday. May be something related to that) . Restarted this service and it’s working
Stephen Rauch♦
47.4k31 gold badges105 silver badges134 bronze badges
answered Oct 8, 2018 at 0:12
JerryJerry
317 bronze badges
You can also just launch Visual Studio Installer. The installer seems to fix whatever is the background issue. You can then just launch your Visual Studio from the installer.
I just now resolved my issue this way.
answered Oct 1, 2019 at 15:48
Ray GoudieRay Goudie
1763 silver badges13 bronze badges
I started Windows Installer service from the windows task manager then the Visual Studio 2019 opened
(solution suggested here and worked for me)
answered Nov 22, 2019 at 13:23
TeoTeo
3202 silver badges9 bronze badges
0 / 0 / 0 Регистрация: 30.05.2015 Сообщений: 15 |
|
1 |
|
05.06.2015, 16:55. Показов 7764. Ответов 14
Почему Visual Studio показывает ошибку в том месте, где ее нет?
__________________ 0 |
45 / 42 / 48 Регистрация: 13.05.2015 Сообщений: 222 |
|
05.06.2015, 16:57 |
2 |
Можно немножко побольше подробностей и конкретики? 0 |
Don’t worry, be happy 17777 / 10542 / 2034 Регистрация: 27.09.2012 Сообщений: 26,510 Записей в блоге: 1 |
|
05.06.2015, 16:57 |
3 |
В большинстве случаев по той причине, что ошибка есть 0 |
Gangsta 0 / 0 / 0 Регистрация: 30.05.2015 Сообщений: 15 |
||||
05.06.2015, 16:59 [ТС] |
4 |
|||
Например
Здесь ошибка. Max(i, l) подчеркивает красной линией. А программа компилируется без ошибок 0 |
45 / 42 / 48 Регистрация: 13.05.2015 Сообщений: 222 |
|
05.06.2015, 16:59 |
5 |
Скорее всего это не баг, а фича 1 |
25 / 11 / 5 Регистрация: 11.01.2014 Сообщений: 85 |
|
05.06.2015, 17:00 |
6 |
Потому что твой Max уже существует в STL. 0 |
45 / 42 / 48 Регистрация: 13.05.2015 Сообщений: 222 |
|
05.06.2015, 17:03 |
7 |
Не компилится в VS 2008: Построение
1>Компиляция… 0 |
0 / 0 / 0 Регистрация: 30.05.2015 Сообщений: 15 |
|
05.06.2015, 17:06 [ТС] |
8 |
Скорее всего это не баг, а фича ну да В STL вроде бы нет Max. using namespace std; я не пишу Добавлено через 1 минуту
Не компилится в VS 2008: А у меня VS 2010 0 |
0 / 0 / 0 Регистрация: 30.05.2015 Сообщений: 15 |
|
05.06.2015, 17:12 [ТС] |
9 |
скрин Миниатюры
0 |
0 / 0 / 0 Регистрация: 30.05.2015 Сообщений: 15 |
|
05.06.2015, 17:12 [ТС] |
10 |
никто не знает? 0 |
Don’t worry, be happy 17777 / 10542 / 2034 Регистрация: 27.09.2012 Сообщений: 26,510 Записей в блоге: 1 |
|
05.06.2015, 17:16 |
11 |
РешениеВозможно из-за того, что в десятой студии фиговая поддержка 11-ого стандарта. Проверьте на VS2013 1 |
Dimension 591 / 459 / 223 Регистрация: 08.04.2014 Сообщений: 1,710 |
|
05.06.2015, 17:20 |
12 |
Проверьте на VS2013 запустил у себя ,норм все 1 |
0 / 0 / 0 Регистрация: 30.05.2015 Сообщений: 15 |
|
05.06.2015, 17:24 [ТС] |
13 |
Понятно. Надо Visual Studio менять 0 |
45 / 42 / 48 Регистрация: 13.05.2015 Сообщений: 222 |
|
05.06.2015, 17:25 |
14 |
Gangsta, можете попробовать совершенно другую IDE 1 |
43 / 43 / 12 Регистрация: 06.10.2014 Сообщений: 135 |
|
05.06.2015, 17:26 |
15 |
…подчеркивает красной линией. Замечал подобное и в VS2013 когда проект большой и/или открыто много файлов в редакторе. Иногда проходило само собой. Иногда после закрытия/открытия. 1 |
I’m having strange issues with Visual Studios 2015 Enterprise Edition and I couldn’t find solution online. I need to build a solution file that contains multiple sub-projects and solutions. I had created my own project and a solution within the main solution. When I build the main solution, build fails without Visual Studio showing any errors unless I changed the setting in one of the dropdown boxes from «Build+Intellisense» to «Build Only» (It’s one of those dropdown boxes in Error List window ). With «Build Only» setting, I can see several errors and they are all from my project. But majority of them don’t seem to apply anymore since I have fixed them. For instance, one error is invalid namespace and I received this error from not adding the reference assembly the namespace is declared. Since the reference is already added, I’m not sure why Visual Studio is still listing this error. Do I need to clear cache or something? I’ve tried cleaning the solution.
asked Aug 17, 2016 at 12:31
Ok, So I decided to go through all warnings and found out that some assemblies are built with higher .Net framework version (4.6.1) than my project (4.5.1). So I changed the Target framework of my project to 4.6.1. Voila, no more errors! For reference purpose, Target framework option is under project property.
answered Aug 17, 2016 at 13:24
KMCKMC
1,6413 gold badges24 silver badges53 bronze badges
I’m having strange issues with Visual Studios 2015 Enterprise Edition and I couldn’t find solution online. I need to build a solution file that contains multiple sub-projects and solutions. I had created my own project and a solution within the main solution. When I build the main solution, build fails without Visual Studio showing any errors unless I changed the setting in one of the dropdown boxes from «Build+Intellisense» to «Build Only» (It’s one of those dropdown boxes in Error List window ). With «Build Only» setting, I can see several errors and they are all from my project. But majority of them don’t seem to apply anymore since I have fixed them. For instance, one error is invalid namespace and I received this error from not adding the reference assembly the namespace is declared. Since the reference is already added, I’m not sure why Visual Studio is still listing this error. Do I need to clear cache or something? I’ve tried cleaning the solution.
asked Aug 17, 2016 at 12:31
Ok, So I decided to go through all warnings and found out that some assemblies are built with higher .Net framework version (4.6.1) than my project (4.5.1). So I changed the Target framework of my project to 4.6.1. Voila, no more errors! For reference purpose, Target framework option is under project property.
answered Aug 17, 2016 at 13:24
KMCKMC
1,6413 gold badges24 silver badges53 bronze badges
Здесь коллекция популярных ответов. Upvote ОП ответа, если он помог вам:
Вариант 1. Очистка, сборка и обновление (опция @Mike Fuchs)
Как упомянул @Mike Fuchs, попробуйте следующие операции:
В меню «Построение»> «Чистое решение».
А также
В меню Build> Build Solution
и выберите проект, о котором идет речь, и нажмите кнопку обновления:
Вариант 2: очистить, закрыть, перезапустить и построить (опция @Pixel)
Как упоминалось @Pixel, попробуйте следующую последовательность операций:
- Чистый раствор
- Закрыть Visual Studio
- Откройте Visual Studio
- Построить решение
Вариант 3: очистить кеш ReSharper (опция @CydrickT)
Если у вас есть ReSharper, попробуйте очистить кеш ReSharper:
В меню ReSharper> Параметры> Среда> Общие> Очистить кэш
и отключение и повторное включение ReSharper:
В меню Инструменты> Параметры> ReSharper> Общие> Приостановить/Восстановить
Вариант 4. Удалите файл .suo (опция @Neolisk).
Как уже упоминалось @Neolisk, удаление файла .suo может решить вашу проблему. Для Visual Studio 2015 файл находится в:
[Путь решения]/. Vs/[Имя решения]/v14/.suo
И для Visual Studio 2017:
[Путь решения]/. Vs/[Имя решения]/v15/.suo
Обратите внимание, что каталог .vs скрыт.
Вариант 5: выгрузить и перезагрузить проект (опция @TTT)
Как упоминалось в @TTT, попробуйте выгрузить проект, который вызывает проблемы:
В обозревателе решений щелкните правой кнопкой мыши проект «Выгрузить проект».
И перезагрузить его
В обозревателе решений щелкните правой кнопкой мыши проект «Перезагрузить проект».
Вариант 6: удалить и добавить ссылку на Microsoft.CSharp (опция @Guilherme)
Как упомянул @Guilherme, попробуйте удалить и добавить ссылку на «Microsoft.CSharp» из проектов, в которых есть проблемы.
В обозревателе решений разверните проект, разверните «Ссылки», щелкните правой кнопкой мыши «Microsoft.CSharp» и выберите «Удалить».
Затем щелкните правой кнопкой мыши References> Add Reference, выберите «Microsoft.CSharp» из списка и нажмите «OK».
It’s always fun when Visual Studio (ie @drunkvs) can’t recite the alphabet backwards: The code below builds just fine when running through the compiler, but Visual Studio displays Intellisense errors in the Error Window and in the code with underlined squiggles:
The actual build of the code succeeds, but Intellisense is flagging several classes as missing even though they clearly exist and clearly compile properly.
IntelliSense is High!
So IntelliSense sometimes goes off the rails and if you see errors in your project that don’t make sense, first check to see if the errors are related to Intellisense.
Notice the drop down in the error list that lets you see Build + Intellisense which, in the case above produces 3 errors, but no errors if I just show Build Only:
Note the Intellisense error drop down is a new feature so you may not see it in older versions of Visual Studio. Not sure when it arrived but it was in one of the late VS 2015.x updates.
Clearing up Intellisense
There’s usually a simple solution when IntelliSense decides to sleep one off:
Delete the .vs
folder
The .vs
folder holds solution related temp data including the .suo
file that caches intellisense and some debug data. That folder also holds Web site configuration data for Web projects and a few other things. It’s safe to delete this folder — Visual Studio recreates it when it’s missing.
Older versions of Visual Studio (prior to VS 2015) didn’t have a separate folder and dumped that same information into files in the solution’s root folder.
In these older versions you can fix Intellisense issues by deleting the Solution’s .suo
file. Deleting the .vs
folder in newer version nukes the .suo
file which is responsible for cached IntelliSense and also some cached Debug data. When VS acts up and reports whacky errors that seem wrong, the burning down the .suo
file is a nice quick thing to try first.
To do this:
- Shut down VS
- Nuke the
.vs
folder or the.suo
file - Restart VS
The .suo
file contains cached IntelliSense data and once that file is off, no amount of recompilation or clearing the project is going to help. Nuke the .suo
file. or in VS 2015 or later the .vs
folder and get back to sanity.
Compiler Errors?
I haven’t run into this problem very frequently but when it does happen it’s usually quite vexing resulting (for me at least) in a flurry of deleting output folders.
I have a standard set of steps I tend to go through when I get compiler errors that are wrong. Well, usually it’s me who’s wrong, not the compiler but on occasion I get to be right and the compiler is really wrong.
If you have errors that show under the Build Only
dropdown, then the issue isn’t Intellisense.
This has gotten a lot better, but for a while invalid compiler errors were a big problem with the .NET SDK projects (.NET Core / .NET Standard) and in those cases the solution for me usually is (and still occasionally is):
- Delete the
obj
folder completely - Delete the
bin
folder completely
While Visual Studio’s Clean
project feature is supposed to address this, Clean will only clean up files the project knows about. If you’ve removed or renamed assemblies there may still be left over files in project output folders and deleting them cleans out the project completely.
This often fixes odd left over file issues that can cause strange compilation behavior. I never really considered Intellisense failure previously because Visual Studio didn’t differentiate compiler and IntelliSense Errors (or more accruately I didn’t notice the dropdown). I’d see errors in the Error list, yet my project would compile successfully, which was even more confusing.
Back to the Straight And Narrow
It’s nice that Visual Studio now explicitly shows these errors separately as Build and Intellisense errors, so you can take the sepearate actions to clean up this mess. In the past when the errors weren’t separated it was even more confusing with compiles succeeding, but the error list showing errors.
Now as to the cause of any of these errors? @drunkvs has some cleaning up to do after the barf fest of the previous night…
Привет всем!
Сегодня решил попрактиковаться в написании программ с использованием библиотеки OpenCV версии 2.4.13.
Скачал, установил по инструкции, вошел в MSVS 2013, создал пустой проект на С++. В свойствах проекта поставил пути к папкам либов, пути к инклюд папкам (ко всем), сами либы в настройках компоновщика (во вкладке ввод),
и даже пути к папкам модулей OpenCV (тоже ко всем). Вбил вот этот код:
#include <opencv2/opencv.hpp> int main(int argc, char** argv) { // задаём высоту и ширину картинки int height = 620; int width = 440; // задаём точку для вывода текста CvPoint pt = cvPoint(height / 4, width / 2); // Создаёи 8-битную, 3-канальную картинку IplImage* hw = cvCreateImage(cvSize(height, width), 8, 3); // заливаем картинку чёрным цветом cvSet(hw, cvScalar(0, 0, 0)); // инициализация шрифта CvFont font; cvInitFont(&font, CV_FONT_HERSHEY_COMPLEX, 1.0, 1.0, 0, 1, CV_AA); // используя шрифт выводим на картинку текст cvPutText(hw, "OpenCV Step By Step", pt, &font, CV_RGB(150, 0, 150)); // создаём окошко cvNamedWindow("Hello World", 0); // показываем картинку в созданном окне cvShowImage("Hello World", hw); // ждём нажатия клавиши cvWaitKey(0); // освобождаем ресурсы cvReleaseImage(&hw); cvDestroyWindow("Hello World"); return 0; }
Жмякаю Отладка-Запуск без отладки- пишет следующий проект устарел: название проекта. Выполнить его сборку? Жму Да. Выдает: возникли ошибки сборки. продолжить и запустить последний успешно построенный вариант? Жму нет. Да не жму, т.к.
я недавно скомпилировал кривой код, который к сожалению не могу восстановить, он скомпилировался без ошибок, и теперь когда жму Да, открывается кривая консолька, с непонятными ошибками.
Собственно, когда нажал Нет, пишет кучу ошибок, а именно:
Ошибка 1
error LNK2019: ссылка на неразрешенный внешний символ _cvCreateImage в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 2
error LNK2019: ссылка на неразрешенный внешний символ _cvReleaseImage в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 3
error LNK2019: ссылка на неразрешенный внешний символ _cvSet в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 4
error LNK2019: ссылка на неразрешенный внешний символ _cvInitFont в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 5
error LNK2019: ссылка на неразрешенный внешний символ _cvPutText в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 6
error LNK2019: ссылка на неразрешенный внешний символ _cvNamedWindow в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 7
error LNK2019: ссылка на неразрешенный внешний символ _cvShowImage в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 8
error LNK2019: ссылка на неразрешенный внешний символ _cvDestroyWindow в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 9
error LNK2019: ссылка на неразрешенный внешний символ _cvWaitKey в функции _main
c:UsersDaniildocumentsvisual studio 2013ProjectsTestARTestARmain.obj
TestAR
Ошибка 10
error LNK1120: неразрешенных внешних элементов: 9
c:usersdaniildocumentsvisual studio 2013ProjectsTestARDebugTestAR.exe
TestAR
Вот такие вот дела. Надеюсь, поможете.
Заранее спасибо.
P.S. код скопипастил с сайта с инструкцией.