Author Topic: Compiling Code::Blocks: ./bootstrap command errors.  (Read 18717 times)

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Compiling Code::Blocks: ./bootstrap command errors.
« on: January 28, 2019, 09:15:34 pm »
I am attempting to follow the instructions at:
https://wiki.wxwidgets.org/Installing_and_configuring_under_Ubuntu
I already have wxGTK installed (see my final post in the thread: http://forums.codeblocks.org/index.php/topic,23067.new.html). So I skipped to the heading "Code::Blocks installation".

In the development directory I did this command sequence:
Code
svn checkout http://svn.code.sf.net/p/codeblocks/code/trunk
cd trunk
./bootstrap
and got these errors:
Code
...
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:141: warning: macro 'AM_OPTIONS_WXCONFIG' not found in library
configure.ac:142: warning: macro 'AM_PATH_WXCONFIG' not found in library
...
src/base/tinyxml/Makefile.am: installing './depcomp'
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG
What is to be done about these errors?
I attempted to ignore those errors and proceed with the commands:
Code
./configure
 make
But got the error:
Code
make: *** No targets specified and no makefile found.  Stop.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #1 on: January 28, 2019, 09:46:59 pm »
You need to have at least one version of wxgtk-dev/devel package installed system wide. Or you need to set the am path to point to the wxwin.m4 file.
(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 spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #2 on: January 29, 2019, 06:53:51 pm »
I have this file in the path:
/home/me/Packages/wxWidgets-3.0.3/wxwin.m4
This is not system wide.

What is this "am path" and how is it set?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #3 on: January 29, 2019, 09:29:54 pm »
I am guessing on this
http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux

Quote
...then aclocal is having trouble finding the wxWidgets .m4 files. You can do one of two things: To just get bootstrap to find the path this time do:

export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
To change the aclocal search path more permanently do:

echo `wx-config --prefix`/share/aclocal >> /usr/share/aclocal/dirlist

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #4 on: August 12, 2019, 11:54:56 am »
I have the same problem, but also wx-config isn't found, should it be added to path or something like that? I think wxwidgets compiled ok. I'm trying to compile C::B on OSX (latest version). By the way, why it is this difficult? I already had tons of problems trying to compile wxwidgets, because the readme instructions were not correct.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #5 on: August 12, 2019, 03:16:18 pm »
I have the same problem, but also wx-config isn't found, should it be added to path or something like that? I think wxwidgets compiled ok. I'm trying to compile C::B on OSX (latest version). By the way, why it is this difficult? I already had tons of problems trying to compile wxwidgets, because the readme instructions were not correct.

There are very few OSX experts on this website.

I suggest asking here about how to install wxWidgets on OSX so wx-config works.
https://forums.wxwidgets.org/viewforum.php?f=23

Once you get wx-config to work; I suggest reading this post http://forums.codeblocks.org/index.php/topic,23428.msg159512.html#msg159512

Tim S.
« Last Edit: August 12, 2019, 03:19:46 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #6 on: August 12, 2019, 04:13:08 pm »
I got wx-config to work by just using the full path to it. But bootstrap is still not working:

Code
aclocal: warning: couldn't open directory '/Users/(user)/Documents/wxWidgets-3.1.2/share/aclocal': No such file or directory
configure.ac:141: warning: macro 'AM_OPTIONS_WXCONFIG' not found in library
configure.ac:142: warning: macro 'AM_PATH_WXCONFIG' not found in library
configure.ac:26: installing './compile'
configure.ac:22: installing './missing'
src/base/tinyxml/Makefile.am: installing './depcomp'
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG

Well yes, there is no share/aclocal directory in the wxWidgets-3.1.2. Why isn't it there, didn't it compile or am I missing something?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #7 on: August 12, 2019, 04:51:52 pm »
Code
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"

Replace wx-config with the full path to it!

Edit: You need to find a website that teaches the basics of command line tasks on OSX.

Because, I am guessing, you do not know the basics!

Edit2: Post what .../wx-config --prefix gives; replace ... with path

Edit3: You do know that wxWidgets needs to be installed on your computer; just downloading the sourcecode does not install it!

Tim S.
« Last Edit: August 12, 2019, 05:25:34 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #8 on: August 12, 2019, 10:58:39 pm »
You do know that wxWidgets needs to be installed on your computer; just downloading the sourcecode does not install it!

I'm not on my mac mini right now, but I did follow installation instructions of wxwidgets and I guess it did something. It did compile it quite a while, like 20 minutes or even more. But I have no idea if it was installed correctly, however I managed to complete all steps in instructions about how to install it. But I can say that I don't know how programming (C/C++ in this case) works in OSX. Other than it requires compiling libraries, because I guess you need specific version for that OS version or whatever. But it seems to be quite hard to understand where library files are and how to use them. When you look at the wxwidgets directory it's just full of randomly named strange files. Well I guess source files do make some sense, but nothing else does.

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #9 on: August 13, 2019, 02:07:48 pm »
I tried to star over and follow wxwidgets instructions. I get an error about "try a different SDK" in configure command which I think could be result of not having XCode installed (I do have command line tools). This is just a theory which I have to try later, because XCode download is 7,5Gb and the internet is ~700kb/sec (wlan). The wonders of modern world. Besides it's thunderstorm today which means it's better unplug computers fast if it gets bad, so I'm not even going to try it today. The problem I had with XCode was that the automatic update began to fail after the size of that thing got over 5Gb I think. It just gives up and never works. If you can stop automatic update for XCode only then it might work.

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #10 on: August 14, 2019, 01:04:56 pm »
It was not XCode.. When I search internet this has been a problem at least since 2007 for linux and OSX I guess. Could someone figure this out for good? I mean this: possibly undefined macro: AM_PATH_WXCONFIG in when running ./bootstrap command. There has to be some linux or osx people here, right?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #11 on: August 14, 2019, 03:59:07 pm »
It was not XCode.. When I search internet this has been a problem at least since 2007 for linux and OSX I guess. Could someone figure this out for good? I mean this: possibly undefined macro: AM_PATH_WXCONFIG in when running ./bootstrap command. There has to be some linux or osx people here, right?

You need to get wx-config to work!

And, then tell me what wx-config --prefix returns or I will add you to the list of people who is not able to be helped by me!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #12 on: August 14, 2019, 04:08:51 pm »
The problem is that the bootstrap script, or more precisely autoconf that is used by it, cannot find the wxWidgets autoconf files. This is because either they are not installed at all or in a location that autoconf isn't looking for.

So first you have to make sure that you have wxWidgets fully installed and then you can try what was written earlier in this thread to make autoconf find these files. Just beeing able to run wx-config is not enough, but it can be used to get the path that needs to be added to the autoconf search paths.

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #13 on: August 15, 2019, 12:49:28 pm »
And, then tell me what wx-config --prefix returns or I will add you to the list of people who is not able to be helped by me!

I was reading through similar threads (in wxwidgets forum) and in one thread someone told that when you are in the directory you need to write ./wx-config, NOT wx-config. Cool, now I know something you didn't know and revealed to me in the first place. So now, ./wx-config --prefix returns:

/Users/Krice/Documents/wxw

(I guess it's safe to tell my osx username, it's not like it's a mystery...)

And that's where wxwidgets is installed. wxWidgets is also working, the minimal example compiles and runs fine.
« Last Edit: August 15, 2019, 12:51:22 pm by Krice »

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #14 on: August 15, 2019, 01:46:56 pm »
when you are in the directory you need to write ./wx-config, NOT wx-config

Welcome to Linux where unlike in Windows the current directory is not on the search path.

And now head on and fix autoconf...

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1635
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #15 on: August 15, 2019, 02:04:14 pm »
Welcome to Linux where unlike in Windows the current directory is not on the search path.

This is true for cmd.exe, but not for PowerShell. M$ is slowly approaching to Linux.

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #16 on: August 15, 2019, 04:15:04 pm »
Welcome to Linux where unlike in Windows the current directory is not on the search path.

Could you like stay away from this discussion, because you are not adding anything to it? If you like to insult people, do it elsewhere.

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #17 on: August 15, 2019, 04:29:43 pm »
Should have quoted your following sentence as well... but yes, i already told you two times what the problem is and how to fix it, i am done here.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #18 on: August 16, 2019, 12:22:03 am »
So, does the clearly obvious code work?

Code
export ACLOCAL_FLAGS="-I `./wx-config --prefix`/share/aclocal"

Edit: And, post a link to the wxWidgets directions you are following.

Edit2: And, why does the directions not say to install the wxWidgets?

And, why do you NOT use the wxforums to get help?

Tim S.
« Last Edit: August 16, 2019, 12:53:45 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #19 on: August 16, 2019, 02:46:40 pm »
So, does the clearly obvious code work?

It does.. I guess. It's not telling anything. However bootstrap doesn't work, it's still stopping when it doesn't find /Users/Krice/Documents/wxw/share/aclocal directory. That directory doesn't exist, so it's kind of hard to find it.

Quote
Edit: And, post a link to the wxWidgets directions you are following.

docs/osx/install.md in wxwidgets.

Quote
Edit2: And, why does the directions not say to install the wxWidgets?

It does. It IS installed. However there are two kinds of installation, local and to usr/ (system) with sudo make install. The system wide installation is not recommended in docs/osx/install.md so I haven't done it yet. The question is does Code::Blocks require it?

Quote
And, why do you NOT use the wxforums to get help?

I have. wxWidgets installation works, no problems there.

Offline sodev

  • Lives here!
  • ****
  • Posts: 500
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #20 on: August 16, 2019, 06:26:04 pm »
It IS installed.

It is NOT installed. If it would be installed, /Users/Krice/Documents/wxw/share/aclocal would exist, because your prefix is /Users/Krice/Documents/wxw so a make install would install into that prefix and during installation share/aclocal would be created to put wxwin.m4 into it.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #21 on: August 16, 2019, 09:32:31 pm »
Krice: I never liked the twenty question game; I will add you to my list of people who it is useless to try to help!!

You skipped the installation step; but, you keep saying you installed wxWidgets!!!!!!!!!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #22 on: August 18, 2019, 10:26:18 am »
It is NOT installed.

I ran sudo make install and now ./bootstrap work, however when I run ./configure for Code::Blocks I get this error:

Code
configure: error: Package requirements (hunspell) were not met:

No package 'hunspell' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables HUNSPELL_CFLAGS
and HUNSPELL_LIBS to avoid the need to call pkg-config.

By the way, wxwidget people say Code::Blocks is doing it the wrong way, you should not have to make install the library:
https://forums.wxwidgets.org/viewtopic.php?f=23&p=193484&sid=2001ebb0b423d41e4be8134b3ef2758d#p193484

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7682
    • My Best Post
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #23 on: August 18, 2019, 02:41:03 pm »
You have a lot to learn about programming.

I hope you have a sane reason to self build Code::Blocks.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #24 on: August 19, 2019, 08:47:05 am »
You have a lot to learn about programming.

No, I only need to "learn" the idiocy that is unix command line "programming". In Windows this problem doesn't even exist, because projects are created in IDE (as they should) and libraries are mostly pre-compiled and ready to use. Compiling everything from source seems to be somewhat problematic to say the least, but it's something you need when nothing stays compatible and there are different versions of everything. Even OSX can break programs when they release a new os version.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #25 on: August 19, 2019, 11:00:53 am »
About hunspell... well you have to install the dev package of hunspell or configure codeblocks without spellchecker.
About installing wxWidgets: How should it be? Where should codeblocks look for wx installations, if not in the global folder. I have read your forum link, but i can not find out how it should be done right...
I do nothing with the autotools scrips and the AM system, so i may be wrong hardly, but isn't it that the bootstrap searches for wxWidgets AM scripts, that tell the autotools process where to search wxWidgets and what configuration to use? So if the AM scripts are not found in the right place (by being installed in the global install directory) how should bootstrap continue? Or in what directories should bootstrap search for AM files?

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #26 on: August 19, 2019, 12:25:48 pm »
About hunspell... well you have to install the dev package of hunspell

I think it would be nice to inform that you need some external packages and how to get them. In this case 'brew install hunspell' fixed this problem, although it gives an error since it can't write something to usr/local... but Code::Blocks ./configure works so it's probably not important. At the moment I'm building C::B with make. It's running in background so I'll get back if something fails.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #27 on: August 19, 2019, 01:59:31 pm »
It would be really really great if you could write up your findings, and post it in the wiki (the forum user name should be the same for the wiki) Or write it up here and i will move it to the wiki... Some easy step by step guide would be nice...

As i told earlier, we do not have many (actually none) mac devs and every bit of information helps....

Thank you!

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #28 on: August 19, 2019, 02:57:46 pm »
It would be really really great if you could write up your findings

I can try to write something later (I have kept a blog about unix programming, but it's a mess). Meanwhile it did build and also runs. The readme is talking about 'devel' and 'output' directories but afaik no such things exist. It's creating codeblocks executable in usr/local/bin and that's about it. When you exit codeblocks it throws this:

Deinitializing plugins...
../src/osx/window_osx.cpp(727): assert ""tlw"" failed in DoClientToScreen(): TopLevel window missing
Collecting stack trace information, please wait...Trace/BPT trap: 5

But I'm not that surprised. I tried to run cppcheck for couple of files and already got warnings. It's really not that difficult to fix those kind of problems with cppcheck or some other static analysis tool like heavier use of gcc compiler flags. Cppcheck is a tool everyone should use in C++ programming in my opinion, it's just so easy to catch typical stuff with it.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #29 on: August 19, 2019, 04:19:38 pm »
Every report helps... And patches help even more...
Thank you in advance!

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #30 on: August 20, 2019, 08:45:43 am »
And patches help even more...

I don't even know how you would go on from compiling to developing Code::Blocks, because there is no information about how to use the source code. For example loading src/src/, I guess the main part of source code to Visual Studio Code is already annoying, because the physical structure is not reflected in the source code, so header files are mostly not there for VS Code to find. It's all makefile magic to put pieces together. And on top of that for some reason .o files are made in the same directory. I think you should "flatten" the source code as much as possible, in other words try to put source files in the same directory and .o files to their own directory for sure. I have flattened all my projects and one of them has 250+ source files in the same directory which is not a problem, because in IDE you can structure it with virtual folders anyway. It would be great if you could load the project in let's say XCode and work from IDE.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #31 on: August 20, 2019, 08:52:01 am »
I do not understand your last comment. What has Visual Studio Code or XCode to do with codeblocks?
If you have a running codeblocks installation, you can load the codeblocks project easily in codeblocks and develop with it (open the cbp files or workspace files for unix). then the o files will be generated in the .obj folder ecc... The make path is only needed for get going, after that you can use codeblocks to develop codeblocks...

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #32 on: August 20, 2019, 04:06:39 pm »
you can load the codeblocks project easily in codeblocks

I think there is something wrong with the build, because I can't load a project. There is a error dialog telling I don't have a compiler plugin installed. Also, when I go to "settings - compiler" menu there is only batch build tab. That's not right? And last but not least all plugins are missing from the plugin list. I wonder is the codeblocks in usr/local/bin the right one, because I think there was another under the trunk. I really wish there was another person with a Mac to try this and tell if I'm just doing something wrong.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #33 on: August 20, 2019, 04:13:54 pm »
Maybe Xaviou can help you?
Isn't mac the same as OS X ?

http://forums.codeblocks.org/index.php/topic,23428.msg159512.html#msg159512

Offline Krice

  • Almost regular
  • **
  • Posts: 152
Re: Compiling Code::Blocks: ./bootstrap command errors.
« Reply #34 on: August 31, 2019, 11:31:01 am »
Just a small update. I removed everything related to programming from my Mac Mini that I could. It's 2012 Mini and has a traditional hard drive which I think has started to break, even it doesn't show anything in "first aid" of disk utility. It's just extremely slow, everything is slow, even clicking a menu makes the notorious beachball roll. I'm probably going to get a new computer (Windows 10 PC), because I need a computer for my music studio. Not only programming is hard in osx, but also everything else is just so annoying like stupid background tasks you can't even turn off. They are mostly Apple's own tasks like Photos which for whatever reason is searching the HD for videos and making a library of them, like all the time. It's always on and taking cpu time. Apple is trying really hard to ruin Mac and they will succeed if they don't clean it up.