User forums > General (but related to Code::Blocks)

Migrating C++ Projects into C::B from Makefiles

<< < (3/3)

Frank_CB:
@sodev:

I did re-configure my version of c::b, but that didn't improve anything.

But, your remarks about relative addresses and environmental variables answered many of my past issues. Invoking c::b from within a native developmental command prompt from the directory where the makefile resided allowed both compilers (vc and gcc) to finish successfully. I had been using a desktop shortcut that worked in the directory (cwd) where c::b resides.  That will change.  I'll also look into finding another native developmental command prompt if I remove VS2019 and MSBUILD.

Your assistance is greatly appreciated!  Thanks!!

Regards,
Frank

sodev:

--- Quote from: Frank_CB on December 20, 2019, 12:04:59 am ---I did re-configure my version of c::b, but that didn't improve anything.

--- End quote ---
If re-configure means that you did something like described in http://wiki.codeblocks.org/index.php/64Bit_Windows then of course it didn't do anything because you are using an external Makefile. When using an external Makefile the compiler configuration of CodeBlocks DOES NOTHING (@oBFusCATed you are free to slap me with the nasty details i got wrong :) ).


--- Quote ---Invoking c::b from within a native developmental command prompt from the directory where the makefile resided allowed both compilers (vc and gcc) to finish successfully.

--- End quote ---
So this answers my question if CodeBlocks does inherit the environment to the compiler process: it does. With the properly setup environment the Makefile does of course work. However i still don't know what you did to produce that output i quoted earlier, probably you modified the Makefile to inject the required paths to work without a properly setup environment?

So basically we are back to the question what you actually want to achieve?

Use an external Makefile with CodeBlocks to get clickable error messages? Launch CodeBlocks from a matching development shell, ensure the CodeBlocks project file resides in the proper location so the paths are correct and it should work. Maybe CodeBlocks can be configured to launch the development shell for you before it starts the compiler, i don't know how external makefiles are used in detail.

Convert the project into a native CodeBlocks project to get code completion and clickable error messages? Completely setup a CodeBlocks compiler (my setup that works with a more recent Visual Studio 2015 is outlined here http://forums.codeblocks.org/index.php/topic,22009.msg149847.html#msg149847, i also have a Visual Studio 2019 setup now but i think someone else posted a better setup to deal with the frequently changing paths), rebuild the project in CodeBlocks and then DELETE the Makefile. This solution is not advisable if the project is significantly more complex to build than a Hello World.

Use an external Makefile with CodeBlocks but get code completion and clickable error messages? I'm not sure if this setup is possible with CodeBlocks (it is possible with Eclipse, at least on Linux), basically it requires a partly setup CodeBlocks compiler, you just need the includes and defines, and you need to tell CodeBlocks to use that compiler for code completion but the Makefile for compilation.

Frank_CB:
@sodev:
Thanks for all of your responses and interest! I have to apologize for not answering all of your initial questions, in part, which was?!

--- Quote ---That rises the question what you actually try to achive?

--- End quote ---

Well, since I am retired, all my interest in CodeBlocks, Visual Studio, wxWidgets, CMake and others, is a hobby! Somebody stated that a project could be migrated into Codeblocks but didn't elaborate. That piqued my interest, so I set out to find out how to do it.  I now know that CodeBlocks does nothing more than pass the makefiles straight through to the OS, as do make and nmake.  And both vc and gcc use env. vars.

I'll take another look at your last response later.

Again, all of your interest was appreciated. Thanks again!!

Regards,
Frank  :) :) :)

Navigation

[0] Message Index

[*] Previous page

Go to full version