Getting [fatal error C1007: unrecognized flag '-archVFPv3-D32' in 'p2'] error while compiling win8 app - c++

Sometimes I getting this error:
fatal error C1007: unrecognized flag '-archVFPv3-D32' in 'p2'
Visual Studio 2013, Windows Store app (c++ and c# projects).
It seems that full rebuild resolve this problem - until next time.
Any ideas?
Thanks

This can also occur when you have changed the compiler and the static libs that you are linking to are compiled using a different compiler. E.g. different versions of MSVC compilers.

I got this problem too. And my mistake was:
1) Using .lib file which compiled how a Debug and i use him in Release mode app
In general, my app was get old .lib with old parameters from error link.
I updated parameter in Configuration Properties -> Linker -> General -> Additional Library Directories and all works at fine.

Related

Building protobuf for Linux using VS2017

I have configured VS2017 to build Linux C++ by remote building on a Linux Mint VM.
I tried a simple C++ program and it compiles and executes fine, the thing is that now I need to add a generated protobuf source and the linking fails constantly.
On the Linux VM the protobuf generated files are building correctly and I was able to execute the gRPC examples.
The errors I get when I build from VS2017 are a lot of:
undefined reference to 'google::protobuf::internal'
and there is also this one
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Application Type\Linux\1.0\Linux.targets(262,5): error : Illegal characters in path.
I think this is a VS2017 remote compilation configuration issue, but I don't know what could it be.
Has it happened to you? Do you know how to solve this issue?
Thanks
SOLUTION: I the project properties go to Linker > All Options > Library dependencies and add: protobuf;pthread;grpc++;grpc
This explains the "Illegal characters in path" message.
Does protobuf link to any libraries on the Linux system? Assuming you're not using CMake, have you added the libraries andtheir path(s) to the Visual Studio project - Library Dependencies and Additional Library Directories.
This might help with specifying libraries.

pmdaccess2.dll is missing even though code compiles with no error

My code compiles correctly but when I start without debugging it gives the following error:
pmdaccess2.dll is missing
I have provided the link to this dll in the Linker->general section however I get this error. Any idea why this is happening and how to fix it?
I am using Visual Studio 2015 64bit in Windows 10 and my PMD camera is connected to USB3.
A dynamic library is linked to at runtime. The library needs to be located in the same directory as the executable or in a directory specified in the PATH environment variable.

Linking libpqxx from Visual Studio 2015 on Windows 10

I've recently decided to try out PostgreSQL as the database platform for some C++ development I'm working on. I decided to use libpqxx as the connection library for my project, and quickly found out this would be an uphill battle to do from VS 2015 on a Windows 10 machine.
After much teeth-gnashing and nail-biting, I have gotten libpqxx to compile on Windows 10.
This leaves me with the following directory structure
Per libpqxx's documentation, I also placed a copy of libpq.dll in my project's executable directory. Please note: I have done this for both debug and release builds, tried to build both, and ended up with the same result.
All the tutorials I've seen seem to indicate that the library can be used after linking it and simply #including pqxx/pqxx, so I set up a small project to do just that. I receive the error:
fatal error C1083: Cannot open include file: 'pqxx/pqxx': No such file or directory
When attempting to build the project. I have also tried this will both debug and release builds, to no avail.
Here is a screenshot of my linker settings.
Does anyone have any suggestions for how I might be able to link and use this library from Visual Studio 2015?
As Sami Kuhmonen pointed out, this was not actually a linker error, but a compiler error. I needed to include an actual header, which Visual Studio needed to be able to find. After adding the correct folder (C:\libpqxx\include in my case) to Visual Studio's "additional include directories" setting under C\C++ -> General per drescherjm's suggestion, the program compiles just fine.
For future reference:
I did also run into unresolved external linker errors after solving the initial issue. This is because you need to make sure to also link to ws2_32.lib and libpq.lib. You also need to copy some other DLL files that libpq also relies on into your libpqxx lib folder. On my system, I believe these were ssleay32.dll, libeay32.dll, and libintl-8.dll. These files reside under the root of the PostgreSQL install. The DLL step is mentioned under libpqxx's INSTALL.txt file, however I believe it stated that the DLLs resided one folder under where I actually found them.
I have also faced same issue. Then I realized that I was building ,my application as a 32bit. I changed the target to x64 and it compiled successfully

mfc42u.dll Error while migrating from VC6 to VS2005

I have migrated my VC6 application to VS2005, all my code got compiled with some changes and there is no compilation error.
But I am getting a linking error LNK1104.
LINK : fatal error LNK1104: cannot open file 'mfc42u.lib'
I have imported the dsw of VC6 in Visual Studio 2005, not sure from where it is still referring to the mfc42u.lib (I assume its library of VC6).
Please guide me how to get rid of this error.
This library is referred from Linker section of your project settings, specifically "Additional libraries" or something like this (do not remember the name of the setting exactly) - there are libraries needed to be linked with listed there. So just replace the mfc42u.lib with mfc8u.lib or whatever is the relevant version of mfc installed with your VS distribution there.
probably your linker settings aren't set properly. Go to Project Settings->Configuration->General->Use MFC Libraries and make sure the value is set to 'Use MFC in a shared library'. If you are able to build properly, then you can change it back to 'Static' to use the new library.

LINK : fatal error LNK1104: cannot open file "Iphlpapi.lib"

So I'm using Visual C++ 6.0, and trying to compile some source code, but upon compilation I get this:
Linking...
LINK : fatal error LNK1104: cannot open file "Iphlpapi.lib"
Error executing link.exe.
I'm using the correct SDK, and the directories are correct. I've checked, double checked, and triple checked. The file is the specified directory. I can't figure out what the problem is. Any ideas?
Service Pack 6
SDK for Windows Server 2003 SP1 //Sounds odd, since I'm running XP SP3, but this has worked for me in the past.
Like I've said, it worked in the past for me, flawlessly. I don't understand why it won't work now.
I'm sure that you have some problems with your project configuration. Try moving that file to the folder with your source code. Check the way you add it (via input libraries) to your project. Try creating a new project and moving that .lib into your code folder (after adding it to used libraries).
sysinternals procmon will show you where the build is looking. wont fix it but will give you a clue
(tools)
(options)
(directories) tab
(show directories for ) library files
In general, you want the path that includes the missing library to be included there.
so that all projects can find it.
The other option would be to add the library to your project using
(right click on the project)
(add files to project)
browse to, and add the library
One of those two methods should do the job for you
Maybe am very late to this discussion, the following solution worked for me.
The only setting required was to include the path to the library.
In VC++ 6.0, go to Tools -> Options -> Directories tab -> Select "LibraryFiles option" under "ShowDirectories" dropdown.
Add the path to the library, in my case the path is "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"
compile using command prompt, Check the syntax, are the white spaces correctly placed e.g "cl practice.cpp /clr:safe /doc" is executed properly but "cl practice.cpp/clr:safe/doc" produces the error u mentioned