Author Topic: Linking error in GameTutorials examples: LNK1104: cannot open file "Loader.pdb"  (Read 5454 times)

Acenelio

  • Guest
Hi all,

I'm getting trouble on building some Game Tutorial's OpenGL examples (www.gametutorials.com). I'm using Code::Blocks gathered to VC++ Toolkit 2003 & Platform SDK in a Win XP SP1 O.S.

Most of them (the Game Tutorialsí examples) run without problems. However, when trying to build those OpenGL examples which handle with loading or animating models, some problems occur.

Let me show what happens with the "3DS File Loader" OpenGL example:

1) First, I double-click the ".sln" file to import the projetc, then click "yes" - "yes" during the importing process. Then I click Build->Rebuild in C::B.

2) Lots of C4530 warnings occur. Then I go to Project->Build Options and  include the /EHsc option in Compiler -> Other Options tab. (Did I proceed correctly to solve the C4530 warnings?)

3) Then when I rebuild again, an error remains:

fatal error: LNK1104: cannot open file 'Loader.pdb'

A similar error occur when building the OpenGL 3D model animating examples:

fatal error: LNK1104: cannot open file 'Animation.pdb'

What does this error mean? Why is it occurring? What can I do to solve it?

Thanks
Nelio

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
.pdb is the msvc debugging symbol files that are generated when you compile in debug mode.  did you try a release compile?

Acenelio

  • Guest
Your comment gave me a clue and so I've build my project successfully:

There was some linker options in Project's build options:

  Release -> Linker tab -> Other linker options:
    /pdb:.\Release\3DS Loader.pdb

  Debug -> Linker tab -> Other linker options:
    /pdb:.\Debug\3DS Loader.pdb

I put "" in both cases:

  Release -> Linker tab -> Other linker options:
    /pdb:".\Release\3DS Loader.pdb"

  Debug -> Linker tab -> Other linker options:
    /pdb:".\Debug\3DS Loader.pdb"


It worked!!

Look: as the past error was "cannot open file Loader.pdb", it seems it was a filename miss-tokenizer error! (because the real filename is "3DS Loader.pdb", corresponding on the project filename).

Is this a known bug on Code::Blocks??

Or Code::Blocks doesn't accept project names with spaces? If not, I've got an advice: Code::Blocks could give a warning about the filename of the project.

Thanks

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Is this a known bug on Code::Blocks??
Or Code::Blocks doesn't accept project names with spaces?
Not knowing what release you use at all, this is a bit awkward to answer. Since you most probably use RC2, I'll say "maybe" for now (because I don't remember, so many things have changed since then).

The current development version is pretty good at escaping spaces, I never experience a compiler problem if a space makes it way into a pathname by accident.

However, even if it works, path- or filenames that contain spaces or other non-alphanumeric characters (+*?<>$) are a really, really bad idea because you are almost certain to run into problems sooner or later. If not with Code::Blocks, then with some other tool, some day.
Funnily, under Linux, you can indeed  use filenames like "foo*bar?<>&%$" (this falls under S.I.S.O., but it still works), but please never do that - it is pure madness.

For example, '$' will be interpreted as the beginning of a build variable by Code::Blocks, space characters as well as '+' characters are certain to cause the debugger or the resource compiler to fail (both tools are well-known for that), and other special chars (wildcards or <>) may to confuse the shell or the compiler's commandline parser if not properly escaped (as does the space character).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
1) First, I double-click the ".sln" file to import the projetc, then click "yes" - "yes" during the importing process. Then I click Build->Rebuild in C::B.

In RC2 and may be (but I am not sure) in the SVN binary snapshots, the import .sln file functionality is not perfect and you should check the project's settings after importing a solution.

As Thomas said, the use of path with spaces is not a very good idea and should be avoided. May be try "My_path" instead of "My path". This is what I use :).

Michael