The routine has been declared twice in the same file - coldfusion

We are testing our move to CF2021. We repeatedly get this error of function declared twice in same file. We have tried removing the function and error moves to the next function in cfc.
Same thing works on CF2016 & CF2018 without any issues. Any help, what could be going on here?

I would check if you have multiple cfincludes that have the same routine in it. I had same happen and it considered the routine in the cfinclude declared twice.

We finally found this line of code causing the trouble. No idea why. But posting this as answer, if someone runs into similar issue. Removing it made that error go away.
<cfprocessingdirective pageencoding="utf-8">

Related

Class Variable Not Found When Debugging

I'm currently using Visual Studio Express 2013 for Windows Desktop. When debugging my program, I'm running into an odd issue. When mousing over a class variable, instead of showing the value of it, nothing pops up. I then tried creating a watch for the variable. Instead of finding the variable, the value displayed in the Watch window simply says: "class "class" has no member "variable name". Here is a screenshot to demonstrate what I'm describing:
http://i.imgur.com/6cAOb8S.png
As shown here, the variable m_lineProgramID's value is unable to be displayed in the watch screen. None of the variables that start with m_line are found in the local variables list, yet the line "m_lineProgramID = 0;" doesn't cause an issue. In addition, I tried adding the variable to the constructor's initialization list and initialize it to 0, which also does not cause an issue.
Edit: Just to add a little extra info. I am compiling my program in Debug mode as a 64-bit executable. I've made sure to get 64-bit versions of the libraries I use and have not had an issue running my program until now. Additionally, I renamed both the class and the header & implementation files. I now get a new error: http://i.imgur.com/TozmJZJ.png
Edit 2: I figured out the error that was causing the "Internal Error". I was storing my class in a std::map, and forgot to change the name when using std::make_pair to add an entry (although the class name was correct when I defined the map). This fixed the C1001 error I got and renaming the class and files seems to have fixed the original issue. If anyone could shed some light on why I had the issue in the first place, I would be extremely grateful.

Periods in URL cause Railo Error

The following link http://127. 0. 0. 1:8888/.../index.cfm causes an error in Railo's built in server.
Can anything be done to keep this from happening?
You should be able to handle this by defining a onMissingTemplate function in your Application.cfc

User Breakpoint Called From Code At 0X7c90120120e

I'm debugging a code in VS that I wrote in C.
For some reason, at some point it jumps to an assembly window with the following line:
int 3
And a pop up message box appears with the following message:
User Breakpoint Called From Code At 0X7c90120120e
I looked at the stack, and the command that caused that was MALLOC !
In output window:
Heap missing last entry in committed range near 22549c0
The weird thing is, when I press OK at the message then F5 to continue debugging it continues and everything works 100%. But when I try to execute the code I get a message that my project encountered some problem.
I tried cleaning my project, rebuilding, removing all breakpoints .. nothing worked.
First of all thank you all for commenting/ answering.
I solved the problem. I found out that I was trying to Free the same memory TWICE.
The reason that I didn't notice it before is that the "Free" (delete function) wasn't in the same function nor the same file as where the debugger stopped/ the breakpoint occured(on malloc).
So if anyone is having the same problem, just make sure you are not Free-ing the same memory more than once.
Possible duplicate of this stack overflow thread.And here's an explanation of this problem in this link.Hope that helps you out.

Qt/C++ Exited with code -1073741819 (Program crashes with exception code c0000005)

I'm having trouble with my program crashing. I get that "Program.exe has stopped working" windows pop-up which mentions my exception code is c0000005. When I return to the output from the application in Qt, it shows:
C:\Users\Me\Desktop\project\project-build-desktop\debug\project.exe exited with code -1073741819
I've found the line that's causing the error (I think!), though I don't know why it might. If I comment out this line, the program won't crash.
The line is:
db=newDb;
This is located in the constructor of my class wndChildWhatever which is a QMainWindow. newDb is defined in the constructor arguments as DatabaseManager *newDb and db is a private member of wndChild defined as DatabaseManager *db. This database address is passed around all over my program, and this wndChildWhatever is the only one I'm having trouble with.
The exception/crash doesn't occur when the window is opened/constructed, however. It happens when the window is closed. What's weirder is that it doesn't happen every time. Sometimes you can open the window and close it with out problem, then open it again and on the second closing, it crashes. Other times it happens the first time you try to close it.
I'm really not sure what's going on here and hope someone can assist!
The faulting line:
db=newDb;
And you say:
and db is a private member of wndChild
It sounds like your this pointer might be invalid. That is, if this happens in a method foo you are doing something like wndChild->foo() and wndChild is an invalid pointer. Therefore when it access the offset of db relative to wndChild you hit an accesses violation. (NT error code 0xc0000005, Windows-speak for a bad pointer dereference.)
Most likely it's not the db=newDb line itself that's causing the crash, but rather some other code that gets executed later on, that doesn't get executed if you don't set the db value. Have a look at the other code inside your wndChildWhatever class, and see what it is doing with the (db) value. Perhaps it is doing something naughty, like deleting it while other code is still using it?
With the line db=newDb you have two pointers to the same object. What do you do in the destructors? If you have "delete db" and "delete newDb" you delete the same object twice which may lead to a crash or not.
Try to delete the build directory and rebuild it. It worked for me, but i need to do it everytime I add a new function or member to any class. Idk why.

Why would CFAbort not work?

I am having an odd problem. There is a large request I am debugging so I threw a cfabort in at a particular spot before some processing is to occur. It doesn't appear to be working as the request keeps running in browser and shows up in the CF monitor, where I kill it manually. Throwing an error immediately works, though doing a cfabort with "showerror" doesn't. Any thoughts on what is going on?
Well, I found the culprit. I had debugging on and set to send output to ColdFire. I guess there was a massive amount of data related to the queries and that was still being created when I called cfabort, but ignored when throwing an error. I know I've run into this before so I guess now I have a place to find the answer again :-)