Add it to the Linker options box in the project options.
Clifford
But I am very new to adding stuff to the linker and linking libraries. I have tried putting -Map <filename> into the linker box in the project options but then I cannot compile the project 9I am guessing because I have not got the right library linked?).
I would be very grateful if you could give a step by step guide as to what to do. ie which files do I need to download, do I need to compile these, how do I add the library to the project, and what linker options to use.
I am on Windows2000 if that is important
Thanks again
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sorry for the double post, got a bit confused
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-11-16
You will have to post your compile log if you want to get an answer. Creating a map file has nothing to do with linking libraries (except that it is a linker option). It is likley that the problem is not related to creating a map file (unless you entered the option incorrectly); but we cannot tell unless we can see what you can see (i.e. the Compile Log).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If your getting compile error 1, then you are missing a file the linker needs(lib, ect..).
If this is the case, you have to create an empty map file first.
Along the same lines, I too read that post. Thought I'd give it a shot.
I put this in my linker: -Map ./Text/MemoryMap
I also tried a few of the variants.
When I run the program, nothing is written to the file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-11-17
OK, my mistake. Unfortunately Dev-C++ does not invoke the linker directly, it calls it through teh compiler interface (which is a bad idea IMO). The compiler interface only supports a subset of linker options directly. Options not supported are invoked via the -Wl option. You need to use:
-Wl,-Map,mapfile.map
I tested it this time - it does work. As I pointed out to John, you should have posted your compile log; it would have highlighted the error, after all that's how I figured it out.
Clifford.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry about not posting my logs, I am just not in the habit of running for help every time something happens. Usually, by the time I get in here the compile log is long gone, and many times the offending code is too.
I am sorely lacking in my make, linker, command line skills. This little lesson moved me forward a little in that area.
I now bow in praise of your superior skills.
About the map, it works now. Yep, 14,000 lines of memory addresses. Great fun.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I recently asked for help making a map file and got this reply (thanks)
By: C (slocombe) - 2006-11-09 06:02
It is a linker option, there is no 'switch' in the project/compiler options dialogs, you have to addit manually.
The manual for the GNU linker is at http://www.gnu.org/software/binutils/manual/ld-2.9.1/ld.html. The options are described at http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_3.html#SEC3.
You need:
-Map <filename>
Add it to the Linker options box in the project options.
Clifford
But I am very new to adding stuff to the linker and linking libraries. I have tried putting -Map <filename> into the linker box in the project options but then I cannot compile the project 9I am guessing because I have not got the right library linked?).
I would be very grateful if you could give a step by step guide as to what to do. ie which files do I need to download, do I need to compile these, how do I add the library to the project, and what linker options to use.
I am on Windows2000 if that is important
Thanks again
John
sorry for the double post, got a bit confused
John
You will have to post your compile log if you want to get an answer. Creating a map file has nothing to do with linking libraries (except that it is a linker option). It is likley that the problem is not related to creating a map file (unless you entered the option incorrectly); but we cannot tell unless we can see what you can see (i.e. the Compile Log).
If your getting compile error 1, then you are missing a file the linker needs(lib, ect..).
If this is the case, you have to create an empty map file first.
Along the same lines, I too read that post. Thought I'd give it a shot.
I put this in my linker: -Map ./Text/MemoryMap
I also tried a few of the variants.
When I run the program, nothing is written to the file.
OK, my mistake. Unfortunately Dev-C++ does not invoke the linker directly, it calls it through teh compiler interface (which is a bad idea IMO). The compiler interface only supports a subset of linker options directly. Options not supported are invoked via the -Wl option. You need to use:
-Wl,-Map,mapfile.map
I tested it this time - it does work. As I pointed out to John, you should have posted your compile log; it would have highlighted the error, after all that's how I figured it out.
Clifford.
Sorry about not posting my logs, I am just not in the habit of running for help every time something happens. Usually, by the time I get in here the compile log is long gone, and many times the offending code is too.
I am sorely lacking in my make, linker, command line skills. This little lesson moved me forward a little in that area.
I now bow in praise of your superior skills.
About the map, it works now. Yep, 14,000 lines of memory addresses. Great fun.
Thanks
Thank you very much for this, works fine with the new linker option. Now the hard bit, tracking things down!
John