User forums > Using Code::Blocks
porting huge C++ project to linux
rjansen:
I did that using vs2008 windows solution imported to Codeblocks under CentOS7 -- it worked but the result was not that usable as too many flags change. I threw it away and started over.
Best way I found was to get one project fully configured as you like and then copy this over and over again (outside of the ide) to make new cbp files for new projects. Then use a text editor to change the title and import. Next from within the IDE throw away the source tree from the new project and add the new projects source.
I did about 100 projects this way.
Now I just wish they had workspace virtual folders so I could organize my projects into logical groups.
Krice:
--- Quote from: sodev on June 25, 2018, 05:51:47 pm ---But i guess it doesn't matter that much, because Visual Studio compiler settings are 100% incompatible to GCC
--- End quote ---
It's because each compiler has their own compiler flags. But if you compile "normal" way each compiler simply produces a working object/executable file from a C++ source code file. Compiler settings don't matter in that, they mostly help catch errors, optimize code etc.
Contrary to what some people believe, Visual C++ is these days pretty ok compiler and it supports most of C++ standards, just like GCC. If you keep it simple and don't do any super magic stuff it's going to compile in both GCC and VC just fine. I'm doing exactly that, I have set up my projects to work 1:1 in both compilers and IDEs, because some built-in compiler flags in GCC are nice, they catch more stuff than VC, but Visual Studio's static analyzer tool is also quite nice.
C++ itself is not a big problem when porting, it's mostly older C functions, but even they have a quite solid standard implementation. The two actual problems are external libraries and setting up the project for both Code::Blocks and Visual Studio (or worse: linux vs. Windows). I think you just have to keep track of two projects, what files are in the project etc. but it's not that hard if the project is moderate size. Porting from linux to Windows is actually harder than the other way around, this is something linux fanboys tend to forget. It's mostly libraries, many linux projects use shady, weird libraries which aren't available for Windows in the first place so you run out of luck really fast.
Navigation
[0] Message Index
[*] Previous page
Go to full version