How Can I Fix This LNK1104 Error in Visual Studio? - c++

First off, allow me to give you some background. I'm attempting to emulate a game from my childhood. A lot of work has been done with respect to emulating said game, and I've made some decent progress through the windows setup guide that can be found here.
I recommend taking a look at that first, because knowing the prior steps I've done will probably help in answering this.
Currently I'm on step 10, building the Vana solution. When I build it in Visual Studio 2019, I encounter 3 errors. The login, channel, and world server projects cannot open “libmysql.lib”. The output is as follows:
LINK : fatal error LNK1104: cannot open file 'libmysql.lib'
And under the error list it reads:
LNK1104 cannot open file 'libmysql.lib'
It’s not telling me why it cannot open it, it just says that it can’t open it. It’s not giving me any location, or much clues as to what exactly I should do. I found “libmysql.lib” within the MySQL server community 8 folder and I put the file within the SQL folder in the “LazurBeemz” directory, but got the same error.
I then tried putting it into the MySQL server 5.0 folder because that’s where I pointed the “LazurBeemz” pack to, unfortunately I got the same exact errors. Honestly I have no idea where exactly I should put it or why I’m getting these errors. It’s beyond me. I checked the specifics of the error code (LNK1104), and it has a PLETHORA of possibilities. The main thing I need to know is WHERE should this file go?
Any Thoughts?
Here is a picture of the error messages

First, you need to find out the file directory where the libmysql.lib is located.
Then, you could select Properties->Linker->General->Additional Library Directories-><Edit...> and add libmysql.lib file storage directory.
Finally, you could select Properties->Linker->Input->Additional Dependencies and add the name of libmysql.lib.
Note: You need to perform similar operations on debug version and release version.

Related

How to set up wxWidgets 3.1.0 with Visual Studio 2015

I am somewhat of a beginner when it comes to open source libraries. I have tried to compile from source and use the pre-built binaries, but in both cases I get a ton of errors when I try to run the simple 'Hello World' program on the tutorial section of the wxWidgets website. After playing around for quite some time, the closest I have got to compiling is by building the libraries from source, but I still have 2 errors remaining:
"_w64 can only be specified on int, long, and pointer types" file: defs.h
"cannot open file 'wxbase31ud.lib" - LINK
It seems strange to me that the header file provided by wx would have an error such as that one, so I imagine both errors are because of something I am doing. I am hoping that someone here can do one of the following for me:
Help me solve these errors
Provide instructions for building libraries from source and subsequently linking my program to the correct directories
Some additional info: I am working on x64 Windows 7, my target will also be x64 exclusively. I do not have admin privileges, so no editing the system PATH for me.
Thanks for your help!
The simplest way to start working with the library is this:
Grab the sources.
Unpack the sources.
Open VS IDE.
Open \build\msw\wx-vc14.sln (adjust as necessary.)
Go to "Build->Batch Build...", click "Select All", "Build".
Go drink some coffee or watch TV.
After the build finishes, open wxWidgets/samples/minimal/minimal_vc9.sln.
Let MSVC convert the solution to become an appropriate format.
Build and run the sample.
If you will acquire any issue during those steps, let us know.
The library build in step 5 should build without any issues and then all you will need is to build the minimal sample.
The next step is to copy the samples\minimal folder somewhere and start writing the code. All you will need to do is to change the Include and Lib search path.
[EDIT]
If you can build the 32-bit libraries (which are default in the provided solutions) all you will need is to convert them to be 64-bit and rebuild.
There is no changes to the $PATH or any environmental variable involved. Moreover you shouldn't build anything with the admin priviledges.
Also as Thomas pointed out you library build has to match whatever sample you are trying to build.
[/EDIT]

How to compile/migrate a Visual Studio solution from a machine to another?

Recently I obtained a solution which has been created on another person's machine. I have been banging my head into the monitor in the past 2 days trying to fully migrate the solution to my machine. I have been manually changing the directory addresses of the solution and have not been able to compile the solution although I think I have corrected more than 100 paths as of now. Here's my first attempts to migrate the solution to my machine and resolve the issue of not being able to open any of the files.
Now I can open all the files in each project on my machine (after manually changing their paths). However, I am still getting the same errors and I'm not able to compile the project. Below is a picture of the errors I'm getting:
And here's the output log when trying to compile the project. So I wonder, can someone give me some advise on how I should go about doing the whole process automatically? In the output log I see there is a F:\Virtual ... path which indicates the solution been created on a virtual machine. However, I am not using a virtual machine and am not able to find the file file containing that path (F:...) so that I can change it to the correct one (I even do not know what the correct one should be since I am not using a VM).
If you are not able to help me through the description I gave or the output log file, you can download the whole solution from here and then give me some instructions on how I should go about compiling and using it. I really appreciate your help.
Chances are that someone went rogue on the project file, because normally all paths are defined in a way that is relative to the project or solution, making them portable.
In order to fix this, I see two options, either set up the project files from scratch or keep on hacking on them until they compile. Whichever path you take, keep in mind that VS supports placeholders like $(SolutionDir) you can refer to when setting up paths. If that doesn't work, please try to extract a minimal example.
Also, make sure you have a version control system set up, so you can retrace your steps. This should be standard in any software development, but considering the state of the project I wouldn't be surprised to find other, hairy places there.

