Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
anass783
In need of some credit
In need of some credit
Posts: 4
Joined: Wed May 06, 2020 5:38 pm

Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by anass783 » Wed May 06, 2020 6:04 pm

Hello,
After upgrading my Mac OS to Catalina and format it, I'm getting weird errors when compiling a projet with g++-9 like this :

Code: Select all

g++-9  -c main.cpp   -I /Download/project/include -I /usr/local/include -I /Downloads/trimesh2/include/ -I /Downloads/armadillo-6.400.3/include/ -I /usr/X11R6/include -I /Downloads/project/include  -o main.o
.

The errors I'm getting are for example :

Code: Select all

/Users/anass/Documents/projet/non_virtual_asgard/include/core/MeshDataSource.h:326:20:   required from here
/usr/local/Cellar/gcc/9.3.0_1/include/c++/9.3.0/ostream:691:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
or

Code: Select all

 
/Users/anass/Documents/projet/non_virtual_asgard/include/core/MeshDataSource.h:337:21: error: no match for 'operator<<' (operand types are 'std::ofstream' {aka 'std::basic_ofstream<char>'} and 'const char [3]')

Otherwie, when I compile with g++ which point to clang , I get others errors like :

Code: Select all

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'isinf' in the global namespace
using ::isinf;
or

Code: Select all

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
I really do know why I have these errors, since I installer gcc with Homebrew.
Any help please?

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4043
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by ONEEYEMAN » Thu May 07, 2020 2:47 pm

Hi,
Are you getting the errors from compiling the library or your own code?

Thank you.

anass783
In need of some credit
In need of some credit
Posts: 4
Joined: Wed May 06, 2020 5:38 pm

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by anass783 » Thu May 07, 2020 3:54 pm

Thank you for your response.

The library has just headers files (.h).
My file main.cpp contains this :

Code: Select all

#include "core/MeshDataSource.h" //fichier source du projet
#include <iostream>
 
int main()
{
 MeshDataSource<double> MDS; //déclaration d'un objet de type MeshDataSource
 
return0;
}

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4043
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by ONEEYEMAN » Thu May 07, 2020 4:35 pm

Hi,
One more question - do you have Xcode and the "Command-Line Tools" installed?

And you really shuold recompile the wxWidgets...

Thank you.

anass783
In need of some credit
In need of some credit
Posts: 4
Joined: Wed May 06, 2020 5:38 pm

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by anass783 » Mon May 11, 2020 3:26 pm

yes of course, they are installed :/

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4043
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by ONEEYEMAN » Mon May 11, 2020 4:46 pm

Hi,
Did you compile wxWidgets itself?
I.e. did you do:

Code: Select all

cd wxWidgets
mkdir buildMac
cd buildMac
../configure --enable-debug
make 
Thank you.

anass783
In need of some credit
In need of some credit
Posts: 4
Joined: Wed May 06, 2020 5:38 pm

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by anass783 » Wed May 13, 2020 12:03 am

Sorry , but i think you didn't understand me. My aim is not de compile or use wxWidgets. My aim is to fix my mac compilers since they bring weir errors.

stahta01
Super wx Problem Solver
Super wx Problem Solver
Posts: 354
Joined: Fri Nov 03, 2006 2:00 pm

Re: Cannot compile from source with g++-9 or Clang on MAC OS Catalina

Post by stahta01 » Wed May 13, 2020 1:26 am

anass783 wrote:
Wed May 13, 2020 12:03 am
Sorry , but i think you didn't understand me. My aim is not de compile or use wxWidgets. My aim is to fix my mac compilers since they bring weir errors.
http://www.catb.org/~esr/faqs/smart-questions.html
Be sensitive in choosing where you ask your question. You are likely to be ignored, or written off as a loser, if you:
1. post your question to a forum where it's off topic
...
Tim S.

Post Reply