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

'gtest/internal/gtest-port-arch.h' not found building Xcode project after including gtest.h #953

Closed
FlashSheridan opened this issue Dec 6, 2016 · 7 comments

Comments

@FlashSheridan
Copy link

After adding #include "gtest/gtest.h" to main.cpp as instructed in Primer.md, in an Xcode project set up as in XcodeGuide.md (with corrections, e.g., as in bug #951), compilation fails with

error: 'gtest/internal/gtest-port-arch.h' file not found.

This seems to be because gtest-port-arch.h is missing from https://github.com/google/googletest/blob/master/googletest/xcode/gtest.xcodeproj/project.pbxproj, though, e.g., gtest-port.h is present. The entire directory Headers/internal/custom seems to be missing as well.
After correcting both the above omissions by manually copying the files into the framework, compilation succeeds, though linking fails for testing::internal::StringStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits, std::__1::allocator >*).

Here’s more of the compilation error message:

In file included from /Volumes/Norlamin/Users/flash/Documents/git/New_Code/Programming_Exercises/Other learning projects/String Play/GooTests/main.cpp:11:

In file included from /Volumes/Norlamin/Users/flash/Documents/git/New_Code/Programming_Exercises/Other learning projects/String Play/GooTests/gtest.framework/Headers/gtest.h:58:

In file included from /Volumes/Norlamin/Users/flash/Documents/git/New_Code/Programming_Exercises/Other learning projects/String Play/GooTests/gtest.framework/Headers/internal/gtest-internal.h:40:

/Volumes/Norlamin/Users/flash/Documents/git/New_Code/Programming_Exercises/Other learning projects/String Play/GooTests/gtest.framework/Headers/internal/gtest-port.h:281:10: fatal error: 'gtest/internal/gtest-port-arch.h' file not found

#include "gtest/internal/gtest-port-arch.h"

@kdawgwilk
Copy link

Also running into this error

@skeid21
Copy link

skeid21 commented Mar 17, 2017

I'm wondering if there are long term plans to support macOS. Could a maintainer of the project speak to that?

@imadsco
Copy link

imadsco commented Apr 5, 2017

did you get a fix to that ?

@skeid21
Copy link

skeid21 commented Apr 5, 2017

FlashSheridan mentioned this is an issue with header copy phases for the generated framework. You can adjust the header copy phases to pull in the missing headers.

@kdawgwilk
Copy link

I also think you can re-run CMake to generate the Xcode project as well.

@4brunu
Copy link

4brunu commented May 16, 2017

#725 got merged yesterday to master, maybe this fix the issue.
Can anyone confirm this?

@gennadiycivil
Copy link
Contributor

I have been cleaning up older and inactive GitHub googletest issues. You may see an issue "closed" if it appears to be inactive/abandoned
Thank you

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

No branches or pull requests

6 participants