Author Topic: Filling in the Global Variable Editor  (Read 7333 times)

Offline PyTran++

  • Single posting newcomer
  • *
  • Posts: 5
Filling in the Global Variable Editor
« on: July 10, 2012, 10:19:51 pm »
I am trying to install the Fortran plugin for Code::Blocks which is to be found on

http://code.google.com/p/fortranproject/downloads/list

Upon extracting the archive fortranproject_v0.8.tar.bz2 and loading the FortranProject_unix.cbp project-file in Code::Blocks a Global Variable Editor windows pops-up, requesting me to identify the "cb" variable. I was able to find out that the Code::Blocks SDK is meant by the "cb" variable. Through Synaptic I installed the codeblocks-dev package to acquire the Code::Blocks SDK header files and libraries. So I filled in the "include" and "lib" fields with the path names to respectively the header files (/usr/include/codeblocks) and the library (/usr/lib). However I have no clue at what I should enter for the "base member" or "obj" fields. Can someone please tell me what I need to fill in, in those fields?

Feel free to ask for additional information!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Filling in the Global Variable Editor
« Reply #1 on: July 10, 2012, 10:57:44 pm »
Have you tried the latest nightly build. It should include the plugin by default...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline PyTran++

  • Single posting newcomer
  • *
  • Posts: 5
Re: Filling in the Global Variable Editor
« Reply #2 on: July 10, 2012, 11:21:35 pm »
No I have not tried the nightly build. I also do not wish to use it. I prefer to stick to releases available from Synaptic and more specifically I prefer to stick to official stable releases. Is the Fortran plugin, by any chance, going to be included into official stable Code::Blocks releases out-of-the-box?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Filling in the Global Variable Editor
« Reply #3 on: July 10, 2012, 11:24:27 pm »
Have you tried the latest nightly build. It should include the plugin by default...
It's an external resource and can be downloaded via svn, but it is not included in the build-system as far as I know.
And the linux projectfile only works with C::B build with C::B, otherwise some paths for the search directories are invalid (e.g. devel).
And it is not buildable with recent C::B, because it does not use Manager::IsAppShuttingDown, but the no longer existing non camel-case version (the last one is easy to fix, obviously).

To make the projectfile usable with the devel-packages on debian/ubuntu and Fedora, RedHat/CentOS, you need to remove all entries in the search-directories tabs, remove the linklibrary (which should be just codeblocks not libcodeblocks.a on linux, by the way) and add `pkg-config codeblocks --cflags` to "Compiler settings -> Other options" and `pkg-config codeblocks --libs` to "Linker settings -> Other linker options".
Thne change all calls to Manager::isappShuttingDown to Manager::IsAppShuttingDown.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Filling in the Global Variable Editor
« Reply #4 on: July 10, 2012, 11:25:59 pm »
No I have not tried the nightly build. I also do not wish to use it. I prefer to stick to releases available from Synaptic and more specifically I prefer to stick to official stable releases. Is the Fortran plugin, by any chance, going to be included into official stable Code::Blocks releases out-of-the-box?
If you use the stable sources you don't need to change the isaShuttingDown call, but you can do it, because both functions existed in earlier revisions as far as I know.

Offline PyTran++

  • Single posting newcomer
  • *
  • Posts: 5
Re: Filling in the Global Variable Editor
« Reply #5 on: July 10, 2012, 11:50:00 pm »
Thanks Jens for you reply. I am however not really certain yet about what I should do. I have attached a screenshot of the window with the fields I am trying to fill out. Could you supply me with what I need to fill out in the remaining empty fields (base and obj) and correct me if I have filled out some fields incorrectly. Thanks in advance


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Filling in the Global Variable Editor
« Reply #6 on: July 11, 2012, 12:10:35 am »
Thanks Jens for you reply. I am however not really certain yet about what I should do. I have attached a screenshot of the window with the fields I am trying to fill out. Could you supply me with what I need to fill out in the remaining empty fields (base and obj) and correct me if I have filled out some fields incorrectly. Thanks in advance


Don't use the globa compile rvariables for the project (if you use the codeblocks-dev package, which includes a pkg-config file for C::B).
To verify, that the pkg-config file exists, just run pkg-config codeblocks --cflags from a console. It should output something like:
Code
$ pkg-config codeblocks --cflags
-I/usr/include/codeblocks -I/usr/include/codeblocks/tinyxml -I/usr/include/codeblocks/scripting/include -I/usr/include/codeblocks/scripting/bindings -I/usr/include/codeblocks/scripting/sqplus -I/usr/include/codeblocks/wxscintilla/include  

If that's the case, you don't need the cb-variable.Just do all the changings I posted before in the projects "Build Options" (and the sources).

If you want to try it with the existing project-file, just use /usr as base and leave the objs empty.

You still have to make changes to the projects build options.
$(#cb)/include should become $(#cb.include)
$(#cb)/sdk/wxscintilla/include should become $(#cb.include)/wxscintilla/include
$(#cb)/devel should become $(#cb.lib)

And the cflags and lflags entries have to be surrounded by backticks ( "`").

Offline PyTran++

  • Single posting newcomer
  • *
  • Posts: 5
Re: Filling in the Global Variable Editor
« Reply #7 on: July 11, 2012, 01:41:55 am »
I tried your method but that did not do anything in my case. I might be missing something. However I managed to get something to work with the Global Variable Editor + the build option changes for the search tab. Unfortunately I am getting errors during the compilation of fortranproject.cpp. I have enlisted the Build messages below:

/usr/include/codeblocks/prep.h|18|warning: identifier ‘nullptr’ will become a keyword in C++0x [-Wc++0x-compat]|
/usr/include/codeblocks/prep.h||In member function ‘ID::operator void*() const’:|
/usr/include/codeblocks/prep.h|316|warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]|
/usr/include/codeblocks/prep.h|18|warning: identifier ‘nullptr’ will become a keyword in C++0x [-Wc++0x-compat]|
/usr/include/codeblocks/prep.h||In member function ‘ID::operator void*() const’:|
/usr/include/codeblocks/prep.h|316|warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]|
/usr/include/codeblocks/prep.h|18|warning: identifier ‘nullptr’ will become a keyword in C++0x [-Wc++0x-compat]|
/usr/include/codeblocks/prep.h||In member function ‘ID::operator void*() const’:|
/usr/include/codeblocks/prep.h|316|warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]|
/home/carlos/Downloads/fortranproject/fortranproject.cpp||In member function ‘virtual void FortranProject::OnAttach()’:|
/home/carlos/Downloads/fortranproject/fortranproject.cpp|169|error: ‘cbEVT_CLEAN_PROJECT_STARTED’ was not declared in this scope|
/home/carlos/Downloads/fortranproject/fortranproject.cpp|170|error: ‘cbEVT_CLEAN_WORKSPACE_STARTED’ was not declared in this scope|
/home/carlos/Downloads/fortranproject/fortranproject.cpp|175|error: ‘cbEVT_COMPLETE_CODE’ was not declared in this scope|
/home/carlos/Downloads/fortranproject/fortranproject.cpp|176|error: ‘cbEVT_SHOW_CALL_TIP’ was not declared in this scope|
/home/carlos/Downloads/fortranproject/fortranproject.cpp||In member function ‘void FortranProject::RegisterFileExtensions()’:|
/home/carlos/Downloads/fortranproject/fortranproject.cpp|1641|error: ‘class PluginManager’ has no member named ‘RegisterCCFileExts’|
||=== Build finished: 5 errors, 6 warnings ===|

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Filling in the Global Variable Editor
« Reply #8 on: July 11, 2012, 05:35:54 am »
You have to use a more recent C::B for the plugin in this case.