Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » How to edit ld.so.conf?

This thread is locked; no one can reply to it. rss feed Print
 1   2 
How to edit ld.so.conf?
SonShadowCat
Member #1,548
September 2001
avatar

Since im getting a shared lib violation I need to copy a path into ld.so.conf. Problem is I dont know how. Ive looked into the emacs command but I cant figure out how to use it( ive read the docs). Can someone help me figure out how to edit the file?

Steve Terry
Member #1,989
March 2002
avatar

as far as I know it's standard text, just add a new line with the path... and use pico instead, just type pico ld.so.conf on the command line, ctrl-x lets you save and exit. More specifically it's ctrl-x then y then enter.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

SonShadowCat
Member #1,548
September 2001
avatar

Apparently I dont have pico o.O
Maybe its on my mandrake cd...

new line with the path??
What do you mean?

Edit: No pico on the cd. What must I do master?

Steve Terry
Member #1,989
March 2002
avatar

I thought it went:

path1
path2
path3
....
pathn

at lest that's what it was when I last opened it.. I think... but anyway the paths were seperated by new lines.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

SonShadowCat
Member #1,548
September 2001
avatar

I tried opening the file with KEdit, Kate, and KWrite. It wont save, it says I dont have write permission, im guessing that means root priveledges. How do I get around this? Login as root?

Steve Terry
Member #1,989
March 2002
avatar

you can log in as root.. or alternatively run su on the command line, followed by your password.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

SonShadowCat
Member #1,548
September 2001
avatar

ok, I logged in as root and edited the file. Now I get the same problem as before( I posted before about it but no more people replied), after I compile a source file, I try to run the program but it says it cant find the program, wth? Im looking right at, where the hell could it be?

Matthew Leverton
Supreme Loser
January 1999
avatar

After you edit the file, you probably need to type 'ldconfig' as root anywhere you feel like.

SonShadowCat
Member #1,548
September 2001
avatar

umm, do I type that anywhere or in the dir where ld.so.conf was?

Steve Terry
Member #1,989
March 2002
avatar

You can type that at any point on teh command line just like any program.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

SonShadowCat
Member #1,548
September 2001
avatar

I reread his post and figured that out -.-
Anyway, its all good now except for 1 little thing, whenever I exit the program I get the same little error. Does it matter?

Heh, it seems none of the code I wrote in windows works now, it spits out large amounts of errors I'm dumb!. Is programming with allegro in linux any different than doing it in windows? Will I have to change the code alot?

Steve Terry
Member #1,989
March 2002
avatar

if you were compiling with MingW32 and not using any DOS specific header files.. then no code will have to change at all.. what kinds of errors.. did you put END_OF_MAIN() at the end of main??

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

PyroBoy
Member #725
October 2000
avatar

All of my code has been portable to/from DOS, Windows, Linux :) Though i am using gcc on all platforms and i remember the cross platform stuff like adding END_OF_MAIN() to the end of the main function :).

SonShadowCat
Member #1,548
September 2001
avatar

Example: Vector undeclared even though I included vector.

Parse error before '>' token.
Parse error before end of output.

Ive looked at the code and it looks fine, it even compiles and works on windows. What could be wrong?

And no, not even I make such foolish mistakes as to leave out END_OF_MAIN(); -.-

P.S.Where is the damn calculator? Its not on the mandrake cd and I cant find it installed anywhere. An OS without a calculator, how weird ><!

Steve Terry
Member #1,989
March 2002
avatar

hmm... try g++, gpp, cc?? I don't know never got those errors before, are you compiling a .cpp program or .c. Well since it's vector I will assume .cpp. Sorry SSC.. maybe post the source and complete output errors I may be able to help then... the only thing I can think of is maybe it's a windows text file and the new lines in linux are different from teh new lines in windows..

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

SonShadowCat
Member #1,548
September 2001
avatar

Heres an example of I program I just wrote that wont compile:

