Problems with Directx Header file - directx

Hi I am trying to use the Visual Studio 2013 Graphics debugger and tried to create an event group. Bute I ran into a problem while including d3d11_1.h header file . I copied the header to my include directory in June 2010 SDK's include file. But the following error pops up.
1>c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgi1_2.h(1271): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgi1_2.h(1271): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgi1_2.h(1275): error C2061: syntax error : identifier 'DXGI_RGBA'
I am have also copied over dxgi1_2.h in the include directory . What is causing this problem ? Is it a conflict problem ? Can any one give me any pointer on how to create this event group ?

The error was due to the header orders, you placed the DirectX headers before windows headers, so some types defined in windows.h was not visible when the compiler process directx headers.
You should include windows.h in prior to the direct3d headers.
#include <windows.h>
#include <d3d11_1.h>
...

Related

Delphi 10.3.2 Build Fails to Find DFM files

I'm using parallels VM and recently had my code in Dropbox contained within the VM. Dropbox was quite problematic in that it is really slow if you have a lot of files. Since Parallels happily shares folders from the HOST, and one of those folders is the HOST Dropbox folder, I started using that drive (essentially \mac\Dropbox mapped as W:). All goes well, the VM is much faster and I can easily access the pas/dfm files.
HOWEVER, when I build the project, the compiler complains that it cannot find DFM files (eg. about.dfm, login.dfm etc). The various DFM files are all there and the compiler complains of different DFM files, ie. one build it will be login.dfm and about.dfm, the next it will complain it cannot find Waiting.dfm. All of the DFM files are there, readily editable in the IDE.
The only thing I could try, other than constantly trying to build the project, was to put the path of the project into the library. This made no difference.
In another project the compiler cannot find the project resource (res) file. And, of course, that file is also there.
[dcc32 Error] E1026 File not found: 'EMPSecureInitialize.res'
[dcc32 Error] E1026 File not found: 'EMPSecureInitialize.res'
[dcc32 Error] E1026 File not found: 'About.dfm'
[dcc32 Error] E1026 File not found: 'Login.dfm'
[dcc32 Error] E1026 File not found: 'EMPSecureSlideShow.dfm'
[dcc32 Error] E1026 File not found: 'About.dfm'
[dcc32 Error] E1026 File not found: 'Login.dfm'
[dcc32 Error] E1026 File not found: 'EMPSecureSlideShow.dfm'
Projects with the source on a local drive, build without issue. Projects with source on a network (Parallels Host) drive arbitrarily do not find DFM or RES files. Those files are always and readily found when using the IDE, ie. click Design and the form appears.
I could understand if this was a consistent fault, but it is not 100% repeatable, sometimes the build works as expected. Is there some sort of weird timing or path construct that the compiler uses?
While it is practically impossible for anyone to reproduce your precise environment to reproduce this issue, I have a very strong feeling the issue is with a limitation in the number of concurrent files that can be opened at a time. At least on Windows, when a folder is shared, it has the ability to control the number of concurrent connections.
Imagine how the compiler works. It needs to open numerous files rapidly to read their contents and build DCUs out of them. First, the PAS files are loaded. Then, those which depend on additional files, such as DFM or RES files, get those loaded. Then all gets linked together to produce an output. That's a lot of files the compiler needs to open at the same time.
So there's likely a way to control and increase the number of concurrently open files through the Parallels virtualization. This doesn't seem to be an issue with Dropbox.

dxGDIPlusClasses.pas not found error delphi 10

When I tried to compile one of my BPL files, I get an error:
dxGDIPlusClasses.pas not found.
I double checked the unit file exists on the hard drive.
I also added $(BDSCOMMONDIR)\Dcp to the DCP Output directory, and $(BDSCOMMONDIR)\Bpl to the Package Output directory. The runtime package containing the unit was also added to the BPL.
I searched online for answers, foound one suggestion to enable Build with runtime packages under the Project Options, but when I checked I dont have that option.
Does anyone know how to solve this?
The error message indicates that either:
the compiler can't find the source file it needs for the unit.
the compiler found a .dcu file compiled with a different version of the compiler and needs to recompile it.
.dcu files are not compatible across compiler versions (with the single exception of D2006->D2007), meaning that every new version release of the compiler means all your source needs to be recompiled in order to be compatible with it.
You need to add the path to the source to Project->Options->Directories and Conditionals->Search Path so it can find the source code it needs.

