Clock Gettime Linking Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads undefined reference to clock_gettime' in c with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Undefined Reference To Clock_gettime Cmake
Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: centos undefined reference to `clock_gettime' Sign up Ubuntu Linux C++ error: undefined reference to 'clock_gettime' and 'clock_settime' up vote 116 down vote favorite 14 I am pretty new to Ubuntu, but I can't seem to get this to work. It works fine on my school computers
Undefined Reference To Clock_gettime' Makefile
and I don't know what I am not doing. I have checked usr/include and time.h is there just fine. Here is the code: #include
Support Search GitHub This repository Watch 31 Star 172 Fork 57 spesmilo/sx Code Issues
Cmake Lrt
32 Pull requests 0 Projects 0 Pulse Graphs New issue Linking
Clock_gettime Windows
error during build - undefined reference to `clock_gettime' in libbitcoin #82 Open aantonop opened this Issue cmake librt May 24, 2014 · 5 comments Projects None yet Labels build Milestone No milestone Assignees No one assigned 5 participants aantonop commented May 24, 2014 While http://stackoverflow.com/questions/2418157/ubuntu-linux-c-error-undefined-reference-to-clock-gettime-and-clock-settim running the sx installer script: /usr/local/lib/libbitcoin.so: undefined reference to `clock_gettime' collect2: error: ld returned 1 exit status make[1]: *** [sx-addr] Error 1 make[1]: Leaving directory `/usr/local/src/sx-git/src' System details: Ubuntu 12.10 Linux bitcoin 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux veox added bug build labels May 24, https://github.com/spesmilo/sx/issues/82 2014 tphyahoo commented May 26, 2014 Same. I reverted to doing dev on branches forked from master. veox removed the bug label May 26, 2014 veox commented May 26, 2014 Something is wrong with your build environment. Might have been introduced by commit libbitcoin/libbitcoin@4f63088 in libbitcoin, but I don't think it was. Consider doing a git bisect to find out if so. clock_gettime is a standard POSIX function and should be provided by a libc-dev (or similar) package. Could you provide more verbose output, e.g. running make V=1 right after the install-sx.sh failing? Bobalot commented May 26, 2014 I remember a similar problem to this on osx, the clock_gettime wasn't linking properly. @Andreas The problem is ubuntu 12.10, upgrade to latest, it's likely your gcc isn't new enough and that is causing your problems or will cause you problems in the future. whats the output of gcc -v? System details: Ubuntu 12.10 Linux bitcoin 3.5.0-23-generic #35<#35>-Ubu
j2902 Member Registered: 2009-12-21 Posts: 20 [Solved] undefined reference https://bbs.archlinux.org/viewtopic.php?id=88108 to `clock_gettime' I'm trying to compile a https://linux.die.net/man/3/clock_gettime program that worked fine on Ubuntu and windows.Here is my makefileCXXFLAGS=-Wall `sdl-config --cflags` `freetype-config --cflags` LDFLAGS=-L -lrt -lGL -lGLU -lSDL -lSDL_mixer -lILU -lILUT `freetype-config --libs` CLFAGS=$(CXXFLAGS) CXX=g++ CC=g++ SOURCES=src/Camera.cpp src/Color.cpp src/Data.cpp undefined reference src/Engine.cpp \ src/FontRenderer.cpp src/Renderable.cpp src/Point.cpp src/PrimitiveNode.cpp \ src/Scene.cpp src/SoundEngine.cpp src/Texture.cpp src/TexturedNode.cpp \ src/Timer.cpp src/Utils.cpp \ \ src/Particles/Particle.cpp src/Particles/ParticleEmitter.cpp \ src/Particles/ParticleEngine.cpp \ \ src/external/GLFT_Font.cpp \ \ main.cpp TARGET= klas OBJECTS=$(SOURCES:.cpp=.o) all: $(TARGET) $(TARGET): $(OBJECTS) $(CXX) $(LDFLAGS) -o $(TARGET) $(OBJECTS) clean: undefined reference to rm -rf $(OBJECTS) $(TARGET)Here is the output from make$ make g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Camera.o src/Camera.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Color.o src/Color.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Data.o src/Data.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Engine.o src/Engine.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/FontRenderer.o src/FontRenderer.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Renderable.o src/Renderable.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Point.o src/Point.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/PrimitiveNode.o src/PrimitiveNode.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/Scene.o src/Scene.cpp g++ -Wall `sdl-config --cflags` `freetype-config --cflags` -c -o src/SoundEngine.o src/SoundEngine.cpp g++ -Wall `sdl-config --cflags` `freetype-con
*tp); int clock_settime(clockid_t clk_id, const struct timespec *tp); Description The function clock_getres() finds the resolution (precision) of the specified clock clk_id, and, if res is non-NULL, stores it in the struct timespec pointed to by res. The resolution of clocks depends on the implementation and cannot be configured by a particular process. If the time value pointed to by the argument tp of clock_settime() is not a multiple of res, then it is truncated to a multiple of res. The functions clock_gettime() and clock_settime() retrieve and set the time of the specified clock clk_id. The res and tp arguments are timespec structs, as specified in