newbie - can't get include and libs to work

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie - can't get include and libs to work

David Eaton
Unfortunately, going without spaces in a path is not a "real" option in Windows - almost everything goes under "\Program Files".  In the instance of libusb, it installs to "\program Files" - duplicating an entire installed stream just so it doesn't have a space in the path is not realistic.  Quoted paths have worked for me in Unix/Linux - seems they should work here as well.

Dave :}


     

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

Danny Smith


> -----Original Message-----
> From: David Eaton
>
> Unfortunately, going without spaces in a path is not a "real"
> option in Windows - almost everything goes under "\Program
> Files".  In the instance of libusb, it installs to "\program
> Files" - duplicating an entire installed stream just so it
> doesn't have a space in the path is not realistic.  Quoted
> paths have worked for me in Unix/Linux - seems they should
> work here as well.
>
> Dave :}
>


Using spaces in a path works for me, eg

gcc -L "/mingw/lib/msvcrt 71"  t.c  works fine from the command line (under cmd.exe) and
finds the libmsvcrt.a that lives in   "/mingw/lib/msvcrt 71"
Likewise when I change the forward slashes to back slashes.

Try your testcase by putting the paths on the command line (or in a Makefile).

I have not tried your method of modifying specs by inclusion of  a quoted path and
wouldn't expect it to work, since the specs file is part of an internal gcc mechanism and
has its own rules for interpeting strings.

Danny


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

John Brown

On  Fri, 24 Oct 2008 09:51:33 +1300, Danny Smith wrote:
 

>
>> -----Original Message-----
>> From: David Eaton
>>
>> Unfortunately, going without spaces in a path is not a "real"
>> option in Windows - almost everything goes under "\Program
>> Files".  In the instance of libusb, it installs to "\program
>> Files" - duplicating an entire installed stream just so it
>> doesn't have a space in the path is not realistic.  Quoted
>> paths have worked for me in Unix/Linux - seems they should
>> work here as well.
>>
>> Dave :}
>>
>
>
> Using spaces in a path works for me, eg
>
> gcc -L "/mingw/lib/msvcrt 71"  t.c  works fine from the command line (under cmd.exe) and
> finds the libmsvcrt.a that lives in   "/mingw/lib/msvcrt 71"
> Likewise when I change the forward slashes to back slashes.
>

You can also use the short names: C:\Progra~1\ ... Literally one
or two libraries that I have compiled did not accept it. I eventually
gave up and moved my MingW folder out of Program Files, but it
usually works.
_________________________________________________________________
You live life beyond your PC. So now Windows goes beyond your PC.
http://clk.atdmt.com/MRT/go/115298556/direct/01/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

David Eaton
In reply to this post by David Eaton
Does anyone out there have experience trying to get the libusb header and functions "usable" in Windows?  I believe I have gotten around 1 of the problems, as it no longer says it can't find usb.h.  However, now it indicates "not defined" each time I reference a function defined in usb.h.  Is there a difference in syntax - currently I have tried both #include <usb.h>   and   #include "usb.h"  , but neither have made any difference.

BTW - I copied everything that was in c:\program files\libusb.... to c:\libusb.... and changed the paths in the specs file so there were no longer any spaces in the path (quoting the path didn't help) and now it works for at least getting rid of the usb.h not found errors.

I am very much new at this and appreciate any help that can be given.  I have a program from Linux (I merged a couple of other programs others had done) that runs at the command line, and I'm just trying to get this one compiled first.  After that, I have the version I did which is GTK gui based and will need to get it compiled.  I thought the command line one was a good place to start since the only thing it uses are libusb calls.  Obviously, once that problem is worked out, then with the GTK version I should only have to work out the additional GTK things.

Thanks again,
Dave :}


     

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

Soren Andersen
In reply to this post by David Eaton
I'm responding to the message sent on 23 Oct 2008, at around 19:40
UTC, by "David Eaton" <gcos7 ~at~ OBSCURED dot NUL>, who wrote

> Unfortunately, going without spaces in a path is not a "real"
> option in Windows - almost everything goes under "\Program Files".
Only on a misconfigured Windows installation, David.