android.helpers unit not found

I am trying to use the Unit Androidapi.Helpers, but when I included it in the USES delphi cannot compile the project. I am using Delphi XE 8 and Windows 7.
Delphi shows me the following error: [dcc32 Fatal Error] Unit2.pas(8): F2613 Unit 'Androidapi.Helpers' not found.
But if I search in my folders I can locate this unit at: C:\Program Files (x86)\Embarcadero\Studio\16.0\lib\android\debug.
How can I fix that?
The Androidapi.Helpers unit still exists in XE8. Double-check your search path configuration, you are probably missing an entry for the folder that contains the DCU that Androidapi.Helpers was compiled into. Also note that there is a FMX.Helpers.Android unit as well.
You can use like this;
Androidapi.Helpers.SharedActivity.startActivity(Intent);

Xamarin iOS - Binding Project - Warning

Am using
Xamarin Studio - 4.0.4 (build 2)
Mono - 2.10.11
Xamarin.iOS - 6.3.5.43
Mac OS X - 10.8.2
When building the wrapper binding class, I get a warning saying 'System.Runtime.CompilerServices.ExtensionAttribute' is present in multiple assemblies. Its just a warning, but builds the .dll file.
Target GenerateBindings:
Tool /Developer/MonoTouch/usr/bin/btouch execution started with arguments: /unsafe /d:DEBUG ApiDefinition.cs /s:StructsAndEnums.cs /tmpdir:obj/Debug/ios/ /sourceonly:obj/Debug/ios//sources.list
warning CS1685:
The predefined type System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies. Using definition frommscorlib'
/Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll (Location of the symbol related to previous warning)
/Library/Frameworks/Mono.framework/Versions/2.10.11/lib/mono/2.0/System.Core.dll (Location of the symbol related to previous warning)
But when using the created binding class in another project, it gives the error saying
Compiling to native code -
'error MT5202: Native linking failed. Please review the build log.'
In the build log
ld: file not found: /var/folders/w4/xsz8x8vx0_51hjxj474r1_fxhlq7x3/T/tmp9aef74.tmp/libPrint.a
collect2: ld returned 1 exit status
Note : libPrint.a is my static library
-Update-
When binding the libPrint.a file to the wrapper class, the .a file should be added to the project and not inside the 'Resources' folder. This solved the issue am facing.
Does libPrint.a support the architecture you are building your iOS project for?
IOW, if you are compiling for Simulator, your libPrint.a needs to support i386.
If you are compiling for device, it needs to support whatever ARM arch you are targeting.
The warning is because of the ambiguity for System.Runtime.CompilerServices.ExtensionAttribute' in multiple assemblies.
Keeping the warning aside, the real problem is when adding libPrint.a file.
Its a small silly mistake. The docs of xamarin clearly explain it.
It should be added to the project and not inside the 'Resources' folder.
This solved the error I'm getting when using the .dll file for a project.

Linker error "contains invalid OMF record"

In C++ Builder when I compile I get
[ilink32 Error] Error: 'C:\PATH\TO\A\LIB\INCLUDED\IN\THE\PROJECT\ALIBRARY.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
When I convert .lib with utilities coff2omf, new lib looses significant functions.
C++Builder cannot use .lib files from other compilers, only its own.
If the .lib file is an import lib for a DLL, use C++Builder's command-line IMPLIB tool to create a new .lib file from the DLL directly.
If the .lib file is a static library (containing actual code), C++Builder's command-line COFF2OMF tool MAY be able to convert the library, but it is not guaranteed. It really depends on what kind of code the library is actually using. If the conversion is not possible, you will have to wrap the .lib file into a DLL that is written in the same compiler that created the .lib file. Then you can use the DLL in C++Builder.
I was facing the same issue. I have used the tool COFF2OMF to covert the existing lib files to make them compatible with C++Builder. It works for me.
Syntax:
..Embarcadero/../bin> COFF2OMF libssl.lib alibssl.lib
..Embarcadero/../bin> COFF2OMF libcrypto.lib alibcrypto.lib
Renamed the converted files and placed them in the required location.

Resources