I'm currently going though a game programming book and am trying to compile some directx9 code
I have the latests DirectX11 SDK and the code has these lines of code
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
But I get
LINK : fatal error LNK1104: cannot open file 'd3dc9.lib'
I don't know how to set it up to find this file although in fact I don't get why it asks for it since it isn't inside the Lib file for the DirectX 11 SDK and isn't what i've asked for.
The linker only knows the name of the .lib file, it doesn't know what directory it is stored in. Project + Properties, Linker, General, Additional Library Directories setting.
The version 11 SDK is quite new. You may need an older version of the SDK if these .libs are no longer distributed. I know the June 2010 edition has them. Download is here.
Related
I am trying to build Quantlib using Boost Libraries.
I followed the instructions here: and also on the Quantlib website.
I downloaded and unzipped boost_1_57_0 into C:\program files
I then used the Visual Studio 2013 x64 Native prompt to go to the boost directory and ran
bootstrap.bat
and then
b2 --toolset=msvc --build-type=complete architecture=x86 address-model=64 stage
Then I opened Quantlib_vc12.sln in Visual Studio 2013.
Picked "Release" and "x64", opened "Quantlib" in Property Manager and set the VC++ Directories.
In the include directories I added C:\Programm Files\boost_1_57_0
In the Library Directories I added C:\Program Files\boost_1_57_0\stage\lib
Then I went to the Solution Explorer and right clicked and chose build.
I got one LNK1104 error.
LNK1104: cannot open file 'libboost_unit_test_framework-vc120-mt-1_57.lib
Please see attached screenshot:
I have no idea how to fix this and I would really appreciate some help. I had successfully installed this at work using an admin account but was not able to access Quantlib using my user account. I have since deleted and attempted installations atleast 15 times but it's not working. I am worried that all these attempts at installing may have messed something else up, like some registry (I have no idea how that works but I only know to be afraid). Please help! Thanks.
UPDATE: Still get the same error after adding BOOST_AUTO_LINK_NOMANGLE define to project.
UPDATE2: I am getting these messages on the screen while running b2 to build boost. Is this an error I need to fix?
This is exactly what I warned you about in another related question/answer. What's happening here is that the boost headers you are including in this quantlib are (through macros) detecting that you're using MSVC, detecting the version, then automatically linking the required DLL files to build quantlib using #pragma comment(lib....). So even though under Project Settings -> C/C++ -> Linker there are no external DLL's or Lib's specified, they're still being linked by these pragma statements.
So when these macros are detecting your compiler and so on, they're dynamically building a string name of what they think the required libraries would be named on your system. Remember when you built boost, you specified the -layout option. This the naming layout of your boost libraries. Well by default, that layout is something like this:
LIB_LIBRARY_NAME_COMPILER_VERSION_SingleOrMultiThreaded_BOOST_VERSION.LIB
Which in practice looks like this:
libboost_unit_test_framework-vc120-mt-1_57.lib
This is boost "mangling" the name of your library to be as descriptive as possible about how the libraries were build so that, just by glancing at the file name, you know. What we do with -layout=system is tell the boost build system NOT to mangle the names, but to name them according to what option we gave to "layout". Since we chose layout=system, boost is going to name our libraries like this:
LIB_LIBRARY_NAME.LIB
Which in practice will produce:
libboost_unit_test_framework.lib
So when we start using boost after doing this (with MSVC only does this happen), these dynamically generated linker statements don't give a rip about or know about what -layout option you built boost with. They will attempt to link in required libraries using the fully mangled naming format, which is why you get the error:
cannot open file 'libboost_unit_test_framework-vc120-mt-1_57.lib
.. because you don't have a file named that! That's the mangled name! You have a file named libboost_unit_test_framework.lib. See the difference! So, you need to tell these stupid macros to stop mangling the library names when auto-linking required libraries. You do that by adding the following preprocessor definition to your Quantlib project:
BOOST_AUTO_LINK_NOMANGLE
You add that in Project Settings -> C/C++ -> Preprocessor -> Preprocessor definitions.
If you'd rather avoid this headache and don't care about the long and (imo ugly) mangling that boost does to library names, you can build boost omitting the -layout option and it will default to this mangled naming convention, where you shouldn't get stuck on this error at all anymore. I personally put out the effort to keep nice short/clean library names but it's all about preference.
Edit
Since you have the same error after fixing the NO_MANGLE problem, then the only possible reason that you're getting this particular link error is that you do not have whatever file the linker is complaining about missing stored in any of the directories supplied to the linker.
Verify the folders/paths you provide to the linker and verify that the file the linker is looking for is in one of the directories that you're providing to the linker. You have to provide directories to the linker because you're telling the linker "you can look in all of these places for the libraries my project needs". If you specify none, it's got nowhere to look. :(
Example:
There was a similar question (here or on some related SE site), but I didn't find so I ask a new question (if you find it, send a link and vote to close this question if they are too similar).
I have finished installing WxWidgets (configure; make; make install), but while installing PgAdmin III 1.16 the make console doesn't recognize WxWidgets as installed. I found that absence of Unicode might be a problem in this case, but I have enabled the Unicode. What else should I do?
I have 32bit Windows XP and WxWidgets 2.9.4. Including PostgreSQL 9.1.3 went OK.
EDIT: I tried another way - through Visual Studio and Visual C++. I don't know if my problem is the same or just similar, but Visual Studio reports this error:
error C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory
followed by 100 of other errors which seem to be conclusion of this one (mostly undefined types/functions with names beginning with "wx"). I added semicolons to the header (as was suggested here - fourth entry after "all replies"), but it didn't help. I also tried to add "include" and "lib" directories in WxWidgets to include path for every project, but no joy here.
Do anybody know how to solve it?
You need to point pgAdmin to wxWidgets installation under Windows. Its build instruction should explain how to do it but you must set up the include path (-I compiler option) and the libraries path (-L linker option) for it to compile and link properly.
Notice that for the include paths you must put the directory containing the wx/setup.h file generated during the build by configure first and the directory with all the rest of wx headers later.
Also, it probably goes without saying, but you must use the same compiler to build both wxWidgets and pgAdmin, so if you built wx using configure+make you can't use MSVC for pgAdmin.
So I'm trying to compile a DX9 program that include the headers d3d9.h and d3dx9.h. However it keeps getting a fatal error trying to find d3dx9.lib. What's interesting is that when I try to input d3dx9.h it shows up as in "Microsoft SDKs\Windows..." and in "Microsoft DirectX SDK...". I have set up the include and library directories under VC++ Directories for the project. I get no errors in the code, but only when compiling. DirectX (June 2010) did install correctly, so I'm not sure what could be causing this, any help?
There is no d3d9x.lib, you probably transposed the letters. It is d3dx9.lib. Check your linker settings for the name, maybe a #pragma comment in your code.
If you are sure you got it right then use the Linker, Input, Ignore Specific Library setting.
I'm using the Boost Windows installer provided by boostpro.com and already have all the compiled binaries present in my boost_1.44/lib folder. However, when I'm trying to use the boost filesystem library, I'm getting a build error saying that
LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_44.lib'
I'm using Visual Studio 9, and I don't have a file called 'libboost_system-vc90-mt-gd-1_44.lib'. Any ideas on what I should do next?
You either need to compile the variant of Boost with "threading=multi runtime-debugging=on variant=debug" as that's not a variant that normally comes with the BoostPro installer (AFAIK); or switch your project to use a different variant. Most likely you need to turn off the "runtime-debugging=on" in VC, which translates to turning off the debug STD. See the Getting Started for what the name of the library it's asking for means.
I have the 2007 directx sdk include directory set as the first entry in the Include Files directory list in Visual C++ 2005, and that directory contains dxtrans.h. Yet when I try to build my project, I get "To compile qedit.h you must install the DirectX 9 SDK, to obtain the dxtrans.h header.", accompanied by hundreds of syntax errors in windows sdk headers (amstream.h, qedit.h, etc). Is there some other magic incantation I need to perform in order to get the compiler to find dxtrans.h? Is the error message a red herring?
open a new fileļ¼ dxtrans.h
please paste follow content into the file, then move file to C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
/* Fixes issue with Windows SDK */
#define __IDxtCompositor_INTERFACE_DEFINED__
#define __IDxtAlphaSetter_INTERFACE_DEFINED__
#define __IDxtJpeg_INTERFACE_DEFINED__
#define __IDxtKey_INTERFACE_DEFINED__
Yes, it is indeed a red herring. That message is always displayed:
#pragma message("To compile qedit.h you must install the DirectX 9 SDK, to obtain the dxtrans.h header.")
Pay attention to the first few real compiler error messages, whatever they may be.