I have a C++ project running cinder. I would like to implement a plugin system using LoadLibrary and a .dll file using a custom interface. I got a simple example working, but once I add the cinder libraries to use as a reference in my dll, the dll won't compile, giving an error the and are not compatible with compiling with /clr.
I am a greenhorn when it comes to C++, most of my programming is done in C#. Is there anything I could do about this?
P.S. Switching off /clr gives me a bunch of errors about MT_static and MT_Dynamic mismatches in cinder.lib. I'm going nuts here.
Thank you for your help,
Matija
Well, the solution was not all that forward, but after a LOT of trial and error, this finally worked:
I turned off all clr options (set them to no support in visual studio). The the setting for Dynamic Debug DLL needed to be changed to Dynamic no debug (no DLL). After that, it was just a matter of commenting out Stdafx.h and setting and current setting incompatible flags to compatible.
The project built into a normal .dll and is now working fine :D
Related
I started programming in C++ using CLion IDE.
When I run the program inside the IDE it works. However, opening the .exe file outside the IDE generates a bunch of errors:
The code execution cannot proceed because libgcc_s_seh-1.dll was not found. Reinstalling the program may fix this problem.
Hitting OK pops the same message again with a different dll.
Why does this happen? What are the different ways to fix it? What is the best option?
You always need to ship any libraries your application is linked with along with your application. The libraries are just as much a part of your app as the code you wrote yourself. This includes your compilers runtime libraries (which you forgot in this case).
I am coding in C++, using the SFML, since a little bit of time and everything has been running fine.
This morning I've been using the type sf::Image and some functions on that type, such as getPixel.
Then, the compilation works fine, however, when I try to run it, I get the missing dll error on sfml-graphics-d-2.dll.
I looked in the folder and I could see that indeed, there was no such dll! There was his brother sfml-graphics-2.dll instead however.
Why is it asking for the dll that I don't have :( ?
Informations:
I use code::blocks.
Linkers seems to be ok :
"C:\Program Files (x86)\SFML-2.3\lib\libsfml-graphics-d.a" for the debug
"C:\Program Files (x86)\SFML-2.3\lib\libsfml-graphics.a" for the release
I use the SFML2.
I'm on Windows 8.
My compiler is GCC MinGW.
I can't find sfml-graphics-d-2.dll on my computer (because I had to compile the SFML using Cmake, and it only generates files like sfml-graphics-2.dll, not like sfml-graphics-d-2.dll)
Thank you very much if you can help! :-)
The -d in sfml-graphics-d-2.dll stands for debug, so when you are building SFML, you need to change the build target from Release to Debug.
The Debug build target should have been generated by CMake when you ran it.
I have an executable from a c++ project that i have done.It works fine to my Pc but it gives error to other cause of a dll missing.I searched a solution and i have found out that in VC++
i can go to
Project > Properties > Configuration Properties > C/C++ > Code
Generation > RunTime Library > Multy threaded (/MT)
and if the value is MT with dll it will be fine.
I work with Eclipse and i can not find something similar. Is there any way to make the exe run on other pc without using dll finders?
You haven't said what .dll is missing, but since it's MinGW, i presume it's one of their .dll's missing.
You could try adding -static to your build options; this builds the MinGW libraries into your .exe so that it doesn't need them installed on the other pc.
NB: this probably has some other effects that i don't know about, but in simple cases it should suffice.
alternatively, find the .dll and distribute it with your program, as that will work (provided you don't go windows->mac or something like that).
The dll must be missing because you are using libraries (ddls) as shared libraries.
But if as CommanderBubble suggested your error while running on other PCs is sloved by making linking of ddls static, then yoou can choose to use the method.
But there are some trade offs. (Like duplicvation of common dlls, etc)
This SO answer provides a very good explanation of the situatio and its advantages and disadvantages.
I am starting to learn DX11 and running into trouble with the effects framework. I know it was released as source and I have to build it, but the output from the build is not what I expected.
According to the research I've done on this question, the output from the build should be
D3DX11EffectsD.lib for debug
D3DX11Effects.lib for release
However, when I look into the 'Effects11\Debug' directory after building the project, I only see a file Effects11.lib (well, an Effects11 Object Library file which I assume is a .lib, I'm new to c++), and the exact same file in 'Effects11\Release'. Whats going on here? I've never used VS 2010 for c++ before now but I think I am building the solution correctly.
Is this a matter of renaming the files or have I done something wrong without realizing it? There really isn't much documentation on building and linking libraries in vs 2010 that I could find. Anybody have any suggestions?
Thanks
If you compiled exactly what you got off the web, then I think it would be just a naming convention problem.
You should try compiling it into your end application and see if it yells about debugging symbols missing.
You can also go into the build settings (it has been a while since I have used visual studio for anything other than C# so I don't know exactly where that menu option would be (I assume right clicking on the project should yield some useful results)...I generally do my C++ stuff on linux) and check to see what the built targets are for debug and release. If it turns out that the names are the same for both, but the build targets (i.e. the folder and a few other options, like including debugging symbols) are different then you should be good and it is just a naming problem.
Also, if the files are the exact same size it is likely that they are the same since the debug file should be at least a bit larger than the release one.
If it turns out that they are the same file, try re-downloading or re-extracting the source and just compiling the project again without any changes and see if that gets any results.
I am trying to compile the SkpWriter example from the latest SketchUp C++ SDK. However, the linker gives me LNK1104 saying that "mfc80u.lib" could not be found since one of the static libraries (Utils.lib) in the SDK depends on some MFC 8 libraries. I am using VS2008 and only mfc90u.lib is available.
Is there a way to use mfc90u.lib in place of mfc80u.lib (anything short of renaming the file)?
Are MFC 8 DLLs and LIBs available for download? (Why should someone using a DLL created with VS2005 also be expected to install VS2005?!!) What are my options here?
Right-click your project, Properties, Linker, Input. In the "Ignore Specific Library" setting put mfc80u.lib. In the "Additional Dependencies" setting add mfc90u.lib
No guarantee that this will work but you got a decent shot at it. Your best bet is to contact the SDK vendor and ask for an update.
Probably you have 2 option:
1. Build your exe in VS2005 and use existing dll.
2. Rebuilt your dll in VS2008 and link with your exe.
MFC6 & MFC9 binary is not compatible, especially CString and CWnd, they are different in VC6 and VC9....