Assimp linker error Visual Studio 2013 - invalid or corrupt file - visual-studio-2013

I am trying to make assimp work with Visual Studio 2013, but I always get this error:
Error 1 LNK1107: invalid or corrupt file: cannot read at 0x2F0
I followed all the steps here -> Assimp model loading library install/linking troubles
Built assimp from source using cmake, Visual Studio 12 2013 and put the includes and generated dll file in the solution folder. Added the paths in visual studio VC++ Directories (Include, library), C++ (Additional include dirs), Linker (Additional Library dirs, Additional Dependencies).
Am I missing something?
In addition, can someone suggest some other tools to read obj files and load vertex/index/texture buffers directly from the file?

You need to link against the assimp.lib, not against the assimp.dll. The lib is used to say your aplication that it has to load the dll when starting your application.

Related

How to link the external .lib into the Fortran

screenshot of the error
I am trying to recompile a Fortran projects using Intel Visual Fortran (Parallel Studio XE 2017) with MS Visual Studio 2013. The code uses a couple of external .lib files in the Fortran script which are:-
use m21df
use Mzcalendar
I have the .lib with me, but i am having problem to link them. When i compile the project, it gave me error #7002: Error in opening the compiled module file. Check INCLUDE paths.
What can I do to fix this problem whereby make my script recognizes the .lib files?

Prevent Visual Studio from using cached .pdbs

I did the following experiment: I created a statically linked C++ library solution MyLibrary (I took the code from the MSDN example: https://msdn.microsoft.com/en-us/library/ms235627.aspx.) and built it. Then I created another C++ solution MyConsoleApp, using the console application template in Visual Studio (2017). I copied the MyLibrary.lib file to the root of MyConsoleApp project and added MyLibrary.lib to Linker -> Input -> Additional Dependencies (also had to copy over the headers too of course). What I didn't do was to copy over the MyLibrary.pdb file.
I would've expected to get a linker warning about the missing .pdb file but this was not the case. Then I moved only MyConsoleApp to another machine and tried to build it again, this time getting a missing .pdb linker warning. It seems that Visual Studio is storing the .pdb files when building a solution somewhere on the machine and is able to use those .pdb files when linking other solutions on the same machine.
I would like to be able to disable this behaviour or to be able to remove the cached .pdbs so that I could be sure that when sharing work with other developers they won't get warnings that I'm not getting on my own machine.
Visual Studio doesn't cache the .pdb file. What happens here is that the absolute path to the original .pdb file is stored in the build outputs (.exe, .dll or .obj files) and Visual Studio is able to took it up based on that.
Check this answer for a way to prevent that: Remove PDB references from released file.

C4272 Error when using QT3D library in visual Studio

i am using microsoft visual studio 2010 for developing an application. Additionally I am using the QT3D library as an external library.
The QT 3D library is sucessfuly installed and integrated with visual studio. I know this because I can compile and run the examples.
but when I try to write my own code, the visual studio compiler gives me the following error
c4272 : 'function' : is marked __declspec(dllimport); must specify native calling convention when importing a function.
The error message is received a few hundred times, for each of the member functions which are present in the classes in the library header files.
I suspect, that problem has something to do with the linking of the libraries. In the Additional include files the Path is given as follows
"$(QTDIR)\include";"$(QTDIR)\include\Qt3D";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtCore";".moc\debug_shared";$(QTDIR)\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories)
When I iclude the header files, the auto complete option can detect these libraries.
the additional library file paths are given as follows.
$(QTDIR)\lib;C:/qt/5.0.1-x64/qtbase/lib;%(AdditionalLibraryDirectories)
any ideas?
Best Regards
tdk.

Setting up Kyoto Cabinet in Visual Studio

I am trying to setup Kyoto Cabinet in Visual Studio (VC++). I added the source files and the static library kyotocabinet.lib
However, it is giving me a link error LINK2005
By default, the library is built with linking to LIBCMT.LIB' by the/MT' option. I also tried rebuilding the library with the `/MD' option. I am still unable to do it.
Has someone tried to use it in Visual Studio?
I found the solution.
We just have to create a new empty C++ project in Visual Studio.
Add the header files and the static library from Kyoto Cabinet Win32 Package
Set the Runtime Library from Properties -> Configuration Properties -> Code Generation to [/MT]

Using Gloox with Visual Studio 2010

I am trying to use the gloox library (C++) to create a Windows XMPP application. It seems simple enough, except I don't know how to import gloox into Visual Studio 2010 so I can include it in my application project.
I've looked at the instructions provided in the read-me (shown below), but when I try to compile the library, I get this error:
Cannot open source file: 'src\tlsgnutlsserver.cpp': No such file or directory
Instructions provided in the read-me file:
Building gloox on MSVC++
use the included project file or create your own
adjust include + library paths if necessary
to receive any debug output you should use the LogSink facilities (this is not win32-specific)
build
Does anyone have experience using Gloox with VS10? If yes, can you please help me out? Thanks!
I assume you're using the official 1.0 tarball? I had the same problem (missing source file) and had to acquire the source from SVN instead. I used the 1.0 branch.
I encountered a few other build problems, namely
the release build configuration was set to build an Application (.exe) instead of Dynamic library (.dll) (Project->Properties->General->Configuration Type)
I needed to add DLL_EXPORT to the preprocessor definitions (Project->Properties->Configuration Properties->C/C++ ->Properties->Preprocessor)
src\atomicrefcount.cpp needed to be added to the project's source files. (Project->Add Existing Item)
This worked for me in express editions of both VC++ 2010 and VC++ 2008.
Hopefully it helps you as well.

Resources