thlorenz/learnuv

unclear how to build example

mulderp opened this issue · 3 comments

hi,

i was wondering how to build the first example to test my libuv learnings. what i tried was this on MacOS:

$ gcc -I deps/libuv/test/ -I deps/libuv/include/ -I deps/log src/01_system_info.c
Undefined symbols for architecture x86_64:
  "_uv_err_name", referenced from:
      _main in 01_system_info-fe7cb9.o
  "_uv_strerror", referenced from:
      _main in 01_system_info-fe7cb9.o
  "_uv_uptime", referenced from:
      _main in 01_system_info-fe7cb9.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Just use one of the commands explained in the readme, i.e.: ./learnuv make

@mulderp I know how to build examples by looking at learnuv.gyp since no make target is mentioned in the readme file :). Then you need to run exercise e.g. ./out/Debug/01_system_info before ./learnuv verify - it isn't mentioned in the readme too. These are trivial steps but if we created an instruction, it would be better to complete all steps and not skipping some in the middle. This kind of repo is for beginners, not experts :D

Actually it works perfectly if you follow the directions.
As soon as you choose a test form the menu with ./learnuv you have to edit the corresponding file inside the src directory. When you feel confident that you have the solution you can build this test with ./learnuv make. If you have no errors you could try to verify with ./learnuv verify. If you succeeded go back to menu and take the next one. I am on test five now and I have learned all about the pointer *

Really nice work @thlorenz and very valuable if you want to learn about libuv.

I hope more people to share knowledge like you, but instead sometime you see people to be envy the sharing because probably they do not get it from the beginning. The problem is not libuv or learnuv, but it could be c or c++ or even worse!