Got a wierd one here.
I have a class function with 4 parameters, defined like
myclass::myfunc(size_t p1, size_t p2, size_t p3 = 1, bool p4 = TRUE)
If I then call that function like
myptr->myfunc(1,2,3,FALSE);
I get a link error..
myprog.obj : error LNK2001: unresolved external symbol "public: void
__thiscall myclass::myfunc(unsigned int,unsigned int,unsigned int,int)"
(?myfunc@myclass@@QAEXIIIH@Z)
Debug/myprog.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
rf_modem.exe - 2 error(s), 0 warning(s)
However, if I change the definition and implementation, changing the
bool to another unsigned int, it all builds without any problems.
Anyone got any comments on why this should be ? It's MS Visual C++ V6 3 1496
"Mike" <no****@nospam.com> wrote in message
news:GY***************@newsfe1-win.ntli.net... Got a wierd one here.
I have a class function with 4 parameters, defined like
myclass::myfunc(size_t p1, size_t p2, size_t p3 = 1, bool p4 = TRUE)
If I then call that function like
myptr->myfunc(1,2,3,FALSE);
I get a link error..
myprog.obj : error LNK2001: unresolved external symbol "public: void __thiscall myclass::myfunc(unsigned int,unsigned int,unsigned int,int)" (?myfunc@myclass@@QAEXIIIH@Z) Debug/myprog.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
rf_modem.exe - 2 error(s), 0 warning(s)
However, if I change the definition and implementation, changing the bool to another unsigned int, it all builds without any problems.
Anyone got any comments on why this should be ? It's MS Visual C++ V6
Are you sure you are not mixing up bool and BOOL? You are definitely mixing
up false and FALSE, true and TRUE (it should be false and true).
Look out for #defines like this '#define bool int' or '#define bool BOOL'.
It's clear from your error message that your compiler is interpreting bool
as int. That could be because somewhere in your code you have #define bool
....
john
On Tue, 12 Oct 2004 11:10:30 +0000, Mike wrote: Got a wierd one here.
myclass::myfunc(size_t p1, size_t p2, size_t p3 = 1, bool p4 = TRUE)
You may want to use C++ by replacing 'TRUE' with 'true' here ..
myptr->myfunc(1,2,3,FALSE);
... and 'FALSE' with 'false' here.
However, if I change the definition and implementation, changing the bool to another unsigned int, it all builds without any problems.
Anyone got any comments on why this should be ? It's MS Visual C++ V6
I assume TRUE and FALSE are of type unsigned int there.
John Harrison wrote: "Mike" <no****@nospam.com> wrote in message news:GY***************@newsfe1-win.ntli.net...
Got a wierd one here.
I have a class function with 4 parameters, defined like
myclass::myfunc(size_t p1, size_t p2, size_t p3 = 1, bool p4 = TRUE)
If I then call that function like
myptr->myfunc(1,2,3,FALSE);
I get a link error..
myprog.obj : error LNK2001: unresolved external symbol "public: void __thiscall myclass::myfunc(unsigned int,unsigned int,unsigned int,int)" (?myfunc@myclass@@QAEXIIIH@Z) Debug/myprog.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
rf_modem.exe - 2 error(s), 0 warning(s)
However, if I change the definition and implementation, changing the bool to another unsigned int, it all builds without any problems.
Anyone got any comments on why this should be ? It's MS Visual C++ V6
Are you sure you are not mixing up bool and BOOL? You are definitely mixing up false and FALSE, true and TRUE (it should be false and true).
Look out for #defines like this '#define bool int' or '#define bool BOOL'. It's clear from your error message that your compiler is interpreting bool as int. That could be because somewhere in your code you have #define bool ...
john
Ha! you were right there was an include file that redefined true, false
and bool.
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: KS |
last post by:
I am getting linker error for a code that was tested and
running. I opened the project in VS.NET 2003 and now i
get these errors - I am sure it is some options issue.
Can anyone please help?
...
|
by: endo55 |
last post by:
Hi
I've got the following errors when trying to compile a program
cvision error LNK2001: unresolved external symbol _IID_IGraphBuilde
cvision error LNK2001: unresolved external symbo...
|
by: Saran |
last post by:
Hi All,
I'm getting the following linker error when I try to build a library.
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error...
|
by: Joel Whitehouse |
last post by:
Hello All,
I have a Visual C++ 2003 dll solution in a directory called "Antenna
Test Range Control", and when I comile it, I get the error LNK1104:
cannot open file "antenna.obj". When I remove...
|
by: ac2806 |
last post by:
Hi
I want to use the static MFC within a dll, but I get the following errors
when linking:
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcwd.lib(appcore.obj)...
|
by: Chucker |
last post by:
Hi Folks,
I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this
worked fine. When moving to .NET 2.0 I get a couple of unresolved externals /
linker errors:
Error 16 error...
|
by: developer |
last post by:
Hi All
I have made a .NET project.
the files included are borland c++ files that i am migrate to VC++ .NET
I am using Microsoft Visual C++ .NET 2003.
the compilation goes through properly,...
|
by: iiitsunny |
last post by:
i have ported one project which was working in VC6 to VC7. Now the project is working fine in VC7 also. I have made some additions in VC7 environment only. But the problem is that the project is not...
|
by: NvrBst |
last post by:
I have C99 code (which I changed extensions to .cpp to compile as C+
+98). Which is does fine.
I create a Static Library Project (.lib) and Build, and it builds
the .obj files (9 of them) and...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
|
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...
| |