g++: error: unrecognized command line option ‘-stdlib=libc++’ #1

Open
opened 2020-03-16 23:45:34 +00:00 by YoungPizza · 8 comments

Hello there,
I want to install this application because it, maybe, will be my solution to finally disable my dedicated GPU without blacklisting or modesetting something.
OS: Kubuntu 19.10.
I found this error message while creating makefile:

root@Nitro:/home/davide/device_manager_4_linux# make
g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -stdlib=libc++ -nostdinc++ -O2 -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp
g++: error: unrecognized command line option ‘-stdlib=libc++’
Makefile:583: recipe for target 'application.o' failed
make: *** [application.o] Error 1
root@Nitro:/home/davide/device_manager_4_linux# ls
 application.cpp   bootstrap.cpp   COPYING         demo           dm4l.pro        lib          LICENSE    README.md  'RULES OF CONTRIBUTION'  'THIS IS WORK IN PROGRESS'   ui_device_prop.h    ui_main_window.h
 application.h     clangxx.inc     definitions.h   DISTRIBUTION   dm4l.pro.user   libcxx.inc   Makefile   res         screenshots              ui                          ui_input_string.h   ui_toast_message.h

Thanks in advice!

Hello there, I want to install this application because it, maybe, will be my solution to finally disable my dedicated GPU without blacklisting or modesetting something. OS: Kubuntu 19.10. I found this error message while creating makefile: ``` root@Nitro:/home/davide/device_manager_4_linux# make g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -stdlib=libc++ -nostdinc++ -O2 -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp g++: error: unrecognized command line option ‘-stdlib=libc++’ Makefile:583: recipe for target 'application.o' failed make: *** [application.o] Error 1 ``` ``` root@Nitro:/home/davide/device_manager_4_linux# ls application.cpp bootstrap.cpp COPYING demo dm4l.pro lib LICENSE README.md 'RULES OF CONTRIBUTION' 'THIS IS WORK IN PROGRESS' ui_device_prop.h ui_main_window.h application.h clangxx.inc definitions.h DISTRIBUTION dm4l.pro.user libcxx.inc Makefile res screenshots ui ui_input_string.h ui_toast_message.h ``` Thanks in advice!
rdnvndr added a new dependency 2020-03-18 08:41:27 +00:00
Owner

Sorry for late reply, I hadn't checked for messages, I am aware of this, all you need to do is open file "clangxx.inc" in a text editor and remove "-stdlib=libc++" from line 2, so currently you would have this:

QMAKE_CXXFLAGS += -stdlib=libc++ -std=c++11 -nostdinc++ # -stdlib=libc++ -I/usr/lib/llvm-7/include/c++/v1 -L/usr/lib/llvm-7/lib -lc++ -Wl,-rpath,/usr/lib/llvm-7/lib

replace that with:

QMAKE_CXXFLAGS += -std=c++11 -nostdinc++

That should do if all of the dependencies are met. I will be creating an AppImage very soon, I am just working on a different really cool project (nearly done) which would be open source.

Also, I just updated Device Manager 4 Linux, fixing a search issue, please redownload the project.

Let me know whether this fixes your issue.

Also, do not disable anything on start up before first trying it out for the current session as shown in the video. Also, if you mess something up, make sure you know how to fix it as I won't be able to assist you.

Another thing, you can run the binary from a terminal emulator if you want to see what's happening and what scripts are about to run. This allows you to check things out before agreeing to message boxes to proceed.

I hope this helps.

Sorry for late reply, I hadn't checked for messages, I am aware of this, all you need to do is open file "**clangxx.inc**" in a text editor and remove "**-stdlib=libc++**" from line 2, so currently you would have this: `QMAKE_CXXFLAGS += -stdlib=libc++ -std=c++11 -nostdinc++ # -stdlib=libc++ -I/usr/lib/llvm-7/include/c++/v1 -L/usr/lib/llvm-7/lib -lc++ -Wl,-rpath,/usr/lib/llvm-7/lib` replace that with: `QMAKE_CXXFLAGS += -std=c++11 -nostdinc++` That should do if all of the dependencies are met. I will be creating an AppImage very soon, I am just working on a different really cool project (nearly done) which would be open source. Also, I just updated Device Manager 4 Linux, fixing a search issue, please redownload the project. Let me know whether this fixes your issue. Also, do not disable anything on start up before first trying it out for the current session as shown in the video. Also, if you mess something up, make sure you know how to fix it as I won't be able to assist you. Another thing, you can run the binary from a terminal emulator if you want to see what's happening and what scripts are about to run. This allows you to check things out before agreeing to message boxes to proceed. I hope this helps.
Author

@neolinux.tech
I've edited "clangxx.inc" this is his build:

