Opened 10 years ago

Closed 10 years ago

#7887 closed Support Requests (worksforme)

Boost & Eclipse

Reported by: Barnabé Faliu <barnabe.faliu@…> Owned by: viboes
Milestone: Component: thread
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

Hello everyone, I need your help with a problem in relation with Boost 1-52-0 and Eclipse for C++ developpers. First, i use Cygwin 1.7.17-1 as compiler and my boost library is well compiled (boostrap.sh and b2 executed). My OS is Windows 8 Pro 64bits.

Here is the simple program I try to execute :

#include <iostream>
#include <boost/thread/thread.hpp>
using namespace std;
 
 
int main() {
 
	cout << "hello";
	return 0;
}

This code is compiling without any problem but, when i want to execute it, nothing appears. I noticed that if I set "#include <boost/thread/thread.hpp>" as comment, the word "hello" appears, then I concluded that boost library was the problem, but I absolutly don't know why..

Here are my project linkers :

Includes (Cygwin C++ Compiler) : C:/boost

Libraries : boost_thread

boost_system

Librairies search path : C:/boost/stage/lib

I as well want to precise that I defined the system variable "CYGWIN" with "nodosfilewarning" value because I had an error like that when compiling : "cygwin warning: MS-DOS style path detected: c:/ Preferred POSIX equivalent is: /cygdrive/c CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: cygwin.com/cygwin-ug-net/usin...sing-pathnames"

Hope you'll help me, thanks !

Change History (6)

comment:1 by viboes, 10 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

Have you tried including another header from another boost library, e.g Boost.System? Maybe you should consult some specific Eclipse forums or StackOverflow.

Last edited 10 years ago by viboes (previous) (diff)

comment:2 by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

I think you found something, problem must come from thread library because execution works with every headers except headers from "boost/stage/lib/thread/" and the header "/stage/lib/thread.hpp"

comment:3 by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

EDIT : Sorry i typed wrong, Pathes are respectively "boost/thread" and "boost/thread.hpp"

comment:4 by viboes, 10 years ago

I have tried for the first time to use Eclipse and I rich to compile and run

#include <iostream>
//#include <boost/thread/thread.hpp>
using namespace std;

int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

When I add the library boost_system and the path where it can be found the build is OK,

**** Build of configuration Debug for project tests ****

make all 
Building file: ../src/tests.cpp
Invoking: GCC C++ Compiler
g++ -I/Users/viboes/boost/trunk/boost -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/tests.d" -MT"src/tests.d" -o"src/tests.o" "../src/tests.cpp"
Finished building: ../src/tests.cpp
 
Building target: tests
Invoking: MacOS X C++ Linker
g++ -L/Users/viboes/boost/trunk/stage/lib -o "tests"  ./src/tests.o   -lboost_system
Finished building target: tests

When I try to run it, I'm getting

dyld: Library not loaded: libboost_system.dylib
  Referenced from: /Users/viboes/Documents/workspace/tests/Debug/tests
  Reason: image not found

It seems that the run is not seen where the libs are located independently of boost_thread.

Please, could you post the error you are getting on the console?

comment:5 by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

Problem solved by addind "C:/boost/stage/lib" to the Windows Path environment variable !

Thank you for your help

comment:6 by viboes, 10 years ago

Resolution: worksforme
Status: assignedclosed

OK. Then there were no issue with Boost.Thread ;-). I close the issue.

Note: See TracTickets for help on using tickets.