Weird linker error on Borland C++ Builder 6 - c++

I've been trying to compile a Borland C++ Builder 6 project, but linker dies with exact following error:
[Linker Fatal Error] Fatal: Unable to open file '.OBJ'
Strange thing about it is that it doesn't give any file name except the extension. It looks like an internal bug, though googling for it didn't give any results. Has anyone encountered this error?
== SOLVED ==
It was actually an invalid compiler directive in one of the sourcefiles which caused linker command line to be corrupted. Thanks for help.

Check for illegal whitespace characters in your Linker command line.
If you don't find any, post your linker command line here (Off the top of my head found in Project -> Options -> Linker -> Command Line).

I've never used Borland C++ Builder, but that might sound like a broken project or a corrupted object file - I guess you have not had any compilation error.
A few steps you may want to take:
- rebuild the project
- check the exact command-line used to invoke the linker, and look for strange things in the custom project settings (in such a thing exists).
If you indeed find some strange things in the command-line, hand-editing the project file (kids, don't do this at home) to remove the offending part may be the last resort before building up a new project.

Ive seen this before with visual studio, normally if i stop the compiler building while its in the linking process, not sure if borland generates obj files during its linking process? have a search in your project directory, and delete the obj files possibly in a folder called "intermediate" and try again

I suspect whitespace or other characters such as - or + on your command line.

Related

What's the cause of a D8049 error in visual studio?

I'm creating a project with openframeworks (the full source is here: https://github.com/morphogencc/ofxAsio/tree/master/example-udpreceiver), and the empty project seems to compile fine.
I added the ASIO library, and a few header classes, and now the project seems to be give me the following error:
1>------ Build started: Project: example-udpreceiver, Configuration: Debug x64 ------
1> main.cpp
1>cl : Command line error D8049: cannot execute 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\c1xx.dll': command line is too long to fit in debug record
1>cl : Command line error D8040: error creating or communicating with child process
I couldn't find any examples of error D8049 on stackoverflow or even on Microsoft's pages, and google turned up painfully few results. The only remotely useful one was this github issue:
https://github.com/deplinenoise/tundra/issues/270
But I'm still not sure what's causing the problem. Is anyone familiar with this error, and can recommend a method for troubleshooting what's causing it?
thanks in advance!
For me, working with UE4, this was an intermittent error.
I added "bLegacyPublicIncludePaths = false;" to the innermost block of project.Build.cs and recompiled without errors.
Then I removed that line and compiled again w/o errors.
The error message suggested adding "DefaultBuildSettings = BuildSettingsVersion.V2;" to project.Target.cs which worked.
This is a bit of a weird sounding error, as it is from essentially internally generated data. However, you do have control over that. Taking the error message at face value, you probably have many/lots of defined symbols passed in on the command line (or the the ones you do have have lengthy definitions), or you may have some lengthy file paths.
If you look under the project properties, one of the selections under the C++ section is "Command Line", which will show you exactly what gets passed to the compiler. When you view that you can see where you have many or lengthy parameters, and then make changes to shorten them.
Too many defines? Put them in a header (possibly stdafx.h) and include them that way.
Long file paths? Shorten the paths, put the files somewhere else, or set up file system aliases to your real directories that use shorter paths.

why i am receiving cant open file 'opencv_core2411d.obj'

I am tryin to use openCV-2.4.11 library in visual studio 2013, to do so i followed
this tutorial and this slideshare tutorial
unfortunately, every time i run any C++ code even "Hello world", the compiler generates this error Link: fatal error LINK1104: cant open file 'opencv_core2411d.obj'
I also referred to some question in SO but they were not detailed or they discuss importing opencv library but in another IDE not visual studio.
note: the libs i used as input to the linker in the field 'Additional Dependencies':
opencv_calib3d2411d.lib
opencv_contrib2411d.lib
opencv_core2411d.lib
opencv_features2d2411d.lib
opencv_flann2411d.lib
opencv_gpu2411d.lib
opencv_haartraining_engined.lib
opencv_highgui2411d.lib
opencv_imgproc2411d.lib
opencv_legacy2411d.lib
opencv_ml2411d.lib
opencv_nonfree2411d.lib
opencv_objdetect2411d.lib
opencv_photo2411d.lib
opencv_stitching2411d.lib
opencv_ts2411d.lib
opencv_video2411d.lib
opencv_videostab2411d.lib
and i am using win8
please provide steps to successfully import opecv2.4.11 into visula studio and let me know why i am receivin this error
In my experience the linker error:
Link: fatal error LINK1104: cant open file 'opencv_core2411d.obj'
usually means that the linker cannot find the file. This is generally because the linker properties are not correct.
Check the property page under linker->"Additional Library Directories" and make sure that it is filled in and the path is correct.
Depending on how you have the project setup you may have different settings for debug and release configurations.
I was also having the same problem for quite a time and after searching everywhere in the internet i finally got the solution.
These input files are correct but you need to give the full path in Linker->Input->Additional Dependencies. i will show you how.
C:\opencv\build\x64\vc12\lib\opencv_calib3d2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_contrib2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_core2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_features2d2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_flann2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_gpu2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_highgui2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_imgproc2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_legacy2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_ml2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_objdetect2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_ocl2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_photo2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_stitching2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_superres2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_ts2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_video2411d.lib
C:\opencv\build\x64\vc12\lib\opencv_videostab2411d.lib
Also in Linker->General->Use Library Dependency Input, Click on yes
This should certainly help.

Linker error when declaring a function just before calling it

I've got an update function in my game that contains the following code:
void DrawMiniFPSCounter();
DrawMiniFPSCounter();
The DrawMiniFPSCounter() function is declared in a file called miniFPSCounter.cpp, which is part of the build target (I'm using Xcode). When building, I get a linker error saying that the DrawMiniFPSCounter symbol cannot be found. I've tried removing the declaration above and just calling DrawMiniFPSCounter() but that results in a 'symbol not found' error during compilation. Why would the linker have trouble finding this symbol? Is it something to do with the order in which symbols are resolved in the project?
EDIT: I ran the command nm hrMiniFPSCounter.o | grep Draw in my build directory, and got the following output:
00000000 T __Z15DrawMiniCounteriiiii
0002d040 S __Z15DrawMiniCounteriiiii.eh
00000a00 T __Z18DrawMiniFPSCounterv
0002d148 S __Z18DrawMiniFPSCounterv.eh
00000560 t __ZL9DrawDigitiiib
0002d128 s __ZL9DrawDigitiiib.eh
is this normal? Why the extra characters on the end of the function names?
In my experience most common "errors":
Was the file (really) compiled?
Was it (really) linked correctly?
Did you give the function the name you thought you did?
new Namespace issues :)
Are you sure that the miniFPSCounter.cpp file is compiled (/have been incouded in the project in the right way)? I guess what you are experiencing could be caused by a few different things,but in lack of more information I would say: Try to make sure that the cpp file is being compiled (maybe introduce a few syntax errors which would give rise to a compilation error if it is indeed compiled) and when you are sure about that, you can start checking for other stuff (suchas that it is being linked correctly, etc)
Edit: Putting checklist on top.

ERROR LNK1104 - .`obj` file without any file name

I am trying to compile a project where i am getting this error. I am very new to c++ and dont know much about VC++. And the most irritating part is that the error does not mention a name to the .obj file!!! Here is the whole error [copied from Error List] :
Error 1 error LNK1104: cannot open file '.\Debug\.obj' E:\7zsrc\CPP\7zip\Bundles\Format7zF\LINK 7z
To be more specific, I am compiling the Format7zF bundle included with 7z source version 9.22ß. I have already tried most of the solutions out there but most times either the the problem is different or the solution does not work.
Any help would be great!
Thanks
Update
I just noticed [from the .log file] that at the end of the linker Debug\\.obj was added! Hope this explains the problem more!
Update 2
I am attaching a copy of the project. You can examine the project by opening the solution from [ExtractionPathOfTheArchive]\CPP\7zip\Bundles\Format7zF\ Directory. Hope someone can help.
Link to Project Source("d.zip")
I have just converted the source files from VC++6 to VC++12 and changed the Output File Path in linker to inherit from..., nothing else.
It's Too late, but for records. :)
I had same problem, when I converted the 'QUAKE' project from VC6 to VS2010.
I solved it by changing setting of '.s' files (asm code file).
Check [Properties/Configuaration Properties/Custom Build Setup/General/Outputs]
and there are "$(InputName).obj" macro, then try to change it as "%(Filename).obj".

MySQL Connector Linker Problem

Hey, I'm trying to compile a program with the MySQL C++ Connector but somehow I can't get the linking right.
The errors I get are:
mysql/lib/libmysqlcppconn.so: undefined reference to `std::ios_base::ios_base()#GLIBCPP_3.2'.... etc
alt text http://img156.imageshack.us/img156/4022/linking.th.png
locations:
libmysqlcppconn.so: mysql/lib/
libmysqlclient.so: /usr/lib/
I tried to follow the tutorial on mysql and some other pages but the results where the same, maybe I missed something.
OK, it seems like the connector (binary) requires a certain libstdc++.so version (5) since I couldn't fix that I had to use the sources. Some errors I encountered while compiling them where that I had to include <stdio.h>. Now Everything is working!