message("Using clang++")
QMAKE_CXXFLAGS += -std=c++11 -nostdinc++ # -stdlib=libc++ -I/usr/lib/llvm-7/include/c++/v1 -L/usr/lib/llvm-7/lib -lc++ -Wl,-rpath,/usr/l>
root@NITRO5:/home/davide/device_manager_4_linux# make
g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -nostdinc++ -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp
In file included from application.cpp:28:
application.h:32:10: fatal error: sigc++-2.0/sigc++/sigc++.h: File o directory non esistente
   32 | #include <sigc++-2.0/sigc++/sigc++.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:571: application.o] Error 1
root@NITRO5:/home/davide/device_manager_4_linux# ls
 application.cpp   COPYING         dm4l.pro        LICENSE    'RULES OF CONTRIBUTION'      ui_device_prop.h
 application.h     definitions.h   dm4l.pro.user   Makefile    screenshots                 ui_input_string.h
 bootstrap.cpp     demo            lib             README.md  'THIS IS WORK IN PROGRESS'   ui_main_window.h
 clangxx.inc       DISTRIBUTION    libcxx.inc      res         ui                          ui_toast_message.h
@neolinux.tech I've edited "**clangxx.inc**" this is his build: ``` message("Using clang++") QMAKE_CXXFLAGS += -std=c++11 -nostdinc++ # -stdlib=libc++ -I/usr/lib/llvm-7/include/c++/v1 -L/usr/lib/llvm-7/lib -lc++ -Wl,-rpath,/usr/l> ``` ``` root@NITRO5:/home/davide/device_manager_4_linux# make g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -nostdinc++ -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp In file included from application.cpp:28: application.h:32:10: fatal error: sigc++-2.0/sigc++/sigc++.h: File o directory non esistente 32 | #include <sigc++-2.0/sigc++/sigc++.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:571: application.o] Error 1 ``` ``` root@NITRO5:/home/davide/device_manager_4_linux# ls application.cpp COPYING dm4l.pro LICENSE 'RULES OF CONTRIBUTION' ui_device_prop.h application.h definitions.h dm4l.pro.user Makefile screenshots ui_input_string.h bootstrap.cpp demo lib README.md 'THIS IS WORK IN PROGRESS' ui_main_window.h clangxx.inc DISTRIBUTION libcxx.inc res ui ui_toast_message.h ```
Owner

That's one of the dependencies that's required.

You need to install libsigc++-2.0-dev.

I will be creating an official AppImage soon so you won't have to worry about compiling it manually. Sorry for the delays for this. I am just busy with a different project right now but when I am done with it, I will be releasing both projects at the same time.

That's one of the dependencies that's required. You need to install libsigc++-2.0-dev. I will be creating an official AppImage soon so you won't have to worry about compiling it manually. Sorry for the delays for this. I am just busy with a different project right now but when I am done with it, I will be releasing both projects at the same time.
Author
root@NITRO5:/home/davide/device_manager_4_linux# make
g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -nostdinc++ -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp
In file included from application.h:32,
                 from application.cpp:28:
/usr/include/sigc++-2.0/sigc++/sigc++.h:104:10: fatal error: sigc++/signal.h: File o directory non esistente
  104 | #include <sigc++/signal.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:574: application.o] Error 1
root@NITRO5:/usr/include/sigc++-2.0/sigc++# ls
adaptors  bind_return.h  functors           reference_wrapper.h  sigc++.h       ****signal.h****  trackable.h    visit_each.h
bind.h    connection.h   limit_reference.h  retype_return.h      signal_base.h  slot.h    type_traits.h

-.-"

``` root@NITRO5:/home/davide/device_manager_4_linux# make g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -nostdinc++ -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp In file included from application.h:32, from application.cpp:28: /usr/include/sigc++-2.0/sigc++/sigc++.h:104:10: fatal error: sigc++/signal.h: File o directory non esistente 104 | #include <sigc++/signal.h> | ^~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:574: application.o] Error 1 ``` ``` root@NITRO5:/usr/include/sigc++-2.0/sigc++# ls adaptors bind_return.h functors reference_wrapper.h sigc++.h ****signal.h**** trackable.h visit_each.h bind.h connection.h limit_reference.h retype_return.h signal_base.h slot.h type_traits.h ``` # -.-"
Owner

The compiler is complaining it cannot find the following:

<sigc++/signal.h>

Type find /usr -name "signal.h" | grep sigc++ and post the output.

On my system, this is what it returns:

/usr/include/sigc++-2.0/sigc++/signal.h

You would need to add the path to /usr/include/sigc++-2.0/sigc++ but without the sigc++ as an include path to the compiler. You can do this by opening libcxx.inc in a text editor and adding it there.

Delete the last two lines starting with # in libcxx.inc and then if your path to sigc++/signal.h is /usr/include/sigc++-2.0, you would add the following:

INCLUDEPATH += /usr/include/sigc++-2.0 \

