Can microsoft compiler cl.exe compile to OMF object type instead COFF? - cl

I want to link object file created by cl.exe with another object file which is in format OMF using third party linker. That third party linker does not accept COFF format. I want to know if cl can make objects in OMF format?

Related

How can Eclipse binaries search be configured to recognize .srec format?

I see that Eclipse CDT/Embedded has a capability to find binaries such as .elf, .bin, .exe... I was wondering whether this is configurable setting or not, since I would like it to add too the Motorola binary formatting called .srec.
Any hint on how or where I can add this onto Eclipse CDT?
Thanks in advance,
SREC is an ASCII object file format so to use a binary search makes little sense. You could use a text search, but to search for particular binary sequences that span more than one record would be complicated.
What you could do is convert the SREC file to a raw binary file, then use the binary search on that. Conversion to raw binary can for example be done using the SRecord utility, e.g.:
srec_cat myobject.srec −o myobject.bin −binary
If you add that as a post-build step, the binary version of your SREC file will always be available for searching.

How to add files without extension in doxygen configuration file(e.g iostream library)?

In my configuration file in the INPUT tag I added one directory. Inside that iostream is there without any extension. After running the configuration file I'm not getting information related to iostream. I want to know how to add the files without extension in doxygen configuration file.
I created a small test example (contents is not that relevant for this test), file stdio:
/// the fie
void fie(void);
From the documentation (https://www.doxygen.nl/manual/config.html#cfg_extension_mapping):
EXTENSION_MAPPING
Doxygen selects the parser to use depending on the extension of the files it parses.
With this tag you can assign which parser to use for a given extension. Doxygen has a built-in mapping, but you can override or extend it using this tag. The format is ext=language, where ext is a file extension, and language is one of the parsers supported by doxygen: IDL, Java, JavaScript, Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: Fortran. In the later case the parser tries to guess whether the code is fixed or free formatted code, this is the default for Fortran type files).
For instance to make doxygen treat .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C.
Note: For files without extension you can use no_extension as a placeholder.
Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
Here we see that the possibility for no_extension and with the following setting we get the requested information:
EXTRACT_ALL=YES
INPUT = stdio
EXTENSION_MAPPING = no_extension=C++
and I do see the stdio information.
Edit
In case doesn't want to add all files one by one one hast to add * to FILE_PATTERNS.

How to import files relative to main file, instead of current directory? ((Chez) Scheme)

