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

Cannot link to previous recipes headers #511

Open
mateovilla2 opened this issue Jun 21, 2019 · 4 comments
Open

Cannot link to previous recipes headers #511

mateovilla2 opened this issue Jun 21, 2019 · 4 comments

Comments

@mateovilla2
Copy link

Dear Authors,

Congratulations for your book, I consider it very interesting.

I'm not very expert in compilation,. I just simply cannot compiles the recipes of the first chapter
because it shows me the following error :

/home/mvilla/Documents/CMakeCookbook/chapter-01/recipe-02/cxx-example/hello-world.cpp:1:1: error: expected unqualified-id before ‘.’ token ../../recipe-01/cxx-example/hello-world.cpp

Your Environment

  • Version used: Cmake 3.13.4
  • Operating System and version:gcc version 6.5.0 20181026 (Ubuntu 6.5.0-2ubuntu1~16.04)

How could I fix this ?

Thanks for your answer,

Mateo

@MicheleBe
Copy link

MicheleBe commented Jun 21, 2019 via email

@robertodr
Copy link
Collaborator

Hello @mateovilla2 and thanks for your interest in this project!
As @MicheleBe says, we use symlinks quite extensively in the repository, for two reasons:

  1. We can reuse and extend certain examples without duplicating source files (which would lead to examples diverging, in the long run)
  2. To reduce total size of the repository (though this was not the most pressing concern for our choice)

Given this preamble, on Linux it is perfectly fine to not copy/replace anything to run the examples. So to get to the bottom of this, how did you get a copy of the repository and how are you issuing the compile commands?

@mateovilla2
Copy link
Author

mateovilla2 commented Jun 28, 2019

Thank @MicheleBe and @robertodr for your answers !!! Yes actually my question was more in the sense of what @robertodr says, I suppossed that on linux It was not necessary to copy/replace repeated code.
I got the code from the packtpub interface, and the compiling method is :

  • Create the build folder inside the recipe folder
  • cd build
  • cmake ..
  • then I tried with cmake --build . and then just with "make" and it shows the same error

@robertodr
Copy link
Collaborator

I suggest you clone or download the zip file directly from this repository. I am not quite sure how the publisher uploaded code on their servers and it does seems like symbolic links were replaced by actual files whose contents are not correct.

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

3 participants