> In the instance of libusb, it installs to "\program Files"
> - duplicating an entire installed stream just so it
> doesn't have a space in the path is not realistic.
I'm sorry to hear that my methodology, and those used by many other
experienced mingw userts, is unrealistic. Perhaps I should rename my
computer "Hogwarts" and buy a large, black, pointed hat.

> Quoted paths have worked for me in Unix/Linux - seems they should
> work here as well.
See my other reply for why this is an incorrect assertion.

  Sören 'somian' Andersen

--
Blame it on Caradhras the Cruel.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

Greg Chicares
In reply to this post by David Eaton
On 2008-10-24 06:00Z, David Eaton wrote:
>
> now it indicates "not defined" each time I reference a function
> defined in usb.h.

Here are some things you can do to make it easier for others to
help you.

Don't describe what you think an error message means: instead,
copy and paste it literally.

Modifying the specs file is perilous; don't try it unless you're
an expert. Instead, take Danny's advice:
  "Try your testcase by putting the paths on the command line"
Copy and paste the command line you're using into email here.

Reduce the problem to a minimal testcase. For example:

  // testcase.cpp
  #include "some_library.hpp"
  int main()
  {
      some_library_function();
  }

If I cut and paste that here along with the command line I used
and a literal error message, like this:

  g++ -I /path/to/some_library testcase.cpp
  undefined reference to `some_library_function()'
  collect2: ld returned 1 exit status

then someone is sure to tell me to try using '-L' to specify the
linker path.

And break lines at seventy characters or so. When I try to quote
your message, I get three long lines, and I have to scroll six
screens to the right to read them. At that point, many people
would just decide not to reply at all. See:
  http://www.catb.org/~esr/faqs/smart-questions.html#formats

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

Stephen Lee-2
In reply to this post by Soren Andersen
Letting myself be involved in this can of worms against my better
judgement...

While (IMO, of course) it is perfectly fine to say that path without
spaces is a proven solution and that the OP is encouraged to do it this
way, I disagree that setups that do use spaces in pathnames are
'misconfigured', especially if they are the default installation of the
OS.

It is just good practice to be able to handle any legal
pathname (which pathnames-with-spaces-in-them are some) whenever a
pathname is expected, regardless whether the program doing it is a
development tool or a 'real application'.  (This goes for pathnames
with international characters too, but that is another can of worms)
Offering no way at all to do it should be considered a defect.

Now, I understand this is not practical to expect tools to be
perfect, and it may not be worth the time and effort to jump through
the hoops to make the tools behave when there is an inexpensive
workaround, but to discourage people from even trying to find the
correct solution (i.e. make the tools handle paths with spaces
correctly) and advance the state of art is doing a disservice to
everyone involved.  (Of course, I don't think it is a problem to say
"It's not been tried and no one have the time to do it.  If you have a
problem with that you can try it, and if you do find the solution
report back and enlighten us" either.)

For what it is worth, boost's "Getting Started on Windows"
<http://www.boost.org/doc/libs/1_36_0/more/getting_started/windows.html>
also think there is no problem with path-with-space:

Quote:
    It's important to note the following:

       1. The path to the boost root directory (often
          C:\Program Files\boost\boost_1_36_0) is sometimes
          referred to as $BOOST_ROOT in documentation and
          mailing lists.

Stephen

--
Stephen Lee <[hidden email]>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

Greg Chicares
On 2008-10-24 19:13Z, Stephen Lee wrote:
>
[...paths with embedded spaces...]
>
> Now, I understand this is not practical to expect tools to be
> perfect, and it may not be worth the time and effort to jump through
> the hoops to make the tools behave when there is an inexpensive
> workaround, but to discourage people from even trying to find the
> correct solution (i.e. make the tools handle paths with spaces
> correctly) and advance the state of art is doing a disservice to
> everyone involved.

The gnu 'make' mailing list contains extensive discussions on this
topic. Here's just one message from the 'make' maintainer:

  http://lists.gnu.org/archive/html/help-make/2006-03/msg00011.html

The idea that whitespace is a delimiter is quite pervasive in tools
with a *nix heritage. Anyone who wants to generalize them to work
otherwise is free to, but nobody with the necessary skill has
volunteered, or seems likely to. Most people wouldn't be able to
do that, and it would be cruel not to discourage them from trying
to use these tools in a way that we know is likely to cause them
trouble.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

David Eaton
Again, when the tool is being used in Windows, it should obey the parameters that the OS allows.  Not only does Windows allow whitespace in a path, it PROMOTES it by having everything install to "C;\Program Files".  Believe it or not, some installers don't give you a choice - they install there period.  Seems to me if a tool is ported to use on a given OS then it should allow what the OS promotes.

Again, as I said in my last email, can't we quit argueing about something that is getting everyone nowhere and is doing nothing to help my problem?  I posted a long detailed email today, including running gcc from the command line instead of throught a .bat file and not using the specs file.  I was hoping someone could actually provide a newbie guidance on that.  I don't claim to be an expert programmer, and I sure don't claim to know anything about gcc in Windows other than just trying it as I have been and following other posts with actual suggestions.

Please, kill the arguement - it will not get anyone anywhere.  I genuinely and sincerely need some help on this.

Thanks
Dave :(


--- On Fri, 10/24/08, Greg Chicares <[hidden email]> wrote:

> From: Greg Chicares <[hidden email]>
> Subject: Re: [Mingw-users] newbie - can't get include and libs to work
> To: "MinGW Users List" <[hidden email]>
> Date: Friday, October 24, 2008, 3:43 PM
> On 2008-10-24 19:13Z, Stephen Lee wrote:
> >
> [...paths with embedded spaces...]
> >
> > Now, I understand this is not practical to expect
> tools to be
> > perfect, and it may not be worth the time and effort
> to jump through
> > the hoops to make the tools behave when there is an
> inexpensive
> > workaround, but to discourage people from even trying
> to find the
> > correct solution (i.e. make the tools handle paths
> with spaces
> > correctly) and advance the state of art is doing a
> disservice to
> > everyone involved.
>
> The gnu 'make' mailing list contains extensive
> discussions on this
> topic. Here's just one message from the 'make'
> maintainer:
>
>  
> http://lists.gnu.org/archive/html/help-make/2006-03/msg00011.html
>
> The idea that whitespace is a delimiter is quite pervasive
> in tools
> with a *nix heritage. Anyone who wants to generalize them
> to work
> otherwise is free to, but nobody with the necessary skill
> has
> volunteered, or seems likely to. Most people wouldn't
> be able to
> do that, and it would be cruel not to discourage them from
> trying
> to use these tools in a way that we know is likely to cause
> them
> trouble.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move
> Developer's challenge
> Build the coolest Linux based applications with Moblin SDK
> & win great prizes
> Grand prize is a trip for two to an Open Source event
> anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> You may change your MinGW Account Options or unsubscribe
> at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users


     

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

John E. / TDM
David Eaton wrote:
> Please, kill the arguement - it will not get anyone anywhere.  I genuinely and sincerely need some help on this.
>  

Obviously you missed Roman's message:
 > > C:\daves stuff\cvsutil\newsrc\temp>gcc *.c -I c:\libusb\include -L
 > > c:\libusb\lib
 >
 > You still need to tell GCC to link with the library. Given that the
library
 > is libusb.a, I suggest appending -lusb to the above.
 >
 > Roman.

See <http://article.gmane.org/gmane.comp.gnu.mingw.user/27991>.

-John E.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: newbie - can't get include and libs to work

Stephen Lee-2
In reply to this post by Greg Chicares
Greg Chicares <[hidden email]> wrote:
> [...paths with embedded spaces...]
>
> [...] and it would be cruel not to discourage them from trying
> to use these tools in a way that we know is likely to cause them
> trouble.

That is reasonable.  All I object to is the attitude that "such-and-such
setup is broken" when in fact it is only "unsupported by some of the
tools".

And thanks for giving an example of how unsupported it is :)

Stephen

--
Stephen Lee <[hidden email]>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users