Skip to content

Fix make compile error in expose.cpp(?)#44

Merged
LostRuins merged 2 commits intoLostRuins:concedofrom
rabidcopy:fix-compile
Apr 12, 2023
Merged

Fix make compile error in expose.cpp(?)#44
LostRuins merged 2 commits intoLostRuins:concedofrom
rabidcopy:fix-compile

Conversation

@rabidcopy
Copy link
Copy Markdown

@rabidcopy rabidcopy commented Apr 11, 2023

Not sure if this right but currently get this when trying to compile on Linux.

expose.cpp: In function ‘bool load_model(load_model_inputs)’:
expose.cpp:39:33: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
   39 |         putenv(platformenv.c_str());
      |                ~~~~~~~~~~~~~~~~~^~
      |                                 |
      |                                 const char*
In file included from /usr/include/c++/12.2.1/cstdlib:75,
                 from /usr/include/c++/12.2.1/ext/string_conversions.h:41,
                 from /usr/include/c++/12.2.1/bits/basic_string.h:3960,
                 from /usr/include/c++/12.2.1/string:53,
                 from /usr/include/c++/12.2.1/bits/locale_classes.h:40,
                 from /usr/include/c++/12.2.1/bits/ios_base.h:41,
                 from /usr/include/c++/12.2.1/ios:42,
                 from /usr/include/c++/12.2.1/istream:38,
                 from /usr/include/c++/12.2.1/fstream:38,
                 from expose.cpp:12:
/usr/include/stdlib.h:667:26: note:   initializing argument 1 of ‘int putenv(char*)’
  667 | extern int putenv (char *__string) __THROW __nonnull ((1));
      |                    ~~~~~~^~~~~~~~
expose.cpp:40:31: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
   40 |         putenv(deviceenv.c_str());
      |                ~~~~~~~~~~~~~~~^~
      |                               |
      |                               const char*
/usr/include/stdlib.h:667:26: note:   initializing argument 1 of ‘int putenv(char*)’
  667 | extern int putenv (char *__string) __THROW __nonnull ((1));
      |                    ~~~~~~^~~~~~~~
make: *** [Makefile:178: expose.o] Error 1

@LostRuins LostRuins merged commit 2444a99 into LostRuins:concedo Apr 12, 2023
@LostRuins
Copy link
Copy Markdown
Owner

LGTM

Foxy6670 pushed a commit to Foxy6670/koboldcpp that referenced this pull request Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants