Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Tom_E on January 05, 2006, 04:43:32 pm

Title: Installing the ACE Threads package on C::B
Post by: Tom_E on January 05, 2006, 04:43:32 pm
Hello.

I am a Computer Science student and have just recently discovered the wonderful C::B IDE.
being the said (read "sad"  :) ) student, i recieved and assignment that requires working
with the ACE (Description (http://deuce.doc.wustl.edu/Download.html)) package.

I work with the MinGW compiler since all our code is checked on Linux systems and i dont have Linux installed at home. Now, I have made C::B work with MinGW, that was easy even for me, but I couldnt get the ACE package to work.

If any C++ expert can take a look at the site and explain how to get it to work on C::B  or anyone has experience working with the package and can explain, I would be very greatful.

thanks in advance.

Title: Re: Installing the ACE Threads package on C::B
Post by: thomas on January 05, 2006, 04:56:29 pm
Wow, I just tried to build this beast. Now I know why you said "sad" ;)
Given the fact it comes with a .DSW file, I thought "why, it can't be so hard", and dragged that onto Code::Blocks...

5 minutes later, it was still loading when my machine ran out of virtual memory...

Stand by, I'll try on ;)
Title: Re: Installing the ACE Threads package on C::B
Post by: thomas on January 05, 2006, 05:22:02 pm
Ok, next step, I tried MSYS with ./configure and make.

After running for a while, it failed and showed the message "Please use the stock ACE build procedure detailed in the file 'ACE-INSTALL.html'.

And Io and behold, there is a section on how to build that package with MSYS and MinGW :)

So, you have to download the MSYS package (in case you don't have that yet), and follow the instructions in the ACE-INSTALL.html document. I haven't tried those because it is a bit lenghty, but I guess  you will get along with that :)
Title: Re: Installing the ACE Threads package on C::B
Post by: Tom_E on January 05, 2006, 05:39:01 pm
alright, i'll try that. thanks.
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 05, 2006, 06:34:27 pm
If I remember correctly, there is ACE package for DEV-C++. I have no tried it yet, but may be it would be possible to import it in C::B and use it. I think it would be worth a try.

Michael
 
Title: Re: Installing the ACE Threads package on C::B
Post by: Tom_E on January 09, 2006, 10:58:38 pm
here's an update:

I've successfully built the DLL and ".a" file the install page says i had to build, i've written a small code and compiled it. It compiled fine, no syntax or code errors, but i got an error that has something to do with Linking.

it said:
"#error You must link against multi-threaded libraries when using ACE (check your project settings)"

i've scanned extensivly though C::B options and did not find anything regarding MultiThreading in the GNU GCC compiler switches. BUT i have found these exact switches in the MS VC toolkit compiler options.

now i dont even have that installed, and i have no idea what to tell the MinGW maker so it wont use MultiThreading.

any ideas?
 
Title: Re: Installing the ACE Threads package on C::B
Post by: thomas on January 09, 2006, 11:15:32 pm
This?

http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/i386-and-x86_002d64-Options.html#index-mthreads-991

Try adding that option to "other compiler options"
Title: Re: Installing the ACE Threads package on C::B
Post by: Tom_E on January 09, 2006, 11:38:44 pm
looks good! i'm testing it now with more code. thanks for the help!
Title: Re: Installing the ACE Threads package on C::B
Post by: lawina on January 15, 2006, 03:54:28 am
There is a ACE package in devpak format at
http://sourceforge.net/project/showfiles.php?group_id=94270 (http://sourceforge.net/project/showfiles.php?group_id=94270)
I didn't  test it though.
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 15, 2006, 08:32:38 am
Hello fellow Tom...
I've tried Installing the ACE_DevPack, and recieved a size error while downloading.
I tried to manually download the Pack & install, it seems OK.

but compiling projects still doesn't work.

Any compiler options that I shouls change?
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 15, 2006, 05:56:27 pm
but compiling projects still doesn't work.

Any compiler options that I shouls change?

Hello,

it would be good if you can give some info about your C::B version and the problems you have had.

Michael
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 12:53:10 pm
The C::B version is:1.0rc2

the problem is that compiling this:
Code
#include "ace/OS.h"
#include "ace/Task.h"
#include <iostream>
#include <string>

int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
}

returned the attached errors.

[attachment deleted by admin]
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 17, 2006, 01:50:18 pm
Hello,

Having a look at your errors, I have remarked that:


Best wishes,
Michael

PS.: I would also suggest you to use the latest nightly build instead of RC2. Or compile the latest SVN revision by yourself (easy and worth).
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 01:54:37 pm
Sorry didn't see thomas' remarks...
where exactly do I have to add this option?

About the included files, I didn't add them because I used the pack, so I assumed this is done for me...
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 17, 2006, 02:03:14 pm
Sorry didn't see thomas' remarks...
where exactly do I have to add this option?

Try to "other compiler options".

About the included files, I didn't add them because I used the pack, so I assumed this is done for me...

Even if you just use already compiled libraries, you should always add the header files. Normally, they are stored into an include directory.

Michael
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 02:16:47 pm
Try to "other compiler options".
Can't find these settings...

