User forums > General (but related to Code::Blocks)
Advice please on mixed languages
johne53:
I'd like to compile a Linux Shared Object for which I have the source code. Almost all the modules are in C++ - except for one module which is x86 assembly code. This one module needs to be compiled with different compiler settings from the C++ stuff - but ultimately, it needs to end up in the same Shared Object. What is the best way of organising this within C::B? Is it possible to create a project with mixed languages and have different compiler settings for the assembly module? Or should I put the assembly module into its own separate branch? If I were to put it into its own separate branch, how would I then tell C::B to include that branch's object code when linking the main branch?
Hope that makes sense..... :)
mariocup:
Hi,
you can use own settings for assembler files. Select assembler file in the project view and select context menu properties then follow the steps described in (see http://codeblocks.org/manual.shtml)
johne53:
Thanks. I followed the instructions but I don't seem to have a 'buildable' file (in other words, if I right-click on the file I don't see any 'build' option in the popup menu.
This source file happens to have the extension ".s" Is that normal for an assembly language source under Linux? I'm used to seeing Microsoft's ".asm" extension. Could it be the extension that's causing this file to be unrecognised.... :?
mariocup:
Hi,
select the file name.s in the project view and select properties from the context menu. Then use tab build and check compile file and link file. Then select tab advanced and check use custom command to build file.
Add entry
$compiler $options <asmopts> $includes -c $file -o $object
and replace it <asmopts> by your assembler options.
If it does not work, please attach your project file.
johne53:
Thanks. AFAIK, those are the options that I already tried when I followed the instruction manual. However, there's still no build option in the popup menu. I've attached the CBP project and my C::B version details are below, in case that helps.
svn build rev 4349 (2007-08-05 14:35:58) gcc 4.1.2 Linux/unicode
P.S. I had to change the project's extension to ".txt" because ".cbp" isn't allowed
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
Go to full version