Code::Blocks Forums

User forums => Help => Topic started by: Rune Hunter on August 03, 2005, 10:48:38 pm

Title: <filename>.lib: No such file or directory error **SOLVED**
Post by: Rune Hunter on August 03, 2005, 10:48:38 pm
OgreMain.lib: No such file or directory

that is the error I get. I have the Ogre lib foder in the lib directories, both in the porject and the compiler settings. I'm not sure why it is not finding the lib file.
Title: Re: <filename>.lib: No such file or directory error
Post by: Vampyre_Dark on August 03, 2005, 11:11:01 pm
Does the file exist?
Did you typo the name?
Are you sure you put the right folder?

The lib fodler might have folders under it, like win/*nix/mac whatever, and the libs are in there.
Title: Re: <filename>.lib: No such file or directory error
Post by: Rune Hunter on August 03, 2005, 11:17:06 pm
I am 99.99% it exists. I already checked more than once.
Title: Re: <filename>.lib: No such file or directory error
Post by: rickg22 on August 03, 2005, 11:35:12 pm
OK just to be sure and finishing off this problem, mind showing us...

a)  a "dir" dump (open command window, change to the appropriate directory, type "dir yourlibraryname.lib", then copy and paste)
b) the contents of the file where you're including that lib... (just to make sure)
c) A screenshot of your project's build settings
c) the full compiler log (compiler settings, other... compiler logging: Full command line) where you're trying to compile?

Thanks.
Title: Re: <filename>.lib: No such file or directory error
Post by: Rune Hunter on August 04, 2005, 12:46:42 am
a) not sure what you mean

b) Contants are as listed:

CEGUIBase.lib
CEGUIBase_d.lib
ode.lib
OgreGUIRenderer.lib
OgreGUIRenderer.pdb
OgreGUIRenderer_d.lib
OgreMain.lib    //The one I am trying to link
OgreMain_d.lib
OgreMain_d.pdb

Folder opt:
debug and release folders of plugin lib files that are not used

c) Pic at bottom of post. I have also tried many many combinations of those settings, moving directories up and down and stuff.

d)

Code::Blocks initialize things (first tab down there, not sure if important):

MessageManager initialized
Manager initialized
PluginManager initialized
Configured 0 tools
ToolsManager initialized
ProjectManager initialized
Scanning for plugins in C:\Program Files\CodeBlocks/share/CodeBlocks/plugins...
Found 10 plugins: AStylePlugin ClassWizard CodeCompletion Compiler DebuggerGDB DefaultMimeHandler DevPakUpdater PluginWizard ToDoList WindowsXPLookNFeel
Opening C:\Documents and Settings\Alex\Desktop\D3D New\D3D.cbp: done
MacrosManager initialized

Compiler Log:

Project   : D3D
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Documents and Settings\Alex\Desktop\D3D New\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: D3D.cpp
Linking executable: C:\Documents and Settings\Alex\Desktop\D3D New\D3D.exe
mingw32-g++.exe: OgreMain.lib: No such file or directory
Process terminated with status 1 (0 minutes, 5 seconds)
0 errors, 0 warnings


Compiler used Microsoft Visual C++ Toolkit 2003


(http://img311.imageshack.us/img311/1181/settings1bk.png) (http://imageshack.us)
Title: Re: <filename>.lib: No such file or directory error
Post by: darklordsatan on August 04, 2005, 01:19:53 am
I might be wrong, but arent you supossed to link the OgreMain.lib -notice the .lib- (not just OgreMain, since this import schema is used with *.a libraries, and this would be if the library was called libOgreMain.a...)
This is, in your first screenie, the "Link Libraries" should show "OgreMain.lib" and not "OgreMain" (perhaps you're using the template here...?)
Title: Re: <filename>.lib: No such file or directory error
Post by: Rune Hunter on August 04, 2005, 01:23:34 am
There is no difference in putting .lib or not, and I am not using the Ogre template.
Title: Re: <filename>.lib: No such file or directory error
Post by: rickg22 on August 04, 2005, 01:55:41 am
OK. a) Nevermind, forget it.

About the Compiler log: You forgot to change the compiler settings as I told you. In menu "Settings", choose "compiler", there's some tabs "Compiler, Linker, Directories, Custom Variables, programs, other". Switch to "Other". There's an option entitled "Compiler Logging:" [Task description]. Click on [Task description] and change it to [Full command line].

Close the settings, and recompile. Then paste again the error in here.

Anyway, please don't think it's too tedious to fix a simple configuration mistake, we have to do it for the sake of the other codeblocks users. Be it a bug or not, this configuration error is very probable to happen to another user, and we don't want that.

See, this isn't the first time we get these kind of bug reports / support requests, and I'm kinda getting tired of them. So I want to know what's going wrong (a missing explanation in the dialogs? In the help? A default option that people mistakingly assume it's another thing?) with the setup.

And when I know what's wrong with YOUR setup and compilation process, I'l be able to modify Code::Blocks and make it much more newbie-friendly. Hope you can bear with me.

So, now that i explained myself :lol:, what's the full command line compiler log? Thanks.
Title: Re: <filename>.lib: No such file or directory error
Post by: Rune Hunter on August 04, 2005, 02:15:59 am
Well I do feel this is a burdon on all of us, but I this has to be solved. My guess it is somthing small, but I checked every little thing.

I did exactly what you told me to do about the compiler log. And there is no change. I rebooted the program, double checked to make sure I have it right. It really doesn't show up as an error, just a message above the Process terminated message.

mingw32-g++.exe: OgreMain.lib: No such file or directory

Also I am using a exe called cl.exe to compiler (Visual c++ toolkit), why does that error say mingw32-g++.exe. Under the compiler options -> Programs it says cl.exe for C/C++ compiling, and Link.exe for linking of libraries. No debuger and mingw32-make.exe for make files or somthing. I also do not have "work with make files" on, I have invoke compiler directly.

So the error might be around there.
Title: Re: <filename>.lib: No such file or directory error
Post by: rickg22 on August 04, 2005, 05:43:13 am

Please slap me for not expressing myself correctly :( What I needed to get is the FULL COMPILER LOG. Since the compilation starts to the end of linking. On the "Compiler" tab in the messages pane, you should read something like this:
Project   : (project name)
Compiler  : (compiler name)
Directory : C:\some path\some dir\etc
--------------------------------------------------------------------------------
Switching to target: (some target)
mingw32-g++.exe   -Wall -g -pipe -mthreads -fno-pcc-struct-return -fno-rtti -fmessage-length=0 (LOTS OF LIBRARIES HERE)
(etc)

*THIS* is what I need to know what's going on in the linking. And this is why i asked you to switch the compiler settings to "FULL COMMAND LINE", so I could get the ENTIRE compilation log.

Anyway, you say you use VC++ toolking, and then you got mingw32-etc in the compiler log?
Please answer me two questions.

Did you import the project / workspace from a VC++ project/workspace/solution ? If so, I assume that the importer asked you if you wanted to use the "default compiler". I think that's the case, because your project somehow is using GCC and not Visual C++.

Check out your project settings, you might have to change the compiler for it. A dialog box will ask you if you want to change the compiler for all targets. Say "YES".

So, to summarize this, I need you to:

a) Give me the full compiler log! (From the beginning)
b) Answer all the questions I asked you (even if you managed to get it working, remember it's also a usability problem we're trying to tackle here)

Thanks.
Title: Re: <filename>.lib: No such file or directory error
Post by: Rune Hunter on August 04, 2005, 06:12:12 pm
Fist I must say I fixed it. Other wise the info you wanted...

No I did not import the project, I started a blank project from within Code::Blocks.

Here is the FULL compiler log before I changed things:

Code
Project   : D3D
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Documents and Settings\Alex\Desktop\D3D New\
--------------------------------------------------------------------------------
Switching to target: default
Linking executable: C:\Documents and Settings\Alex\Desktop\D3D New\D3D.exe
mingw32-g++.exe: OgreMain.lib: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings


Now I fixed it by goign to project settings, the D3D (my project name) settings, and got rid of everythign I put in there. Than I went to the defult settings and put everythign I needed in there (the lib, and resource locations). I also changed the defult compiler to visual toolkit. It now works. (Compiler log is HUGE when it works).
Title: Re: <filename>.lib: No such file or directory error **SOLVED**
Post by: rickg22 on August 04, 2005, 08:44:59 pm
Thank goodness! It's fixed now.

(It's funny, tho. The full compiler log should display the command for the linker... does it happen differently?)

In any case, this problem can also happen if workspaces are imported using the "default" (GCC) compiler. This issue must be reported with priority 9. (too many headaches!) And "default compiler" doesn't say very much, either.
Title: Re: <filename>.lib: No such file or directory error **SOLVED**
Post by: Rune Hunter on August 05, 2005, 01:57:04 pm
Are you going to report this? Or should I?
Title: Re: <filename>.lib: No such file or directory error **SOLVED**
Post by: rickg22 on August 05, 2005, 04:15:37 pm
About the compiler log? Sure, you report it.

Regarding the "default project" etc, I think i reported it already. Thanks.