Author Topic: trunk doesn't build?  (Read 5042 times)

Offline vri

  • Multiple posting newcomer
  • *
  • Posts: 18
trunk doesn't build?
« on: May 30, 2009, 12:36:48 pm »
Or am I doing something stupid??

Code
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7606
    • My Best Post
Re: trunk doesn't build?
« Reply #1 on: May 30, 2009, 01:45:41 pm »
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++ 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 vri

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: trunk doesn't build?
« Reply #2 on: May 30, 2009, 01:55:57 pm »
$ 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...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7606
    • My Best Post
Re: trunk doesn't build?
« Reply #3 on: May 30, 2009, 02:09:52 pm »
Blind Patch needs tested on Linux Box. Tim S

Code
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++ 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 vri

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: trunk doesn't build?
« Reply #4 on: May 30, 2009, 02:54:58 pm »
Hmm, should have searched a bit better, because the same error has been reported already by dk in this thread:
http://forums.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.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5502
Re: trunk doesn't build?
« Reply #5 on: May 30, 2009, 06:45:37 pm »
sort of applied Tim's suggestion.