473,395 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VC++ link error

Hi All,

I have few link errors that i am not able to get rif off in a VC++ project
(plugin for filemaker) where i am trying to port the code written for a mac
to windows.

I am creating a object of a class and calling its member functions in
another file and during linking, i get the following error. Any pointer to
this issue is appreciated.

Prashanth

JCM_Functions.obj : error LNK2019: unresolved external symbol "public: short
__thiscall JCM_PDBfile::setFile(char const *,char *)"
(?setFile@JCM_PDBfile@@QAEFPBDPAD@Z) referenced in function "short __stdcall
JCM_SetFile(short,class fmx::ExprEnv const &,class fmx::DataVect const
&,class fmx::Data &)"
(?JCM_SetFile@@YGFFABVExprEnv@fmx@@ABVDataVect@2@A AVData@2@@Z)

// code in JCM_Functions.cpp
JCM_PDBfile* gDataFile = NULL;

// registered with FileMaker as external functions available via the plug-in.
FMX_PROC(fmx::errcode) ABC_SetFile(short index, const fmx::ExprEnv&
environment, const fmx::DataVect& dataVect, fmx::Data& results)
{
if(NULL != gDataFile)
{
gDataFile->close();
delete gDataFile;
gDataFile = NULL;
}

if(NULL == gDataFile)
{
gDataFile = new JCM_PDBfile;
if(NULL != gDataFile) // open file and read contents into obj's buffer
{
errorResult = gDataFile->setFile((const char*) charbuffer);
}
}

return(errorResult);
}
Nov 17 '05 #1
5 1593
"prashanth" <pr*******@discussions.microsoft.com> wrote in message
news:7C**********************************@microsof t.com...
Hi All,

I have few link errors that i am not able to get rif off in a VC++ project
(plugin for filemaker) where i am trying to port the code written for a
mac
to windows.

I am creating a object of a class and calling its member functions in
another file and during linking, i get the following error. Any pointer to
this issue is appreciated.


You haven't shown any code for JCM_PDBfile::setFile(char const *,char *).
Presumably the code that you did include is from JCM_SetFile where the
reference occurs.

Usually the quickest way to resolve cases where a symbol is undefined that
you think should be defined is to use dumpbin /symbols on the .OBJ file
containing the reference and on the .OBJ file where you believe the symbol
(function in this case) should be defined.

Find the reference to setFile and the definition of setFile and see how
their full names differ. You might have a variety of inconsistencies
between how the function is defined and how the function is referenced that
would result in this kind of linker error:

- JCM_PDBfile declared as class in one place and as struct in another place
- const qualifiers not consistent
- "accidental" namespace issues (e.g. where the definition of the function
is inside a namespace, but the declaration that the calling site is using is
not in a namespace).
- different compiler options (e.g. caller expects __cdecl, but the function
was compiled as __stdcall).
- ...

Seeing the complete names from the point of definition and the point of
reference will usually tell you exactly what's wrong.

-cd

PS: dumpbin.exe is a command-line tool that's installed in your
<vs-install-dir>/VC7/BIN directory.

Nov 17 '05 #2
Thanks Carl,

It looks like JCM_PDBfile was compiled but (at the least the OBJ file was
created) but the dumpbin.exe showed that JCM_PDBfile.OBJ didn't have any
symbol information.

Why would that happen?

Prashanth
"Carl Daniel [VC++ MVP]" wrote:
"prashanth" <pr*******@discussions.microsoft.com> wrote in message
news:7C**********************************@microsof t.com...
Hi All,

I have few link errors that i am not able to get rif off in a VC++ project
(plugin for filemaker) where i am trying to port the code written for a
mac
to windows.

I am creating a object of a class and calling its member functions in
another file and during linking, i get the following error. Any pointer to
this issue is appreciated.


You haven't shown any code for JCM_PDBfile::setFile(char const *,char *).
Presumably the code that you did include is from JCM_SetFile where the
reference occurs.

Usually the quickest way to resolve cases where a symbol is undefined that
you think should be defined is to use dumpbin /symbols on the .OBJ file
containing the reference and on the .OBJ file where you believe the symbol
(function in this case) should be defined.

Find the reference to setFile and the definition of setFile and see how
their full names differ. You might have a variety of inconsistencies
between how the function is defined and how the function is referenced that
would result in this kind of linker error:

- JCM_PDBfile declared as class in one place and as struct in another place
- const qualifiers not consistent
- "accidental" namespace issues (e.g. where the definition of the function
is inside a namespace, but the declaration that the calling site is using is
not in a namespace).
- different compiler options (e.g. caller expects __cdecl, but the function
was compiled as __stdcall).
- ...

Seeing the complete names from the point of definition and the point of
reference will usually tell you exactly what's wrong.

-cd

PS: dumpbin.exe is a command-line tool that's installed in your
<vs-install-dir>/VC7/BIN directory.


Nov 17 '05 #3
"prashanth" <pr*******@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
Thanks Carl,

