Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: 21region on February 18, 2012, 05:28:09 pm
-
I've compiled different .cpp files in one project and got .o files. In the linking stage they are tried to be combined in a singe executable. But, as they're not supposed to be built in one project (every .cpp file deserves it's own project), I get a lot of linking errors. And that's ok.
What I want is to build every .cpp file separately and get it's .map file. Is there any check button for doing this?
Thanks in advance.
-
What is this map file?
You can disable the linking of a file by "Right clicking on it-> Properties -> Build -> Link file"
-
What is this map file?
You can disable the linking of a file by "Right clicking on it-> Properties -> Build -> Link file"
http://en.wikipedia.org/wiki/MAP_(file_format)
I don't need disabling linker. I need linker to go through all of .o files and generate .map for every one of them.
-
If you're using the gcc compiler you won't be able to do it, I think, because gcc is producing debug information in dwarf format not coff or map (or whatever vc++ is producing).
You'll have to read the manual to see what options are available to you about reading the symbols.
-
You'll have to read the manual to see what options are available to you about reading the symbols.
...not to forget about the "SymTab" plugin (symbol table plugin) which utilises the GCC nm tool for symbols...
-
Now I'm generating map files with this command: ld -m "fileName.o" > "fileName.map"
To solve this issue I've written .bat file: for %%x in (c:\projects\obj\*.o) do call ld -M %%x > %%x.map
I think it's brute force and there have to be cleverer methods, for example, with using makefile. But I never used them and it's hard for me to write one for this problem.
-
Now I'm generating map files with this command: ld -m "fileName.o" > "fileName.map"
To solve this issue I've written .bat file: for %%x in (c:\projects\obj\*.o) do call ld -M %%x > %%x.map
If you really need this, you can also adjust the compiler command issued to compile a compilation unit. You find this within the advanced settings of the compiler you are using. Using macros the step above is done automatically for you.
-
you click right project -> Build Options... -> Linker Setting -> in Other Linker Options: -Wl,-Map,test_gtk.map