1#include <allegro.h>
2#include <fstream.h>
3 
4void Error_Log( char* Error) // Writes error in an error log
5{
6 ofstream File( "ErrorLog.txt", ios::out); // Create a log file
7 
8 File << Error << endl; // Log the error into the file
9 
10 File.close(); // Close the file
11}
12 
13class cPaddle // The class containing the info on the paddle
14{
15 public: // The following code is visible to all
16 
17 bool Initialize( int Pos); // Initializes the variables
18 
19 bool Coll_Detection( int Y_Vel); // Checks if paddle is about to leave the screen
20 
21 void Position_Paddle( int Y_Vel); // Assigns the paddle new y coordinates
22 
23 void Draw_Paddle( BITMAP* Buffer); // Blit the paddle to the buffer
24 
25 private: // The following code is visible only to us
26 
27 BITMAP* Paddle; // .bmp containing the sprite
28 
29 int X_Pos, Y_Pos; // X and y coordinates of the paddle
30};
31 
32bool cPaddle::Initialize( int Pos) // Initializes the variables
33{
34 if( Pos == 0) // If the first paddle is being initialized
35 X_Pos = 10; // The first paddle's x coordinate is 10
36 else // If the second paddle is being initialized
37 X_Pos = 0; // Must fill in later
38 
39 Y_Pos = 0; // The y coordinate of both paddle
40 
41 Paddle = load_bitmap( "Paddle.bmp", NULL);
42 if( !Paddle) // If the .bmp could not be loaded
43 {
44 Error_Log( "Paddle bmp could not be Loaded at line 29\n"); // Create an error log
45 return 1;
46 }
47}
48 
49bool cPaddle::Coll_Detection( int Y_Vel) // Checks if paddle is about to leave the screen
50{
51 if( (Y_Pos + 96 + Y_Vel) < 599) // Check if the new y coordinate will leave the screen
52 return true; // Return false
53}
54 
55void cPaddle::Position_Paddle( int Y_Vel) // Assigns the paddle new y coordinates
56{
57 int Result = false; // Stores the result of collision detection
58 
59 if( (Result = Coll_Detection( Y_Vel)) == true) // If the paddles did not leave the screen
60 Y_Pos +=Y_Vel; // Give the paddle new coordinates
61}
62 
63void cPaddle::Draw_Paddle( BITMAP* Buffer) // Blit the paddle to the buffer
64{
65 blit( Paddle, Buffer, 0, 0, X_Pos, Y_Pos, 32, 96); // Blit the paddle sprite to the buffer
66}
67 
68void Get_Input( cPaddle* Paddles[2]); // Gets input from keyboard and moves paddle
69{
70 if( keys[KEY_UP]) // If the up key is pressed
71 (*Paddles)[0].Position_Paddle( -2); // Move the paddle up by -2
72 
73 if( keys[KEY_DOWN]) // If the down key is pressed
74 (*Paddles)[0].Position_Paddle( 2); // Move the paddle down by 2
75}
76 
77int main()
78{
79 allegro_init(); // Initialize allegro
80 install_keyboard();
81 
82 set_color_depth( 24); // Set the color depth to 24 bits
83 set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0); // Set screen res to 800x600
84 
85 while( !key[KEY_ESC]) // While the escape key is not pressed
86 {}
87 
88 return 1;
89}
90END_OF_MAIN();

ErrorS: Ios undeclared
invalid operands of types std::ofstream
endl undeclared

Steve Terry
Member #1,989
March 2002
avatar

hmm not a c++ freak, but maybe add the line using namespace std; or something like that.. shoot I think I really need to go read some C++ books again.. been a while..

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

23yrold3yrold
Member #1,134
March 2001
avatar

#include <fstream>, not <fstream.h>! >_<

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

SonShadowCat
Member #1,548
September 2001
avatar

holy crap ><!

I put in the namespace thing
Chris: I changed my code after I posted to fstream ::)

And now when I compile I get a butt load of undefined references, Every little bit of code I used in Error_Log created a undefined reference error

Example:

/tmp/cc8vlITR.o(.text+0x27): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)

Whats in C++'s unholy name is this?

I get around 10-15 errors like this, all pointing to Error_Log. I beseach you linux gurus, help me! :)

23yrold3yrold
Member #1,134
March 2001
avatar

Are you linking with the C++ standard library? Which means you're compiling with gpp/g++ (NOT gcc) or explicitly linking in -lstdlib++ or something like that (not sure).

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

SonShadowCat
Member #1,548
September 2001
avatar

I did not know that sam I am. I had a feelings I wasnt supposed to use gcc...

So I just replace gcc with g++?

23yrold3yrold
Member #1,134
March 2001
avatar

Or gpp, yes (not sure which Linux uses). Give it a go; worth a shot, just filling out my word count at this point ....

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

SonShadowCat
Member #1,548
September 2001
avatar

hmm well it compiled with no errors or warnings, but I get the same problem I got before( cant find the program). Ill look through old posts to fix it ^^

Steve Terry
Member #1,989
March 2002
avatar

ahhh don't just type "program" on teh command line, linux doesn't have the path set to teh current working directory. Instead use ./program and it will run beautifully.. I hope::)

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

SonShadowCat
Member #1,548
September 2001
avatar

It says its unable to find a usable VT o.O

This didnt happen before, I could just click on the program and it would work, I wonder what I screwed up.

 1   2 


Go to: