Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When compiling with NumCpp getting a lot of errors #140

Closed
erikthegamer1242 opened this issue Mar 13, 2022 · 4 comments
Closed

When compiling with NumCpp getting a lot of errors #140

erikthegamer1242 opened this issue Mar 13, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@erikthegamer1242
Copy link

Describe the bug
Installed NumCpp latest on ArchLinux using CMake, and when building using g++ getting a lot of errors. Except for the include line, I haven't even used it anywhere inside my code.

To Reproduce
Steps to reproduce the behavior:

  1. Install NumCpp using CMake
  2. Include in a cpp file like this: #include <NumCpp.hpp>
  3. Compile using g++ like this: g++ test.cpp -o test
  4. Get errors: log.txt

Expected behavior
Should compile normally

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
g++ verion: g++ (GCC) 11.2.0
c++ standard used: c++14

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@dpilger26
Copy link
Owner

Sorry, I'm going to need more to go on than this...?

@dpilger26 dpilger26 self-assigned this Mar 26, 2022
@dpilger26 dpilger26 added the question Further information is requested label Mar 26, 2022
@erikthegamer1242
Copy link
Author

Sorry for the late response. I have since realized that it only throws the compile error if I also include Xlib like this: #include <X11/Xlib.h> or #include <X11/Xutil.h>

The whole program that I used to test this:

#include "/usr/include/opencv2/opencv.hpp"
#include "/usr/include/opencv2/core/mat.hpp"
//#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <iostream>
#include <NumCpp.hpp>

using namespace std;

int main() {
    cout << "hello World!";
}```

@dpilger26
Copy link
Owner

Ah ok. My guess is that X11, being an old C library, probably does something like

#define Bool int

somewhere within the library. This will clash and cause problems with a couple template types in NumCpp... Macros are evil!. I'll rename that template parameter in the next release to try to avoid this type of issue in the future.

@dpilger26 dpilger26 added the enhancement New feature or request label Apr 7, 2022
@dpilger26 dpilger26 reopened this Jul 4, 2022
@dpilger26
Copy link
Owner

Mitigated in Version 2.8.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants