sharpdx tkfxc.exe generates .tkb file when .tkfxo expected - c++

I'm facing a problem and I couldn't find any documentation at all. Also I downloaded the github sharpdx solution but I didn't found an answer.
When I'm executing tkfxc.exe in net40 directory, the .fx effect compiles successfully but as I read on many forums, a .tkfxo file shall be generated. Instead of that I got a .tkb file.
This is the command line command I'm using:
tkfxc.exe /FoInverted.tkfxo Inverted.fx
Even if I try to change the extension to the file or just load this file as a filter, sharpDX said that is invalid file, some other CHUNK expected.

Related

Generating working CHM files using Doxygen and GraphViz (Invalid .hhc file?)

I'm in the middle of documenting my C++ GUI library and I just started using Doxygen. I've got two test files that are documented now, but I have problems when trying to generate the CHM help files. Doxygen runs without error, and dot appears to be functioning correctly to generate images.
However, it appears the resulting .hhc, .hhk, and .hhp files are broken in some way. index.hhc and index.hhk are exactly the same and running 'hhc index.hhp' does not work. It returns an error :
HHC6000: Error: An internal file could not be created. Make certain there is enough disk space on the drive where you are compiling your file.
HHC5007: Error: Fatal navigational compilation error. This is likely the result of an invalid contents (.hhc) file.
I have uploaded a zip file of my two test sources, the Doxyfile generated by the Doxy Wizard, and the .hh* files created by doxygen.
http://members.allegro.cc/EdgarReynaldo/temp/test1.zip
Both HTML Help Workshop and GraphViz are on my path.
Do I need to change a setting in the doxyfile? How do I fix this?
Regards, bugsquasher
EDIT
After taking albert 's advice, everything seemed to magically work. Nothing was really different though.

OpenCV: fs.open fails

I want to read from an .xml file, but this line
fs.open("test.xml", FileStorage::READ);
fails with cv::Exception.
\opencv_source\opencv-3.4.1\modules\core\src\persistence_c.cpp:384: error: (-49) Input file is empty in function cvOpenFileStorage\n" ...} ...} const cv::Exception &
I'm using Win7, OpenCV 3.4.1, c++, VisualStudio 2015. It's my fist time using .xml files and I'm new to opencv.
Any ideas what's wrong?
If you have downloaded the XML file using "save link as..." from chrome, then it might cause the problem. Open the file and check it once if it looks the same as in the repository.
It seems that your program is unable to find the file specified. Is the file you are trying to open in the same directory as your excecutable? Perhaps try to use an absolute path.
It requires absolute path of the file to be read. I had the same issue. Giving absolute path solved my problem.

Need help applying MinGW patches for std string, getting unexpected ends

I'm trying to apply these patches:
http://tehsausage.com/mingw-to-string
So that I can use std string stuff that I should have access to anyways.
I have MinGW 4.7.2, and at first, I tried copying the zip files with no luck.
Now I'm trying to manually apply the patches. I copied the patch information into a file.patch, placed it in the same folder as the file I am patching, and ran
patch < file.patch
and then I get:
patching file stdio.h
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 574.
patch unexpectedly ends in middle of line
1 out of 1 hunk FAILED -- saving rejects to file stdio.h.rej
patch unexpectedly ends in middle of line
I made sure that there is no extra white space at the end..
Please help!
OK, installed the latest mingw from the web-site, downloaded the patch files and made sure they were clean.
I applied each one individually, and they worked without issue. There was a warning that it was 'Stripping the trailing CRs from the file', but it worked without issue.
each patch is applied in the appropriate directory; e.g. the stdio.patch is applied to stdio.h which is in /mingw/include using:
patch </path/to/stdio.patch
ditto for wchar.patch
The os_defines.h file is found at /mingw/lib/gcc/mingw32/4.7.2/include/c++/mingw32/bits, and the patch works properly for that one as well.
I created a github with the patches at https://github.com/petesh/mingwpatches.git - you can clone the repository, or download the individual files from there. Each of them should work correctly without more than a complaint about the trailing CR warning.
After looking at the patch files, you probably need to use the -c option to the patch command. This tells patch that the patch-files are from a context diff.
E.g.
$ patch -c < file.patch

Matlab will not run my C++ .exe file

I have program in C++ that runs great but it has different steps in it. It opens a file first then does some calculations based on the data it gets from the file. Now I'm trying to run it through matlab. I tried mex but it got too complicated because I have VS 2010 Express and MATLAB 2007b. And so mex can never find my c compiler.
I'm now trying to just run it straight from the C++ program executable file. Here's how I tried to do it:
system('C:\path\file.exe')
it would run but the command window freezes and I have to close Matlab every time to get back on track. Then I tried to double click on the executable file it self. It flashes but I can see it outputs something from my file "file could not be uploaded" which is generated by a part of my program if it cant find the file.
So then I realized it's probably because of that that caused it to not run and crash.
So I wrote a sample code to open the file first before the system command open the .exe file. I've done something like fopen('fname','r'), but nothing works. Please note that this file I'm trying to open is a .COF file.
I tried running the .exe file using debug and release modes but nothing happens. It gives no errors which means it sees the .exe file but the command line doesn't come up and matland command window freezes.
After running, it's supposed to prompt the user at the command line then take input arguments and output something...
Please help....
I am guessing that your .COF file is in a different path than what's accessible by your binary. If you can recompile, try an absolute path name, and test it first without MATLAB.
There are more thorough ways to solve this, like passing the filename to your binary as a command line argument, or to read up what the rules are for the "current directory" when you use system, but perhaps you'd be happy with the quick solution.

Can't open text file resource in Xcode 4 c++ tool?

I am working on figuring out how to use Xcode 4 to debug c++ projects.
I have basically copy pasted a working c++ executable that when compiled from the terminal ran fine.
However, i was thinking it might be nice to use Xcode for debugging. So I am trying to migrate the single .cpp file into Xcode as a command line tool.
I need to read in a file called numbers.txt (which I supply through a command line argument) which is located in my project directory, and then out put to a file (whose name I also specify as an argument.)
The problem I am running into is that the files that are supplied as command line arguments are failing to open.
ifstream in;
ofstream out;
in.open(argv[1]);
out.open(argv[2]);
I have checked to make sure that the arguments are being properly passed and are named correctly. The ifstream in is being supplied with `numbers.txt', which I want to open a text file that I already have.
However when I check to make sure the ifstream is open:
if(in.is_open() == false){
cerr << "Unable to open input file" << endl;
return 1;
}
I get the error.
I suspect this has something to do with how Xcode organizes the project.
my numbers.txt file is just sitting in the Xcode project folder, and I have only one .cpp class and one product, the executable.
anyone know what I am missing here?
The executable built by Xcode is in a different folder than the project. Passing in the name of the file without an absolute path before it will cause the executable to look for it in the wrong place, which is why it can't be found. Some of the possible solutions are to include the file as part of the build process (so it ends up in the same directory as the executable) or to pass the file to be opened by its absolute path. There are other ways to solve the problem, too, but hopefully that should be enough to get you started.
Old thread, but i have faced the same problem now, and it is easy to solve. Just copy the file in the build phase.
Here is an screenshot of the final result (note the destination, subpath and checkbox):