So your libcxx.inc would look like this:

   message("Using libc++")

   LIBS += -L/usr/lib/llvm-7/lib -lc++
   INCLUDEPATH  += /usr/lib/llvm-7/include/c++/v1 \
   /usr/include/sigc++-2.0 \

If you give me the output of find /usr -name "signal.h" | grep sigc++ I will try to show you how your libcxx.inc should look.

The compiler is complaining it cannot find the following: `<sigc++/signal.h>` Type `find /usr -name "signal.h" | grep sigc++` and post the output. On my system, this is what it returns: `/usr/include/sigc++-2.0/sigc++/signal.h` You would need to add the path to `/usr/include/sigc++-2.0/sigc++` but without the `sigc++` as an include path to the compiler. You can do this by opening `libcxx.inc` in a text editor and adding it there. Delete the last two lines starting with `#` in `libcxx.inc` and then if your path to `sigc++/signal.h` is `/usr/include/sigc++-2.0`, you would add the following: `INCLUDEPATH += /usr/include/sigc++-2.0 \` So your `libcxx.inc` would look like this: ``` message("Using libc++") LIBS += -L/usr/lib/llvm-7/lib -lc++ INCLUDEPATH += /usr/lib/llvm-7/include/c++/v1 \ /usr/include/sigc++-2.0 \ ``` If you give me the output of `find /usr -name "signal.h" | grep sigc++` I will try to show you how your `libcxx.inc` should look.
Author

Hello @neolinux.tech, thank you for your support. I very appreciate that.
This is my find /usr -name "signal.h" | grep sigc++ output:

/usr/include/sigc++-2.0/sigc++/signal.h.

This is my libcxx.inc output:

  GNU nano 4.3                                                  libcxx.inc                                                               
   message("Using libc++")

   LIBS += -L/usr/lib/llvm-7/lib -lc++
   INCLUDEPATH  += /usr/lib/llvm-7/include/c++/v1 \
   /usr/include/sigc++-2.0 \

Then:

davide@NITRO5:~/device_manager_4_linux$ sudo make
/usr/lib/qt5/bin/qmake -o Makefile dm4l.pro
Project MESSAGE: Using libc++
Project MESSAGE: Using clang++
g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -nostdinc++ -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/sigc++-2.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp
In file included from /usr/include/sigc++-2.0/sigc++/sigc++.h:104,
                 from application.h:32,
                 from application.cpp:28:
/usr/include/sigc++-2.0/sigc++/signal.h:7:10: fatal error: list: File o directory non esistente
    7 | #include <list>
      |          ^~~~~~
compilation terminated.
make: *** [Makefile:574: application.o] Error 1

Hello @neolinux.tech, thank you for your support. I very appreciate that. This is my `find /usr -name "signal.h" | grep sigc++` output: `/usr/include/sigc++-2.0/sigc++/signal.h`. This is my libcxx.inc output: ``` GNU nano 4.3 libcxx.inc message("Using libc++") LIBS += -L/usr/lib/llvm-7/lib -lc++ INCLUDEPATH += /usr/lib/llvm-7/include/c++/v1 \ /usr/include/sigc++-2.0 \ ``` Then: ``` davide@NITRO5:~/device_manager_4_linux$ sudo make /usr/lib/qt5/bin/qmake -o Makefile dm4l.pro Project MESSAGE: Using libc++ Project MESSAGE: Using clang++ g++ -c -pipe -Wno-unused-command-line-argument -fpermissive -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=c++11 -nostdinc++ -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/lib/llvm-7/include/c++/v1 -isystem /usr/include/sigc++-2.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o application.o application.cpp In file included from /usr/include/sigc++-2.0/sigc++/sigc++.h:104, from application.h:32, from application.cpp:28: /usr/include/sigc++-2.0/sigc++/signal.h:7:10: fatal error: list: File o directory non esistente 7 | #include <list> | ^~~~~~ compilation terminated. make: *** [Makefile:574: application.o] Error 1 ```
Owner

It complains it cannot find a header file named list but that's weird because my version of signal.h does not have references to that file.

Which Linux distribution are you using? I can install it in a VM and then install sigc++ and see what it installs. I want to try to duplicate the error.

Btw, you should not be running make by itself withsudo

It complains it cannot find a header file named **list** but that's weird because my version of **signal.h** does not have references to that file. Which Linux distribution are you using? I can install it in a VM and then install sigc++ and see what it installs. I want to try to duplicate the error. Btw, you should not be running **make** by itself with`sudo`
Author

I'm sorry @neolinux.tech for my inactivity, I will wait the AppImage for more compatibility. My Distro is Kubuntu 19.10. Have a nice day.

I'm sorry @neolinux.tech for my inactivity, I will wait the AppImage for more compatibility. My Distro is Kubuntu 19.10. Have a nice day.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Blocks
You do not have permission to read 1 dependency
Reference: sasko.usinov/device_manager_4_linux#1
No description provided.