News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

trunk doesn't build?

Started by vri, May 30, 2009, 12:36:48 PM

Previous topic - Next topic

vri

Or am I doing something stupid??


prefix.cpp: In function 'char* br_extract_dir(const char*)':
prefix.cpp:396: error: invalid conversion from 'const char*' to 'char*'
prefix.cpp: In function 'char* br_extract_prefix(const char*)':
prefix.cpp:432: error: invalid conversion from 'const char*' to 'char*'
make[3]: *** [prefix.o] Error 1

stahta01

I would guess it is likely an Compiler Library Issue.
What OS?
What GCC Version?

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

vri

$ g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++ --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.4.0 20090505 (prerelease) (GCC)

OS: archlinux

indeed the compiler has been updated between my last (succesful) build and this one.

thanks for helping...

stahta01

Blind Patch needs tested on Linux Box. Tim S


Index: src/src/prefix.cpp
===================================================================
--- src/src/prefix.cpp (revision 5612)
+++ src/src/prefix.cpp (working copy)
@@ -389,7 +389,8 @@
char *
br_extract_dir (const char *path)
{
- char *end, *result;
+ const char *end;
+ char *result;

br_return_val_if_fail (path != (char *) NULL, (char *) NULL);

@@ -424,7 +425,8 @@
char *
br_extract_prefix (const char *path)
{
- char *end, *tmp, *result;
+ const char *end;
+ char *tmp, *result;

br_return_val_if_fail (path != (char *) NULL, (char *) NULL);

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

vri

Hmm, should have searched a bit better, because the same error has been reported already by dk in this thread:
http://forums.next.codeblocks.org/index.php/topic,10406.msg72109.html#msg72109. Jens couldn't reproduce it, well, it appears I can... Dk suggested a patch as well.

I applied your patch, Tim, and that resolves the compilation error. I personally have no idea at which moments this part of the code is used, but my new CB is up and running! So thanks.

killerbot

sort of applied Tim's suggestion.