Reply
Thread Tools
Posts: 10 | Thanked: 0 times | Joined on May 2010 @ Birmingham, United Kingdom
#1
I'm trying to play around making apps for my N900 with the beta Nokia Qt SDK. I wanted to try and play around with some kind of Facebook app and have downloaded qfacebookconnect.

The problem is, that I can't even get the sample project supplied with qfacebookconnect to work, it comes up with this error:
Code:
:: error: ../debug/libqfacebookconnect.so: No such file or directory
But when looking myself I can see that the file does exist.

I've tried on windows and linux with the same problem, I'm using Linux Mint 9 and win7.

Any help appreciated

Last edited by lordmoocow; 2010-05-10 at 12:11. Reason: forgot to mention that the file does exist
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#2
As always with compilation: supply the exact invocation of the compiler and, in this case, linker.

Supply us with a listing of the file system that shows us that you really checked for the file in the right place.

And, more importantly, when do you get this error? Compile time? When you try to run the application? While debugging?
 
Posts: 10 | Thanked: 0 times | Joined on May 2010 @ Birmingham, United Kingdom
#3
It happens at compile time, I am trying to figure out whether this is caused by the Nokia SDK creating a separate directories outside of the projects directory for the build?

The code gets the file from:
Code:
win32:LIBS += ../debug/libqfacebookconnect.a
unix:LIBS += ../debug/libqfacebookconnect.so
And the file listing (I havn't changed anything from what I downloaded):
Code:
.
|-- libqfacebook-build
|   |-- debug
|   |   |-- libqfacebookconnect.so -> libqfacebookconnect.so.1.0.0
|   |   |-- libqfacebookconnect.so.1 -> libqfacebookconnect.so.1.0.0
|   |   |-- libqfacebookconnect.so.1.0 -> libqfacebookconnect.so.1.0.0
|   |   `-- libqfacebookconnect.so.1.0.0
|   |-- fbdialog.o
|   |-- fbfeeddialog.o
|   |-- fblogindialog.o
|   |-- fbpermissiondialog.o
|   |-- fbrequest.o
|   |-- fbsession.o
|   |-- fbstreamdialog.o
|   |-- fbxmlhandler.o
|   |-- Makefile
|   |-- moc_fbdialog.cpp
|   |-- moc_fbdialog.o
|   |-- moc_fbfeeddialog.cpp
|   |-- moc_fbfeeddialog.o
|   |-- moc_fblogindialog.cpp
|   |-- moc_fblogindialog.o
|   |-- moc_fbpermissiondialog.cpp
|   |-- moc_fbpermissiondialog.o
|   |-- moc_fbrequest.cpp
|   |-- moc_fbrequest.o
|   |-- moc_fbsession.cpp
|   |-- moc_fbsession.o
|   |-- moc_fbstreamdialog.cpp
|   |-- moc_fbstreamdialog.o
|   |-- moc_fbxmlhandler.cpp
|   |-- moc_fbxmlhandler.o
|   |-- qrc_qfbconnectimages.cpp
|   `-- qrc_qfbconnectimages.o
|-- listing.txt
`-- qfacebookconnect-qfacebookconnect
    |-- AUTHORS
    |-- debian
    |   |-- changelog
    |   |-- compat
    |   |-- control
    |   |-- copyright
    |   |-- dirs
    |   |-- files
    |   |-- postinst
    |   |-- rules
    |   `-- substvars
    |-- debug
    |-- inc
    |   |-- fbconnectglobal.h
    |   |-- fbdialog.h
    |   |-- fberror.h
    |   |-- fbfeeddialog.h
    |   |-- fblogindialog.h
    |   |-- fbpermissiondialog.h
    |   |-- fbrequest.h
    |   |-- fbsession.h
    |   |-- fbstreamdialog.h
    |   `-- fbxmlhandler.h
    |-- libqfacebook.pro
    |-- LICENSE
    |-- README
    |-- resource
    |   |-- images
    |   |   |-- close.png
    |   |   |-- fbicon.png
    |   |   |-- login2_down.png
    |   |   |-- login2.png
    |   |   |-- login_down.png
    |   |   |-- login.png
    |   |   |-- logout_down.png
    |   |   |-- logout.png
    |   |   `-- readme.txt
    |   |-- qfbconnectimages.qrc
    |   `-- readme.txt
    |-- sample
    |   |-- gfx
    |   |   |-- fb.svg
    |   |   `-- readme.txt
    |   |-- main.cpp
    |   |-- mainwindow.cpp
    |   |-- mainwindow.h
    |   |-- mainwindow.ui
    |   |-- sample.pro
    |   |-- sample.pro.user
    |   `-- ui_mainwindow.h
    |-- sample-build
    |   |-- main.o
    |   |-- mainwindow.o
    |   |-- Makefile
    |   |-- moc_mainwindow.cpp
    |   |-- moc_mainwindow.o
    |   `-- ui_mainwindow.h
    `-- src
        |-- fbdialog.cpp
        |-- fberror.cpp
        |-- fbfeeddialog.cpp
        |-- fblogindialog.cpp
        |-- fbpermissiondialog.cpp
        |-- fbrequest.cpp
        |-- fbsession.cpp
        |-- fbstreamdialog.cpp
        `-- fbxmlhandler.cpp

12 directories, 90 files
I think it is compiling with g++

(sorry, I'm a bit of a noob with c++ and qt )
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#4
So, what are you compiling when it breaks? What happens if you do
Code:
ls -al libqfacebook-build/debug
My suspicion is that you might very well have a build of the library (I see some .o files) but when you try to build the application that uses it, you're not getting the path right.

In which directory do you start the compilation?
 
Posts: 10 | Thanked: 0 times | Joined on May 2010 @ Birmingham, United Kingdom
#5
I got:
Code:
total 2128
drwxr-xr-x 2 lordmoocow lordmoocow    4096 2010-05-10 14:01 .
drwxr-xr-x 3 lordmoocow lordmoocow    4096 2010-05-10 14:01 ..
lrwxrwxrwx 1 lordmoocow lordmoocow      28 2010-05-10 14:01 libqfacebookconnect.so -> libqfacebookconnect.so.1.0.0
lrwxrwxrwx 1 lordmoocow lordmoocow      28 2010-05-10 14:01 libqfacebookconnect.so.1 -> libqfacebookconnect.so.1.0.0
lrwxrwxrwx 1 lordmoocow lordmoocow      28 2010-05-10 14:01 libqfacebookconnect.so.1.0 -> libqfacebookconnect.so.1.0.0
-rwxr-xr-x 1 lordmoocow lordmoocow 2168137 2010-05-10 14:01 libqfacebookconnect.so.1.0.0
I get the error trying to compile the sample project. The compilation would be in the sample projects directory (qfacebookconnect-qfacebookconnect/sample/) I presume, which could be the problem. I tried moving it around but no luck, maybe I didn't move it to the right place..
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#6
If you build the sample application in qfacebookconnect-qfacebookconnect/sample and the library is located in libqfacebook-build/debug it will fail in just this way.

Change the reference in your Makefile to ../../libqfacebook-build/debug/libqfacebookconnect.so and it might work better.

And when I talk about "invocation of the compiler", I really mean every line that starts with g++ that you get after typing "make". If you look at this line, you'll see every flag that is passed to the compiler and you can see where it will look for files.

This bad habit of hiding the actual compiler invocations is a detriment to software development. It's bordering to ******ed to hide this with some misplaced idea about "protecting" the user from the output. Read the documentation and try to find the switch that will turn off silent compilation.
 

The Following User Says Thank You to Joorin For This Useful Post:
Posts: 10 | Thanked: 0 times | Joined on May 2010 @ Birmingham, United Kingdom
#7
I have got it to show the compiler output now, and I looked in the Makefile but wasn't sure what to change as this is created automatically by qmake.

I changed the code shown in my first post to point to the correct debug folder and no longer get the compilation error, the output is now:
Code:
Running build steps for project sample...
Configuration unchanged, skipping qmake step.
Starting: /usr/bin/make -w 
make: Entering directory `/home/lordmoocow/Documents/stuff/qfacebookconnect-qfacebookconnect/sample-build' 
make: Nothing to be done for `first'. 
make: Leaving directory `/home/lordmoocow/Documents/stuff/qfacebookconnect-qfacebookconnect/sample-build' 
Exited with code 0.
I did spot a load of g++ lines but they seem to have gone :\

And application output:
Code:
Starting /home/lordmoocow/Documents/stuff/qfacebookconnect-qfacebookconnect/debug/sample...
/home/lordmoocow/Documents/stuff/qfacebookconnect-qfacebookconnect/debug/sample: error while loading shared libraries: libqfacebookconnect.so.1: cannot open shared object file: No such file or directory
/home/lordmoocow/Documents/stuff/qfacebookconnect-qfacebookconnect/debug/sample exited with code 127
So now it is saying the same thing as before, but during run time, so should be a similar solution.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#8
If you're running on a Linux system, installing the libqfacebookconnect.so.1.0.0 would solve that.

The problem you've got now is that the loader, which is responsible for setting everything up to run your application, can't find a library that you said your application needs. So, in a Linux system, you can have a look at the LD_LIBRARY_PATH environment variable and use that to point at the directory where your library is located. Like so:
Code:
LD_LIBRARY_PATH=libqfacebook-build/debug sample
This has to be done in the root of the build tree to make the path work.
 

The Following User Says Thank You to Joorin For This Useful Post:
Posts: 10 | Thanked: 0 times | Joined on May 2010 @ Birmingham, United Kingdom
#9
I still can't seem to get it to work

I have put the path in the LD_LIBRARY_PATH, but unless I have somehow done it wrong it hasn't had any affect.

Would it be easier to set both to compile to the same location? Or would that not solve this.

Last edited by lordmoocow; 2010-05-10 at 16:09.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#10
How did you set LD_LIBRARY_PATH and to what?
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:18.