Programming C++ with MVS, OSG & Qt: Win XP Linker Error

  • C/C++
  • Thread starter PLA
  • Start date
In summary: OSGIn summary, the person is trying to program in C++ using:-Visual Studio 2005-Qt 4.4.3-OpenSG-OSGConfig.h-OSGNode.h-OSGSimpleGeometry.h-OSGSimpleSceneManager.h-using namespace std;-using namespace osg;-int main(int argc, char *argv[])-{-osgInit(argc,argv); // Init the OpenSG subsystem-QApplication a(argc, argv);-a.connect(&a, SIGNAL(lastWindowClosed()), &a,
  • #1
PLA
2
0
Hi everybody!
I'm trying to program in C++ using:
Visual Studio 2005
Qt 4.4.3
OpenSG

My OS is Win XP

Building shows me a linker error i can't solve.

That's the program (a really base one):

Code:
#include <QtGui/QApplication>
#include <OpenSG/OSGConfig.h>
#include <OpenSG/OSGNode.h>
#include <OpenSG/OSGSimpleGeometry.h>
#include <OpenSG/OSGSimpleSceneManager.h>

using namespace std;
using namespace osg;



int main(int argc, char *argv[])
{
osgInit(argc,argv); // Init the OpenSG subsystem
QApplication a(argc, argv);
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));

return a.exec();
}

And that's the build log:

Code:
Build Log      Build started: Project: Prova2, Configuration: Debug|Win32
Command Lines      Creating temporary file "c:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\Prova2\Debug\RSP00003D28004104.rsp" with contents
[
/Od /I ".\GeneratedFiles\Debug" /I "C:\Program Files\OpenSG\include" /I "C:\Qt\4.4.3\include\QtOpenGL" /I "C:\Qt\4.4.3\include\Qt3Support" /I "C:\Qt\4.4.3\include\QtGui" /I "C:\Qt\4.4.3\include\QtCore" /I "C:\Qt\4.4.3\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "QT_LARGEFILE_SUPPORT" /D "QT_NO_DEBUG" /D "NDEBUG" /D "_UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W1 /c /TP ".\main.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\Prova2\Debug\RSP00003D28004104.rsp" /nologo /errorReport:prompt"
Creating temporary file "c:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\Prova2\Debug\RSP00003E28004104.rsp" with contents
[
/OUT:"C:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\Debug\Prova2.exe" /LIBPATH:"C:\Program Files\OpenSG\lib" /LIBPATH:"C:\Qt\4.4.3\lib" /MANIFEST /MANIFESTFILE:"Debug\Prova2.exe.intermediate.manifest" /DEBUG /PDB:"c:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\debug\Prova2.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86  "C:\Program Files\OpenSG\lib" qtmain.lib QtCore4.lib QtGui4.lib Qt3Support4.lib comdlg32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

".\Debug\main.obj"
]
Creating command line "link.exe @"c:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\Prova2\Debug\RSP00003E28004104.rsp" /NOLOGO /ERRORREPORT:PROMPT"
Output Window      Compiling...
cl : Command line warning D9007 : '/Gm' requires '/Zi or /ZI'; option ignored
main.cpp
Linking...
LINK : fatal error LNK1104: cannot open file 'C:\Program Files\OpenSG\lib.obj'
Results      Build log was saved at "file://c:\Documents and Settings\ghost\My Documents\Visual Studio 2005\Projects\Prova2\Prova2\Debug\BuildLog.htm"
Prova2 - 1 error(s), 1 warning(s)

Can anyone suggest me something?

Thank you!
 
Technology news on Phys.org
  • #2
the warning on /Gm isn't the problem, its just saying if you want to do rebuild of source files you changed then you need to enable saving of symbolic info as well.

The real error is the link error. The linker can't find the lib.obj for the OpenSG library.

Look in the OpenSG directory to see if its there perhaps under directory:

C:\Program Files\OpenSG\lib

ie C:\Program Files\OpenSG\lib\lib.obj

if that's the case then you'll need to see if there's a setting in Visual C++ to change where the compiler/linker looks for Open SG files.
 
  • #3
There's not that file anywhere... i think MVS is searching for something useless... :/
Why would it search for a .obj in a lib path?!

But maybe i don't know what I'm speaking of...

Am i wrong? :D
 
  • #4
a lib is a collection of objs so its reasonable to be there.

it may be that you don't have a full install of the Open SG code but only its header files (ie the include files).

when you loaded Open SG on your system did you need to build it?

http://www.opensg.org/wiki/Building
 
  • #5


I would suggest checking the following things to try and solve the linker error:

1. Make sure all necessary libraries and dependencies are properly installed and linked to your project. In this case, it seems that the linker cannot find the 'C:\Program Files\OpenSG\lib.obj' file, so double check that it is installed and linked correctly.

2. Check for any typos or errors in the code itself. Sometimes a simple mistake can cause a linker error. In this case, make sure the correct file path for the OpenSG library is specified.

3. Check the project settings and make sure the correct libraries are included in the build. It's possible that the OpenSG library is not included in the build process, which could be causing the linker error.

4. Try rebuilding the project from scratch, making sure all necessary libraries and dependencies are properly linked. Sometimes, starting fresh can help identify any issues that may have been overlooked.

5. If all else fails, try reaching out to the support team for the specific libraries you are using (Visual Studio, Qt, OpenSG) for further assistance. They may have more specific knowledge and experience with this type of issue.
 

1. What is MVS and how does it relate to C++ programming?

MVS stands for Microsoft Visual Studio, which is an integrated development environment (IDE) used for C++ programming. It provides tools and features for writing, debugging, and building C++ applications.

2. What is OSG and why is it important for programming in C++?

OSG stands for OpenSceneGraph, which is a cross-platform 3D graphics toolkit. It is commonly used in C++ programming to create interactive and immersive 3D applications, such as video games or simulations.

3. What is Qt and how does it integrate with C++ programming?

Qt is a cross-platform application development framework that provides libraries and tools for building graphical user interfaces (GUIs) and applications. It can be used with C++ to create user-friendly and visually appealing software.

4. Why am I getting a linker error when trying to compile my C++ program on Windows XP?

Linker errors occur when the linker, a tool that combines object files into an executable program, cannot find the necessary libraries or functions to create the final executable. This can happen if the code is not properly linked to the required libraries or if there are errors in the code itself.

5. How can I resolve linker errors when programming in C++ using MVS, OSG, and Qt on Windows XP?

To resolve linker errors, make sure that all necessary libraries are properly linked, check for any errors in the code, and ensure that the compiler and linker settings are correct. Additionally, updating to the latest versions of MVS, OSG, and Qt can also help resolve any compatibility issues that may be causing the linker errors.

Similar threads

  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
16
Views
3K
  • Programming and Computer Science
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Programming and Computer Science
Replies
7
Views
26K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Programming and Computer Science
2
Replies
49
Views
10K
Back
Top