How to fix "error C1083: Cannot open source file:" in Visual Studio C++

I was beginning to use Visual Studio 2013 to work with OpenCV.
I had completed a simple project that I need and was just doing some cleanup.
The compiler begin giving the message.
error C1083: Cannot open source file:
What I have tried so far:
Creating a new console application in a separate file and trying to compile it, just created . -> same error.
Repairing Visual Studio using the original installation disk. -> same result on new just created project "error c1083;
Uninstalling Visual Studio and then reinstalling it. -> same result on new just created project "error c1083"
Things I have noticed. My compiler is not creating a .pch file or at least I cannot find it. I have precompiled headers enabled. /Yc for stdafx.cpp and /Yu. for other files if I have any.
If I use a previously created project that was working the IDE will run it, but if I change anything in the source file I get the same error.
I have tried placing projects in very short paths and in the normal location for the compiler.
Solution explorer sees and will open the source file.
I am beginning to think something is corrupted in my operating system. (Windows 7).
I have been thinking I might format the disk and reinstall Windows, but thought I might ask for suggestions on this problem first.
"
What do you mean by 'doing some cleanup'? It is quite unlikely that your OS is corrupted. There is probably something wrong with your project properties, but I couldn't tell you what without better information"
This was just a simple project to place cross hairs on the input from a USB microscope which was spindle mounted on a CNC milling machine for centering purposes. I was just changing the on screen position and size of the cross hairs. Then when I recompiled the problem started. I thought it might be a corrupted file because of the fact that it persisted after uninstalling and reinstalling Visual Studio. The fact that a freshly generated project would not compile made me suspicious.
"
Looks like something in your Project/Properties is not right. It is looking for the files in the wrong directory"
You are probably correct, but I am a novice and have spent many hours trying to find what it may be any suggestions for what settings to change would be greatly appreciated.
"
Do your TMP and TEMP environment variables point to directories that (1) exist (2) you have write permission to and (3) have free space? "
Yes sir The environment variables are set and the directory has read write permission. There is > 1T of free disk space.
"
Also try (with VS closed) deleting the registry keys HKCU\Software\Microsoft\VisualStudio\12.0 and 12.0_Config and the directory %LOCALAPPDATA%\Microsoft\VisualStudio\12.0, then open VS and try again with a fresh project. This will cause VS to regenerate all caches and "transient" information (it will also reset all your settings, so beware)."
Sir: I deleted the keys and the directory you recommended, generated a fresh project and tried to compile it. The compiler generated the same error. I genuinely appreciate the suggestion.
"VS only allows closed source development"
Pointed, consider the source of VS.

vpxmt.lib for vs2012 1.3

3 vpxmt.lib for 2012. I've tried to build it but I keep running into new problems. It seems like one of those projects that will take a long time to setup with one dependency issue after another. I'm wondering if someone either has the .lib files that can post or can tell me how to solve this next problem.
I was following the guide here:
http://www.webmproject.org/code/build-prerequisites/
I was able to produce vpx.sln in the .lib directory. But when I convert and build the project I get these 100's of these errors.
LINK : fatal error LNK1181: cannot open input file 'vpxmt.lib'
This is like the 6th dependency issue I've run into.
PS: Honestly if google actually actually wants vp9 to be taken up they should just provide us with prebuild libraries on windows (I imagine linux people are use to this) and not make us spend days trying to get the correct configuration settings.

LNK 1104 error to lib file - Continues despite removing includes and links

A link error to a lib file popped up out of the blue in a c++ application of mine after code was working fine in my last session.
Error 1 error LNK1104: cannot open file '..........\Program Files
(x86)\FMOD SoundSystem\FMOD Programmers API
Windows\api\lib\fmodex_vc.lib'
I triple checked my project directories were set up correctly to link to the lib file, that the file existed in said directory and that it was a working version of the .lib.
My next step was to remove the includes to the file and the links to bypass the error and work on the rest of my code until the problem was solved. The error remains, however, despite:
Commenting out absolutely every include relating to the lib.
Commenting out absolutely every line of code dependant on the includes.
Removing the directory from VC++ Directories in the project properties.
Checking the Additional Library Directories field was also clear of references.
To my understanding this should have made the library and related code virtually non-existant to the compiler.
What am I missing?
The library itself is fmodex_vc.lib - part of the FMOD API for providing sound to interactive applications.
Again, the application was working one session, but failed to compile the next. I hadn't touched the code since so this led me to believe some aspect of VS is at fault. I'd like to avoid the time involded in re-installing if possible as I'm on the clock for a review tomorrow evening and there are a few more things I'd like to smooth out before then. If necessary, however, I won't hesitate.
Very much appreciate the help.