Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 23-07-2006, 08:06 AM   #1
Nick
Переводчик помаленьку
 
Nick's Avatar

 
Join Date: Dec 2004
Location: Protvino, Russian Federation
Posts: 340
Send a message via ICQ to Nick Send a message via Skype™ to Nick
Default

I need this to work in Linux. I am messing with it in Cygwin and I got that damn error, which screenshot I included in archive together with source files. I commented problem lines, so the error came out when one of it became uncommented.

Main file is Test.cpp
__________________
"Paladin work is never done..."


Nick is offline                         Send a private message to Nick
Reply With Quote
Old 23-07-2006, 02:27 PM   #2
SuperTed
Newbie

 
Join Date: Mar 2006
Location: ,
Posts: 2
Default

<div class='quotetop'>QUOTE(Nick @ Jul 23 2006, 09:06 AM) [snapback]244583[/snapback]</div>
Quote:
I need this to work in Linux. I am messing with it in Cygwin and I got that damn error, which screenshot I included in archive together with source files. I commented problem lines, so the error came out when one of it became uncommented.

Main file is Test.cpp
[/b]
When you run g++, you're only giving the single argument Test.cpp to compile.
The g++ compiler will, unless you also specify "-c" run the linker on the resultant code. The linker will try to find all the code that you're attempting to call, linking by default with the C run time library. When g++ calls the linker, it only supplies the linker with object files (.o) that it's just compiled, so without specifying the other modules on the command line for g++ to compile, you're going to get linker errors.

Try compiling with

g++ Test.cpp CSolarisCoroutine.cpp

Note, I haven't tried this, I've yet to install Cygwin after a machine upgrade a week ago.

Also, with multiple source modules, you may want to look into the "make" utility; very handy for cutting down on compile times...

HTH, HAND.
SuperTed is offline                         Send a private message to SuperTed
Reply With Quote
Old 23-07-2006, 03:46 PM   #3
Data
retired
 
Data's Avatar


 
Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
Default

uncomment that readword part in Test.cpp
(or remove the virtual go(); definition)

compile with
g++ *.cpp -lpthread
__________________
Flowing with the stream of life
Data is offline                         Send a private message to Data
Reply With Quote
Old 24-07-2006, 01:39 PM   #4
Nick
Переводчик помаленьку
 
Nick's Avatar

 
Join Date: Dec 2004
Location: Protvino, Russian Federation
Posts: 340
Send a message via ICQ to Nick Send a message via Skype™ to Nick
Default

<div class='quotetop'>QUOTE(Data @ Jul 23 2006, 07:46 PM) [snapback]244637[/snapback]</div>
Quote:
...-lpthread
[/b]
That's exactly what I need. Though I solved the problem already with help from other side. Anyway, thanks. k:

__________________
"Paladin work is never done..."


Nick is offline                         Send a private message to Nick
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 06:43 PM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.