Even if you just use already compiled libraries, you should always add the header files. Normally, they are stored into an include directory.
The ACE pack is installed directly to the INCLUDE folder, so nothing should be changed...
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 17, 2006, 02:20:56 pm
Try to "other compiler options".
Can't find these settings...

Project-->Build options-->Compiler-->Other options

Michael
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 02:26:18 pm
Project-->Build options-->Compiler-->Other options
Thanks...
I added:
Code
-mthreads
But nothing changed.

what exactly should I add to the includes?
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 17, 2006, 02:32:49 pm
Project-->Build options-->Compiler-->Other options
Thanks...
I added:
Code
-mthreads
But nothing changed.

C:B project has the same option included in the same place. Check if you should add other options.

what exactly should I add to the includes?

You should include the path where your include files are (normally inside an include directory). Include it here:

Project-->Build options-->Directories-->Compiler

Michael
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 02:35:46 pm
If you look at the txt file I added, you would see the the compiler is already looking for the files on:
Code
C:\Program Files\CodeBlocks\DevPacks\include\ace
(which was added automaticly by installation)
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 17, 2006, 02:44:21 pm
If you look at the txt file I added, you would see the the compiler is already looking for the files on:
Code
C:\Program Files\CodeBlocks\DevPacks\include\ace
(which was added automaticly by installation)

Ok. Anyway, it does not find all the include files, e.g.,

Quote
C:/Program Files/CodeBlocks/DevPacks/include/ace/Object_Manager_Base.h:29:41: ace/os_include/sys/os_types.h: No such file or directory

Try to include other includes directories and check why the compiler cannot find the specified include files.

Michael
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 02:50:45 pm
well, maybe because I don't have this file at all...?  :?
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 17, 2006, 02:56:09 pm
well, maybe because I don't have this file at all...?  :?

Yes, it is a possibility. You have to check if the not found files really exist or are in the specified path (may be the path is wrong).

Michael
 
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 17, 2006, 03:00:12 pm
I did a comple hard-disk search...

well, again, that's not my build of ACE, I've downloaded it as a dev-pack
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 18, 2006, 12:52:58 pm
I've started over, & I think ACE is now compiled.
I added the ace directory to the include.
and added -mthreads to the build options.

