• What Do You Need Help With? V6
    7,544 replies, posted
It seems to recognize -nostdlib, although it is not documented. Then you can just -L/path/to/musl/lib -lc. [editline]19th September 2013[/editline] The option appears in tcc -h.
[QUOTE=ZeekyHBomb;42243728]It seems to recognize -nostdlib, although it is not documented. Then you can just -L/path/to/musl/lib -lc. [editline]19th September 2013[/editline] The option appears in tcc -h.[/QUOTE] I attempted to do this with tcc without any changes to anything, and the resulting linking process could not find symbols like "__va_start", "atexit" and more. Not sure what to do about that. I checked the build files after regenerating the configuration, and the variables are set correctly, so while it doesn't segfault right now, it doesn't even build. I do apprechiate that you take your time for this kind of issue, even if it's not a major one. [editline]19th September 2013[/editline] Let me correct that, it doesn't link. The building process is fine.
It doesn't seem to use the musl libc headers. Did you specify the include path via -I? [QUOTE=mastersrp;42244015]I do apprechiate that you take your time for this kind of issue, even if it's not a major one.[/QUOTE] Don't worry, it's an interesting problem :-)
[QUOTE=ZeekyHBomb;42244139]It doesn't seem to use the musl libc headers. Did you specify the include path via -I? Don't worry, it's an interesting problem :-)[/QUOTE] The command I'm running is (directly) [code] CC=tcc CFLAGS="-nostdlib -L$HOME/.local/musl/lib -lc" LDFLAGS=$CFLAGS ./spm.sh fetch configure build [/code] I tried the following as well [code] CC=tcc CFLAGS="-nostdlib -L$HOME/.local/musl/lib -lc -I$HOME/.local/musl/include" LDFLAGS=$CFLAGS ./spm.sh fetch configure build [/code] All yielding the same result. I'd like to mention that of course both tcc and musl are pulled from their respective branches mob and master, and are both up to date as of today. [editline]19th September 2013[/editline] Now the code I'm actually running is probably slightly specific to my system, and not something I'd like to advertise to anyone, but if you feel that it would be easier to solve the issue by looking at it, I could send you a zip file with the latest revision.
Try adding -I$HOME/.local/musl/arch/x86_64 (or i386 or whatever platform). [editline]19th September 2013[/editline] If that doesn't work I'll gladly take a look at the zip.
[QUOTE=ZeekyHBomb;42244279]Try adding -I$HOME/.local/musl/arch/x86_64 (or i386 or whatever platform).[/QUOTE] musl doesn't install any cross platform libraries for me, so it's just $HOME/.local/musl/{bin,include,lib} And each of those directories only include other files. Well maybe except the include directory, but nothing cross platform, or cross arch.
So I made a quaternion library in Lua, but I'm having trouble with my spherical linear interpolation. So my question is, is there any logic error in the following: 1) Have 2 euler angles, A and B 2) Convert A and B to the quaternions, qA and qB 3) SLerp by a fraction t between qA and qB and give the result to qC 4) Convert qC to an euler angle, C 5) Set the rotation of an entity to C What I am trying to do is get rotational interpolation like the dinosaur in the lower right half of [url=http://www.youtube.com/watch?v=T9g0DNF-HZk]this video[/url], but it's more like the euler rotation in the top left (except even worse). I just need to verify that there's nothing inherently stupid about doing it that way, so that I know it's my code that's wrong.
If im writting a script for linux that requires input, how do I supply that in the script? This is, input that doesnt vary, like a password. Is it using echo? as in: [code] sudo apt-get update echo <password> [/code] And how would I then confirm?
I'm not sure what you mean by "input that doesn't vary", but [code]read foo echo $foo[/code] And confirm what? [editline]19th September 2013[/editline] Read wrong, should have concentrated more on the example. This doesn't work with sudo, but in general [code]prog <<EOF line0 line1 line2 EOF echo 'or just a single line' | prog[/code] [editline]19th September 2013[/editline] [url]http://stackoverflow.com/a/10827618/1874964[/url]
[QUOTE=ZeekyHBomb;42245977]I'm not sure what you mean by "input that doesn't vary", but [code]read foo echo $foo[/code] And confirm what? [editline]19th September 2013[/editline] Read wrong, should have concentrated more on the example. This doesn't work with sudo, but in general [code]prog <<EOF line0 line1 line2 EOF echo 'or just a single line' | prog[/code] [editline]19th September 2013[/editline] [url]http://stackoverflow.com/a/10827618/1874964[/url][/QUOTE] I see, is there anyway of doing this with sudo? [editline]19th September 2013[/editline] If not, which group do I need to add a user to so that I dont need to use sudo?
Just posted a question to stackoverflow, if people could take a look that'd be great. [url]http://stackoverflow.com/questions/18904074/php-certain-elements-missing-from-array[/url]
[QUOTE=Richy19;42246132]I see, is there anyway of doing this with sudo? [editline]19th September 2013[/editline] If not, which group do I need to add a user to so that I dont need to use sudo?[/QUOTE] See my third edit :) And a better solution to not require a password for sudo would be /etc/sudoers, see man sudoers. [editline]19th September 2013[/editline] Note: you don't have to read the whole man-page. Just skip to the examples and lookup anything relevant.
[QUOTE=ZeekyHBomb;42246230]See my third edit :) And a better solution to not require a password for sudo would be /etc/sudoers, see man sudoers.[/QUOTE] Awesome :D, so adding the user to the sudoers group means they can use sudo without passowrd requirements? I think thats exactly what I wanted, thanks! [editline]19th September 2013[/editline] Also, this is probably more for the linux thread, on ubuntu which is the preffered way of adding a user? If I use adduser like: [url]http://askubuntu.com/questions/221009/adding-a-new-user-on-ubuntu-server[/url] How do I simulate the enter key being pressed?
sorry to bump up, but I am still having unsolved problem with this: [url]http://facepunch.com/showthread.php?t=1250528&p=42237982&viewfull=1#post42237982[/url] Thank you, I really need to figure this out but I am too stupid at maths to do it.
That would really depend on what groups are setup on your system. By default there's no sudoers group which can use sudo without requiring a password. You can use the /etc/sudoers file to setup which user/group can use which commands with which arguments either with or without password (or not at all). If you want to write a script for adding a user I'd use useradd. adduser is meant for interactive use.
[QUOTE=ZeekyHBomb;42246401]That would really depend on what groups are setup on your system. By default there's no sudoers group which can use sudo without requiring a password. You can use the /etc/sudoers file to setup which user/group can use which commands with which arguments either with or without password (or not at all). If you want to write a script for adding a user I'd use useradd. adduser is meant for interactive use.[/QUOTE] Well im basically writting some scripts to setup a vps, and one of them is to create a user that has sudo/root access, but im not sure how to do this via script with no user interaction
You could consider just giving them access straight to root and authenticate via e.g. public keys. You can just do echo "$THEIRKEY" >> /root/.ssh/authorized_keys. I'm guessing you're probably letting them connect via ssh anyway. Otherwise, useradd -d -g users -G wheel -m. -d creates a home-dir for the user, -g users specifies that the primary group is users, -G wheel puts the user in the additional group wheel, which usually allows usage of sudo <anything> provided a password (though you can modify that in /etc/sudoers), -m fills the home-directory with stuff form a "skeleton home" (look in /etc/skel). Pretty straight forward using the useradd manpage :) You can specify a password by also adding -p `openssl passwd -1 $PASSWORD`. The openssl passwd call hashes the password, since the hash is required for the -p parameter. Or you can again add their keys to the new users .ssh/authorized_keys.
I want to try some C++ network programming. Any reading I should do before jumping into playing with some APIs? What are some good APIs to look at/consider?
What kind of network programming? A rather simple protocol to build on would be TCP/IP. Boost has [url=http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio.html]Asio[/url], which is relatively convoluted though. The BSD Sockets API is fine and simple. It's also not just for BSD, but works on Linux (as well as other UNIXy systems) and (afaik with some minor adjustments) on Windows.
I'm trying to do a simple sidescroller with SFML.NET to which I will implement Box2D for awesome physics. I thought getting Box2D working would be the hardest part, but it seems that drawing the sprites is the most difficult one. I have the following gameloop: [code] while (Window.IsOpen()) { clock.Start(); Window.DispatchEvents(); Input.Update(); Window.Clear(); Skybox.Draw(); frameTimeText.Draw(Window, RStates); Window.Display(); clock.Stop(); frameTime = clock.ElapsedMilliseconds; clock.Reset(); } [/code] Nothing but a black window is shown. The Skybox object is supposed to draw a simple sky texture. I have made sure that the draw for the sky sprite is called. The frametime text is not drawn, either. I don't know why drawing would be broken here, since it works perfectly in my other game. If it matters, I'm using the 32-bit version of SFML.NET since VS2010 moans about invalid assemblies for the 64-bit version.
Assuming these are SFML types it would be nice to see how they're initialized.
[QUOTE=ZeekyHBomb;42252873]Assuming these are SFML types it would be nice to see how they're initialized.[/QUOTE] The skybox texture [code] sky1 = new Sprite(new Texture("texture/sky1.png")); sky1.Color = Color.White; sky1.Scale = new Vector2f(1, 1); [/code] The frametime text [code] dFont = new Font("CONSOLA.TTF"); frameTimeText = new Text("Frametime: 0", dFont, 14); frameTimeText.Position = new Vector2f(10, 10).Round(); frameTimeText.Color = Color.White; [/code]
What's the default position for a sprite? And what's RStates like? [editline]20th September 2013[/editline] You could also try the [url=https://github.com/LaurentGomila/SFML.Net/blob/master/doc/MainPage.html]sample code[/url] as a starting point. Sadly the HTML file does not get rendered as HTML.
[QUOTE=ZeekyHBomb;42253439]What's the default position for a sprite? And what's RStates like? [editline]20th September 2013[/editline] You could also try the [url=https://github.com/LaurentGomila/SFML.Net/blob/master/doc/MainPage.html]sample code[/url] as a starting point. Sadly the HTML file does not get rendered as HTML.[/QUOTE] While checking that the default renderstates are, I found out that you can do [code] Window.Draw(sprite); [/code] to draw your stuff. I changed to that, and now it works :)
I need some help to compile stuff using mingw32. The compiler complains that "SFML/Audio.hpp" doesn't exist, but it does. I've checked it and it's there, sitting nicely with its other brothers and sisters. [code][19:47:33|supervoltage source]$ i486-mingw32-g++ -o test main.cpp noteOrder.cpp compareinput.cpp octave.cpp translate.cpp compareinput.h noteOrder.h octave.h translate.h sinegen.cpp sinegen.h -lsfml-audio -lsfml-system -mwindows -I/usr/include/SFML/ sinegen.cpp:4:26: fatal error: SFML/Audio.hpp: No such file or directory compilation terminated. [19:47:42|supervoltage source]$ fucking shit[/code] Could you guys please help me out on this? I've tried googling but with no results. Either that or my brain is so melted that I just don't understand anything anymore.
i486-mingw32-g++ might not have /usr/include, but /usr/i486-mingw32/include as a default include path (see output of i486-mingw32-cpp -v). So you'll either want to specify -I/usr/include or ln -s /usr/include/SFML /usr/i486/include/.
Specifying -l/usr/include or ln -s /usr/include/SFML /usr/i486/include now takes me to the following error which baffles me yet again. [code][22:04:23|supervoltage source]$ i486-mingw32-g++ -o test main.cpp noteOrder.cpp compareinput.cpp octave.cpp translate.cpp compareinput.h noteOrder.h octave.h translate.h sinegen.cpp sinegen.h -lsfml-audio -lsfml-system -mwindows /usr/lib/gcc/i486-mingw32/4.7.2/../../../../i486-mingw32/bin/ld: cannot find -lsfml-audio /usr/lib/gcc/i486-mingw32/4.7.2/../../../../i486-mingw32/bin/ld: cannot find -lsfml-system collect2: error: ld returned 1 exit status [22:04:28|supervoltage source]$[/code] Gaaaah. This is very demoralizing.
Did you build SFML for i486-mingw32?
N.. no... i just installed it using pacman why do i feel stupid now Edit: No. Just no. I already wasted more energy on this than I should have. Screw the GUI's and screw mingw32. I am just a beginner, why am I even bothering with these. I have other things to worry about like learning how to do OOP properly before even thinking of these things.
The AUR has build-scripts for building some libraries for i486-mingw32.
Sorry, you need to Log In to post a reply to this thread.