For example, in my main.scm file I have (load "util.scm"). util.scm is a file in the same folder as main.scm. Both files are located in ~/documents/myproject/.
Now when I'm in this directory, and I run $ chez-scheme main.scm everything works fine. However, if I'm in my home directory and run $chez-scheme documents/myproject/main.scm it complains, not being able to find the file util.scm. I suppose this is the case because the current directory was my relevant home directory, and as such util.scm is indeed not there, it is actually in documents/myproject/. That being said, I'm used (in other languages) to the functionality of looking these paths up relative to the file containing the instruction to import, and I'd like to have that here as well. I've tried prefixing it by ./ or defining the file as a libary and doing (import (util)) but none of it works outside of documents/myproject/. Is there any way to get this to work as I intend it to?
I assume this is Chez-Scheme-specific. If not I'd prefer an answer that is implementation-neutral.
load is kind of awkward in R5RS since the report states that system interfaces are off topic in the report, but they include load which is a half hearted solution. The report does not say if the load is relative to the current directory or the file the load form originates from so in order to be portable I guess you are required to run your script from the current directory and have your loaded file relative to both.
Since Chez Scheme implements R6RS load is not really the right form to use. R6RS removed load in favor of libraries. You should make your file a library and consult how to install it. In some systems that is just placing the files in the right path, adding library location in configuration or running install script. How one uses the library is the same in all implementations, by using import.
According to Chez documentation you can pass --libdirs to it to give it one or more paths to consider for loading libraries. You can see the paths it scans by evaluating (library-directories)
There are several different ways to accomplish what (I think) you are trying to do, but eventually they all boil down to letting Chez know where to look for things. When given relative paths, include and load use the source-directories parameter to search for the requested file. Libraries have their path automatically prepended to source-directories while they are being loaded or compiled, so if your main.scm were a library definition then it would find util.scm as you expect.
However, it sounds like main.scm isn't a library, it's a top-level program. Unfortunately, Chez doesn't have a command line option to set the source-directories like it does for library directories. That leaves you with a bit less flexibility. Any of the following will work:
Make util.scm a library and invoke Chez with the --libdirs option to let it know where to look for libraries.
Set source-directories and load main.scm from inside the REPL rather than from the command line.
Write a wrapper shell script that does the above by echoing the commands into scheme so you don't have to type it yourself. (Only suitable if you don't also need to then type into the scheme session).
Write a wrapper shell script that cds into your project directory before running scheme (and presumably cds back to the original directory when it's done).

Siemens S5 to S7 XR.INI file

I'm trying to convert a program from S5 to S7. I've taken a look into the tutorials and documents that are available. But I cant seem to find any information about this problem:
The program is pretty complicated and I should need the XR.INI file to convert it with the S5 Converter program that came with Simatic S7. When I open the folder with the project I see all the files I need and that are described in the tutorial made by Siemens.
.ST.S5D
.XR.INI
.Z0.SEQ
I start the converter and open .ST.S5D. When I did this I get the error there is no .XR.INI file. But I can see it in the folder. Its called CERMST.INI. So I guess the name isnt correct?
In PG2000 I remade the XRF with CTRL Q but nothing changed. I also tried to rename the file to CERM.XR.INI because I saw somewhere these files can only be 6 characters long (not sure if this is true).
I tried first without the XRF. There were some errors because of the ASM command. In the tutorial I saw the converter cant handle these so I removed these functions from the program to rewrite manually later on. After this I had an error because I had no XRF. Error was:
Error No PLC type description found for called or addressed block
So I really need the .XR.INI file but the program can't find it, but its clearly in the folder. How can I fix this? How can I make a new .INI file?
Link to tutorial: http://www.sankotek.com/TR/Dokumanlar/STEP%207%20-%20From%20S5%20to%20S7.pdf
Thanks in advance!
Siemens S5 file extensions used also last two letters before file extension to mark file type, like xxxxxxXX.XXX where x is file name and X is file type for S5, without second dot in the middle like you have. File name length limit exists, I think it comes from DOS or some older operating system file length limit.
If you don't have XRF file then if i remember correctly compiler does not have compile order. Some blocks have not been compiled but are referenced in caller block that the compiler tries to compile. Compiler does not find called block in compiled blocks folder and wham... fatal error. When i had such troubles i compiled called blocks independenly before calling blocks. So you can do without XRF file. But try to include Z0.SEQ, that file has assignment list so you get nice variable names instead of just variable address numbers.
Also, stackoverflow is not the correct place to ask questions about Siemens S5-S7 conversion. You should post your questions in http://www.plctalk.net, they have guys there who used to program S5 plc-s.

Mex binaries not loaded

I am trying to use this software available at http://www.cmap.polytechnique.fr/~aspremon/ZIP/COVSEL.zip. They have a function spmlcdvec defined in a matlab file spmlcdvec.m. It further calls a function BoxQP for which they have provided a binary mex file called BoxQP.mexmac. However, when I run the function spmlcdvec it says
Undefined function 'BoxQP' for input arguments of type 'double'.
What should I do? Whats going wrong?
Run mexext in your command window. If it does not return mexmac (or mexw32 which is also present in the folder) then you you won't be able to run the BoxQP function. These are simply old files - I see that they're from 2006. If you're using any form of OS X these days you'll get mexmaci64, which is not compatible. However, it looks like they have helpfully included all of the source code so you'll be able to hopefully compile the binaries for your system. For details on compiling mex code see this.
Then, as #alrikai suggests, your BoxQP function needs to be on your path. Either make sure that you call your code from the same folder or run path from the command window and check if that directory has been properly added (if you did so). See also addpath.