but when compiling i get this:
Code
Project   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\Study\Autumn-2006\Systems_Programming\PS9\Linux\Example1\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: SimpleThread.cpp
Linking console executable: D:\Study\Autumn-2006\Systems_Programming\PS9\Linux\Example1\console.exe
.objs\SimpleThread.o(.text+0x3c8):SimpleThread.cpp: undefined reference to `_imp___ZN14ACE_Time_Value4zeroE'
.objs\SimpleThread.o(.text+0x3e1):SimpleThread.cpp: undefined reference to `_imp___ZN14ACE_Time_Value8max_timeE'
.objs\SimpleThread.o(.text$_ZN8ACE_TaskI12ACE_MT_SYNCHEC2EP18ACE_Thread_ManagerP17ACE_Message_QueueIS0_E[ACE_Task<ACE_MT_SYNCH>::ACE_Task(ACE_Thread_Manager*, ACE_Message_Queue<ACE_MT_SYNCH>*)]+0x46):SimpleThread.cpp: undefined reference to `_imp___ZN13ACE_Task_BaseC2EP18ACE_Thread_Manager'
.objs\SimpleThread.o(.text$_ZN8ACE_TaskI12ACE_MT_SYNCHEC2EP18ACE_Thread_ManagerP17ACE_Message_QueueIS0_E[ACE_Task<ACE_MT_SYNCH>::ACE_Task(ACE_Thread_Manager*, ACE_Message_Queue<ACE_MT_SYNCH>*)]+0x1d0):SimpleThread.cpp: undefined reference to `_imp___ZN13ACE_Task_BaseD2Ev'
.objs\SimpleThread.o(.text$_ZN8ACE_TaskI12ACE_MT_SYNCHED2Ev[ACE_Task<ACE_MT_SYNCH>::~ACE_Task()]+0x9d):SimpleThread.cpp: undefined reference to `_imp___ZN13ACE_Task_BaseD2Ev'
.objs\SimpleThread.o(.text$_ZN8ACE_TaskI12ACE_MT_SYNCHED2Ev[ACE_Task<ACE_MT_SYNCH>::~ACE_Task()]+0xc9):SimpleThread.cpp: undefined reference to `_imp___ZN13ACE_Task_BaseD2Ev'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x3c):SimpleThread.cpp: undefined reference to `_imp___ZN22ACE_Message_Queue_BaseC2Ev'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x6c):SimpleThread.cpp: undefined reference to `_imp___ZN16ACE_Thread_MutexC1EPKcP15ACE_mutexattr_t'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x9d):SimpleThread.cpp: undefined reference to `_imp___ZN26ACE_Condition_Thread_MutexC1ERK16ACE_Thread_MutexPKcPv'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0xce):SimpleThread.cpp: undefined reference to `_imp___ZN26ACE_Condition_Thread_MutexC1ERK16ACE_Thread_MutexPKcPv'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x10c):SimpleThread.cpp: undefined reference to `_imp___ZN11ACE_Log_Msg18last_error_adapterEv'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x116):SimpleThread.cpp: undefined reference to `_imp___ZN11ACE_Log_Msg8instanceEv'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x145):SimpleThread.cpp: undefined reference to `_imp___ZN11ACE_Log_Msg15conditional_setEPKciii'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x162):SimpleThread.cpp: undefined reference to `_imp___ZN11ACE_Log_Msg3logE16ACE_Log_PriorityPKcz'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x19e):SimpleThread.cpp: undefined reference to `_imp___ZN26ACE_Condition_Thread_MutexD1Ev'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x1c1):SimpleThread.cpp: undefined reference to `_imp___ZN26ACE_Condition_Thread_MutexD1Ev'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x1e4):SimpleThread.cpp: undefined reference to `_imp___ZN16ACE_Thread_MutexD1Ev'
.objs\SimpleThread.o(.text$_ZN17ACE_Message_QueueI12ACE_MT_SYNCHEC1EjjP25ACE_Notification_Strategy[ACE_Message_Queue<ACE_MT_SYNCH>::ACE_Message_Queue(unsigned int, unsigned int, ACE_Notification_Strategy*)]+0x204):SimpleThread.cpp: undefined reference to `_imp___ZN22ACE_Message_Queue_BaseD2Ev'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x10):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::get_handle() const'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x14):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::set_handle(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x18):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::priority() const'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x1c):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::priority(int)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x20):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_input(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x24):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_output(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x28):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_exception(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x2c):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_timeout(ACE_Time_Value const&, void const*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x30):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_exit(ACE_Process*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x34):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_close(void*, unsigned long)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x38):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_signal(int, siginfo_t*, int*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x3c):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::resume_handler()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x40):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_qos(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x44):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::handle_group_qos(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x48):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::reactor(ACE_Reactor*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x4c):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::reactor() const'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x50):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::reactor_timer_interface() const'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x54):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::add_reference()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x58):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::remove_reference()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x5c):SimpleThread.cpp: undefined reference to `ACE_Task_Base::suspend()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x60):SimpleThread.cpp: undefined reference to `ACE_Task_Base::resume()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x64):SimpleThread.cpp: undefined reference to `ACE_Task_Base::open(void*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x68):SimpleThread.cpp: undefined reference to `ACE_Task_Base::close(unsigned long)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x6c):SimpleThread.cpp: undefined reference to `ACE_Task_Base::module_closed()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x70):SimpleThread.cpp: undefined reference to `ACE_Task_Base::put(ACE_Message_Block*, ACE_Time_Value*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x78):SimpleThread.cpp: undefined reference to `ACE_Task_Base::activate(long, int, int, long, int, ACE_Task_Base*, void**, void**, unsigned int*, unsigned long*)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x7c):SimpleThread.cpp: undefined reference to `ACE_Task_Base::wait()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x88):SimpleThread.cpp: undefined reference to `ACE_Shared_Object::init(int, char**)'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x8c):SimpleThread.cpp: undefined reference to `ACE_Shared_Object::fini()'
.objs\SimpleThread.o(.rdata$_ZTV12SimpleThread[vtable for SimpleThread]+0x90):SimpleThread.cpp: undefined reference to `ACE_Shared_Object::info(char**, unsigned int) const'
.objs\SimpleThread.o(.rdata$_ZTV8ACE_TaskI12ACE_MT_SYNCHE[vtable for ACE_Task<ACE_MT_SYNCH>]+0x10):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::get_handle() const'
.objs\SimpleThread.o(.rdata$_ZTV8ACE_TaskI12ACE_MT_SYNCHE[vtable for ACE_Task<ACE_MT_SYNCH>]+0x14):SimpleThread.cpp: undefined reference to `ACE_Event_Handler::set_handle(void*)'
Process terminated with status 1 (0 minutes, 14 seconds)
52 errors, 0 warnings
 
Title: Re: Installing the ACE Threads package on C::B
Post by: thomas on January 18, 2006, 01:19:23 pm
And did you add the required libraries, too? Missing references are most often due to a forgotten link library.
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 18, 2006, 03:30:36 pm
You mean:
Code
$ACE_ROOT/lib
?
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 18, 2006, 03:50:22 pm
Does:
Code
warning: inline function
affects anything?

I'm getting this when compiling the ACE...
Title: Re: Installing the ACE Threads package on C::B
Post by: Michael on January 18, 2006, 05:02:22 pm
Does:
Code
warning: inline function
affects anything?

I'm getting this when compiling the ACE...

A warning is not an error :). Anyway, it can cause problems later or soon :(. Better solve any warnings if possible.

About your warning(s) you can try to find out with google what it is and how (hopenfully :)) to solve it. Check at ACE website and/or forum (if any) too.

Michael
 
Title: Re: Installing the ACE Threads package on C::B
Post by: mtk on January 18, 2006, 05:05:50 pm
I've found the solution, just asking for the affects...

anyway, it doesn't solve the problem of not being able toeven compile a single main.cpp...