It looks like JCM_PDBfile was compiled but (at the least the OBJ file was
created) but the dumpbin.exe showed that JCM_PDBfile.OBJ didn't have any
symbol information.

Why would that happen?


Typically, the cause for an .OBJ file to have no code in it is that the
source that was compiled contained no code.

For example, if you only cimpile the definition of a template class without
instantiating it, no code will be generated for that template. Now in your
case, the class doesn't appear to be a template, so it's something else.

It might be useful to compile the module in question with the /P
command-line option to produce a pre-processed output file (i.e. the source
file with all #includes and #defines expanded). That will let you see
exactly the text that the compiler itself saw. You might have a run-away
#ifdef or something like that that's causing the entire source file to be
skipped (although I think you'll get an error in that case).

-cd

Nov 17 '05 #4
Carl,

If i use the /P option, the linker gives me a WinExample fatal error
LNK1181: cannot open input file 'WinPluginDataDebug\JCM_Functions.obj' and
there was no .OBJ files in the output directory.

Also on testing, I see that the compiler completely ignores the text in
JCM_PDBfile.cpp after the #include "JCM_PDBfile.h" statement.

As a last resort, i have placed the project at the following address.
http://www.geocities.com/pkodela/FMPlugInSDK.zip

Can you please take a shot at it?
Thanks,
Prashanth
"Carl Daniel [VC++ MVP]" wrote:
"prashanth" <pr*******@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
Thanks Carl,

It looks like JCM_PDBfile was compiled but (at the least the OBJ file was
created) but the dumpbin.exe showed that JCM_PDBfile.OBJ didn't have any
symbol information.

Why would that happen?


Typically, the cause for an .OBJ file to have no code in it is that the
source that was compiled contained no code.

For example, if you only cimpile the definition of a template class without
instantiating it, no code will be generated for that template. Now in your
case, the class doesn't appear to be a template, so it's something else.

It might be useful to compile the module in question with the /P
command-line option to produce a pre-processed output file (i.e. the source
file with all #includes and #defines expanded). That will let you see
exactly the text that the compiler itself saw. You might have a run-away
#ifdef or something like that that's causing the entire source file to be
skipped (although I think you'll get an error in that case).

-cd

Nov 17 '05 #5
The problem was in the JCM_PDBfile.cpp file where some end of file characters
were found in the begining of the file and the compiler was ignoring all the
functions after the EOF character.

"prashanth" wrote:
Carl,

If i use the /P option, the linker gives me a WinExample fatal error
LNK1181: cannot open input file 'WinPluginDataDebug\JCM_Functions.obj' and
there was no .OBJ files in the output directory.

Also on testing, I see that the compiler completely ignores the text in
JCM_PDBfile.cpp after the #include "JCM_PDBfile.h" statement.

As a last resort, i have placed the project at the following address.
http://www.geocities.com/pkodela/FMPlugInSDK.zip

Can you please take a shot at it?
Thanks,
Prashanth
"Carl Daniel [VC++ MVP]" wrote:
"prashanth" <pr*******@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
Thanks Carl,

It looks like JCM_PDBfile was compiled but (at the least the OBJ file was
created) but the dumpbin.exe showed that JCM_PDBfile.OBJ didn't have any
symbol information.

Why would that happen?


Typically, the cause for an .OBJ file to have no code in it is that the
source that was compiled contained no code.

For example, if you only cimpile the definition of a template class without
instantiating it, no code will be generated for that template. Now in your
case, the class doesn't appear to be a template, so it's something else.

It might be useful to compile the module in question with the /P
command-line option to produce a pre-processed output file (i.e. the source
file with all #includes and #defines expanded). That will let you see
exactly the text that the compiler itself saw. You might have a run-away
#ifdef or something like that that's causing the entire source file to be
skipped (although I think you'll get an error in that case).

-cd

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: J | last post by:
Hi everyone, I started embedding python into a 3D graphics App and I came across this linking problem. SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol...
1
by: yanwan | last post by:
Hello I met some problems in linking a project, and hope someone can give me some advice. -----------Configuration: lighting - Win32 Release-------------------- Linking... LINK : warning...
2
by: um | last post by:
When the POSIX pthreads library for w32 release 2-2-0 (http://sources.redhat.com/pthreads-win32/) is compiled with VC++6 then it compiles and passes all the benchmark tests in the subdirectory...
2
by: PDHB | last post by:
Hi. I'm trying to migrate a small library to VC8 via the wizard, but when I try to compile I get the following errors: Error 1 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
0
by: tccode97 | last post by:
To whom it may concern, I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link ...
1
by: tccode97 | last post by:
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link ...
4
by: nmrcarl | last post by:
I'm trying to upgrade a large project from VS 6.0 to VS 2005. After fixing a lot of things that changed (mostly sloppy coding in the original project that VS2005 didn't allow), I got the release...
6
by: walkerfx | last post by:
Hi Everyone, I have been trying resolve this issue for many hours and am not making any progress. I have a DLL that I'm updating with some new 3rd party libraries. However, there appears to be a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.